Skip to content

Commit c0ba572

Browse files
committed
IsValidPolicyAWSPrincipal: Reduce visibility.
1 parent 8a4ea98 commit c0ba572

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

internal/service/iam/exports_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ var (
6666
AttachPolicyToUser = attachPolicyToUser
6767
CheckPwdPolicy = checkPwdPolicy
6868
GeneratePassword = generatePassword
69+
IsValidPolicyAWSPrincipal = isValidPolicyAWSPrincipal
6970
ListGroupsForUserPages = listGroupsForUserPages
7071
RoleNameSessionFromARN = roleNameSessionFromARN
7172
RolePolicyParseID = rolePolicyParseID

internal/service/iam/policy_model.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,12 @@ func policyHasValidAWSPrincipals(policy string) (bool, error) { // nosemgrep:ci.
273273
for _, principal := range principals {
274274
switch x := principal.(type) {
275275
case string:
276-
if !IsValidPolicyAWSPrincipal(x) {
276+
if !isValidPolicyAWSPrincipal(x) {
277277
return false, nil
278278
}
279279
case []string:
280280
for _, s := range x {
281-
if !IsValidPolicyAWSPrincipal(s) {
281+
if !isValidPolicyAWSPrincipal(s) {
282282
return false, nil
283283
}
284284
}
@@ -288,9 +288,9 @@ func policyHasValidAWSPrincipals(policy string) (bool, error) { // nosemgrep:ci.
288288
return true, nil
289289
}
290290

291-
// IsValidPolicyAWSPrincipal returns true if a string is a valid AWS Princial for an IAM Policy document
291+
// isValidPolicyAWSPrincipal returns true if a string is a valid AWS Princial for an IAM Policy document
292292
// That is: either an ARN, an AWS account ID, or `*`
293-
func IsValidPolicyAWSPrincipal(principal string) bool { // nosemgrep:ci.aws-in-func-name
293+
func isValidPolicyAWSPrincipal(principal string) bool { // nosemgrep:ci.aws-in-func-name
294294
if principal == "*" {
295295
return true
296296
}

0 commit comments

Comments
 (0)