@@ -326,7 +326,7 @@ func (a *ACL) TokenRead(args *structs.ACLTokenGetRequest, reply *structs.ACLToke
326326 return fmt .Errorf ("token has expired: %w" , acl .ErrNotFound )
327327 } else if token == nil {
328328 // token does not exist
329- if ns := args .EnterpriseMeta . NamespaceOrEmpty (); ns != "" {
329+ if ns := args .NamespaceOrEmpty (); ns != "" {
330330 return fmt .Errorf ("token not found in namespace %s: %w" , ns , acl .ErrNotFound )
331331 }
332332 return fmt .Errorf ("token does not exist: %w" , acl .ErrNotFound )
@@ -486,7 +486,7 @@ func (a *ACL) TokenClone(args *structs.ACLTokenSetRequest, reply *structs.ACLTok
486486 if err != nil {
487487 return err
488488 } else if token == nil {
489- if ns := args .ACLToken .EnterpriseMeta . NamespaceOrEmpty (); ns != "" {
489+ if ns := args .ACLToken .NamespaceOrEmpty (); ns != "" {
490490 return fmt .Errorf ("token not found in namespace %s: %w" , ns , acl .ErrNotFound )
491491 }
492492 return fmt .Errorf ("token does not exist: %w" , acl .ErrNotFound )
@@ -631,7 +631,7 @@ func (a *ACL) TokenDelete(args *structs.ACLTokenDeleteRequest, reply *string) er
631631 return a .srv .forwardDC ("ACL.TokenDelete" , a .srv .config .PrimaryDatacenter , args , reply )
632632 } else {
633633 // in Primary Datacenter but the token does not exist - return early indicating it wasn't found.
634- if ns := args .EnterpriseMeta . NamespaceOrEmpty (); ns != "" {
634+ if ns := args .NamespaceOrEmpty (); ns != "" {
635635 return fmt .Errorf ("token not found in namespace %s: %w" , ns , acl .ErrNotFound )
636636 }
637637 return fmt .Errorf ("token does not exist: %w" , acl .ErrNotFound )
@@ -647,7 +647,7 @@ func (a *ACL) TokenDelete(args *structs.ACLTokenDeleteRequest, reply *string) er
647647 }
648648
649649 // Purge the identity from the cache to prevent using the previous definition of the identity
650- a .srv .ACLResolver . cache .RemoveIdentityWithSecretToken (token .SecretID )
650+ a .srv .cache .RemoveIdentityWithSecretToken (token .SecretID )
651651
652652 if reply != nil {
653653 * reply = token .AccessorID
@@ -685,15 +685,15 @@ func (a *ACL) TokenList(args *structs.ACLTokenListRequest, reply *structs.ACLTok
685685 return err
686686 }
687687 // merge the token default meta into the requests meta
688- args .EnterpriseMeta . Merge (& requestMeta )
689- args .EnterpriseMeta . FillAuthzContext (& authzContext )
688+ args .Merge (& requestMeta )
689+ args .FillAuthzContext (& authzContext )
690690 if err := authz .ToAllowAuthorizer ().ACLReadAllowed (& authzContext ); err != nil {
691691 return err
692692 }
693693
694694 var methodMeta * acl.EnterpriseMeta
695695 if args .AuthMethod != "" {
696- methodMeta = args .ACLAuthMethodEnterpriseMeta . ToEnterpriseMeta ()
696+ methodMeta = args .ToEnterpriseMeta ()
697697 // attempt to merge in the overall meta, wildcards will not be merged
698698 methodMeta .MergeNoWildcard (& args .EnterpriseMeta )
699699 // in the event that the meta above didn't merge due to being a wildcard
@@ -982,7 +982,7 @@ func (a *ACL) PolicySet(args *structs.ACLPolicySetRequest, reply *structs.ACLPol
982982 }
983983
984984 // Remove from the cache to prevent stale cache usage
985- a .srv .ACLResolver . cache .RemovePolicy (policy .ID )
985+ a .srv .cache .RemovePolicy (policy .ID )
986986
987987 if _ , policy , err := a .srv .fsm .State ().ACLPolicyGetByID (nil , policy .ID , & policy .EnterpriseMeta ); err == nil && policy != nil {
988988 * reply = * policy
@@ -1025,7 +1025,7 @@ func (a *ACL) PolicyDelete(args *structs.ACLPolicyDeleteRequest, reply *string)
10251025 }
10261026
10271027 if policy == nil {
1028- if ns := args .EnterpriseMeta . NamespaceOrEmpty (); ns != "" {
1028+ if ns := args .NamespaceOrEmpty (); ns != "" {
10291029 return fmt .Errorf ("policy not found in namespace %s: %w" , ns , acl .ErrNotFound )
10301030 }
10311031 return fmt .Errorf ("policy does not exist: %w" , acl .ErrNotFound )
@@ -1044,7 +1044,7 @@ func (a *ACL) PolicyDelete(args *structs.ACLPolicyDeleteRequest, reply *string)
10441044 return fmt .Errorf ("Failed to apply policy delete request: %v" , err )
10451045 }
10461046
1047- a .srv .ACLResolver . cache .RemovePolicy (policy .ID )
1047+ a .srv .cache .RemovePolicy (policy .ID )
10481048
10491049 * reply = policy .Name
10501050
@@ -1105,12 +1105,12 @@ func (a *ACL) PolicyResolve(args *structs.ACLPolicyBatchGetRequest, reply *struc
11051105 }
11061106
11071107 // get full list of policies for this token
1108- identity , policies , err := a .srv .ACLResolver . resolveTokenToIdentityAndPolicies (args .Token )
1108+ identity , policies , err := a .srv .resolveTokenToIdentityAndPolicies (args .Token )
11091109 if err != nil {
11101110 return err
11111111 }
11121112
1113- entIdentity , entPolicies , err := a .srv .ACLResolver . resolveEnterpriseIdentityAndPolicies (identity )
1113+ entIdentity , entPolicies , err := a .srv .resolveEnterpriseIdentityAndPolicies (identity )
11141114 if err != nil {
11151115 return err
11161116 }
@@ -1420,7 +1420,7 @@ func (a *ACL) RoleSet(args *structs.ACLRoleSetRequest, reply *structs.ACLRole) e
14201420 }
14211421
14221422 // Remove from the cache to prevent stale cache usage
1423- a .srv .ACLResolver . cache .RemoveRole (role .ID )
1423+ a .srv .cache .RemoveRole (role .ID )
14241424
14251425 if _ , role , err := a .srv .fsm .State ().ACLRoleGetByID (nil , role .ID , & role .EnterpriseMeta ); err == nil && role != nil {
14261426 * reply = * role
@@ -1463,7 +1463,7 @@ func (a *ACL) RoleDelete(args *structs.ACLRoleDeleteRequest, reply *string) erro
14631463 }
14641464
14651465 if role == nil {
1466- if ns := args .EnterpriseMeta . NamespaceOrEmpty (); ns != "" {
1466+ if ns := args .NamespaceOrEmpty (); ns != "" {
14671467 return fmt .Errorf ("role not found in namespace %s: %w" , ns , acl .ErrNotFound )
14681468 }
14691469 return fmt .Errorf ("role does not exist: %w" , acl .ErrNotFound )
@@ -1478,7 +1478,7 @@ func (a *ACL) RoleDelete(args *structs.ACLRoleDeleteRequest, reply *string) erro
14781478 return fmt .Errorf ("Failed to apply role delete request: %v" , err )
14791479 }
14801480
1481- a .srv .ACLResolver . cache .RemoveRole (role .ID )
1481+ a .srv .cache .RemoveRole (role .ID )
14821482
14831483 * reply = role .Name
14841484
@@ -1533,12 +1533,12 @@ func (a *ACL) RoleResolve(args *structs.ACLRoleBatchGetRequest, reply *structs.A
15331533 }
15341534
15351535 // get full list of roles for this token
1536- identity , roles , err := a .srv .ACLResolver . resolveTokenToIdentityAndRoles (args .Token )
1536+ identity , roles , err := a .srv .resolveTokenToIdentityAndRoles (args .Token )
15371537 if err != nil {
15381538 return err
15391539 }
15401540
1541- entIdentity , entRoles , err := a .srv .ACLResolver . resolveEnterpriseIdentityAndRoles (identity )
1541+ entIdentity , entRoles , err := a .srv .resolveEnterpriseIdentityAndRoles (identity )
15421542 if err != nil {
15431543 return err
15441544 }
@@ -1778,7 +1778,7 @@ func (a *ACL) BindingRuleDelete(args *structs.ACLBindingRuleDeleteRequest, reply
17781778 }
17791779
17801780 if rule == nil {
1781- if ns := args .EnterpriseMeta . NamespaceOrEmpty (); ns != "" {
1781+ if ns := args .NamespaceOrEmpty (); ns != "" {
17821782 return fmt .Errorf ("binding rule not found in namespace %s: %w" , ns , acl .ErrNotFound )
17831783 }
17841784 return fmt .Errorf ("binding rule does not exist: %w" , acl .ErrNotFound )
@@ -2026,7 +2026,7 @@ func (a *ACL) AuthMethodDelete(args *structs.ACLAuthMethodDeleteRequest, reply *
20262026 }
20272027
20282028 if method == nil {
2029- if ns := args .EnterpriseMeta . NamespaceOrEmpty (); ns != "" {
2029+ if ns := args .NamespaceOrEmpty (); ns != "" {
20302030 return fmt .Errorf ("auth method not found in namespace %s: %w" , ns , acl .ErrNotFound )
20312031 }
20322032 return fmt .Errorf ("auth method does not exist: %w" , acl .ErrNotFound )
0 commit comments