Skip to content

Commit

Permalink
Merge pull request hashicorp#750 from hashicorp/bugfix/issue-721
Browse files Browse the repository at this point in the history
azuread_application: Scope/Role validation for magic string "User"
  • Loading branch information
manicminer authored Mar 8, 2022
2 parents 9f34405 + af740a7 commit 1690d10
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions internal/services/applications/validate/tokens.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package validate

import (
"fmt"
"regexp"
"strings"

"github.com/hashicorp/go-cty/cty"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
Expand Down Expand Up @@ -44,5 +46,14 @@ func RoleScopeClaimValue(i interface{}, path cty.Path) (ret diag.Diagnostics) {
})
}

// See https://github.com/hashicorp/terraform-provider-azuread/issues/721
if strings.EqualFold(v, "User") {
ret = append(ret, diag.Diagnostic{
Severity: diag.Error,
Summary: fmt.Sprintf("Value cannot have the string value %q", "User"),
AttributePath: path,
})
}

return // nolint:nakedret
}

0 comments on commit 1690d10

Please sign in to comment.