Skip to content

Commit

Permalink
Merge pull request #1010 from hashicorp/bugfix/application-role-value
Browse files Browse the repository at this point in the history
Applications: support app role values up to 249 characters
  • Loading branch information
manicminer authored Feb 16, 2023
2 parents 37dfc7d + 9fe9c54 commit 631ae12
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions internal/services/applications/validate/tokens.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ func RoleScopeClaimValue(i interface{}, path cty.Path) (ret diag.Diagnostics) {
return
}

if len(v) > 120 {
if len(v) > 249 {
ret = append(ret, diag.Diagnostic{
Severity: diag.Error,
Summary: "Value must be between 0-120 characters in length",
Summary: "Value must be between 0-249 characters in length",
AttributePath: path,
})
}
Expand Down
7 changes: 6 additions & 1 deletion internal/services/applications/validate/tokens_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,18 @@ func TestRoleScopeClaimValue(t *testing.T) {
TestName: "Valid_MaxLength",
ErrCount: 0,
},
{
Value: acctest.RandString(249),
TestName: "Valid_MaxLength",
ErrCount: 0,
},
{
Value: "",
TestName: "Valid_Empty",
ErrCount: 0,
},
{
Value: acctest.RandString(121),
Value: acctest.RandString(250),
TestName: "Invalid_MaxLength",
ErrCount: 1,
},
Expand Down

0 comments on commit 631ae12

Please sign in to comment.