@@ -325,7 +325,7 @@ func (a *ACL) TokenRead(args *structs.ACLTokenGetRequest, reply *structs.ACLToke
325325 return fmt .Errorf ("token has expired: %w" , acl .ErrNotFound )
326326 } else if token == nil {
327327 // token does not exist
328- if ns := args .EnterpriseMeta . NamespaceOrEmpty (); ns != "" {
328+ if ns := args .NamespaceOrEmpty (); ns != "" {
329329 return fmt .Errorf ("token not found in namespace %s: %w" , ns , acl .ErrNotFound )
330330 }
331331 return fmt .Errorf ("token does not exist: %w" , acl .ErrNotFound )
@@ -485,7 +485,7 @@ func (a *ACL) TokenClone(args *structs.ACLTokenSetRequest, reply *structs.ACLTok
485485 if err != nil {
486486 return err
487487 } else if token == nil {
488- if ns := args .ACLToken .EnterpriseMeta . NamespaceOrEmpty (); ns != "" {
488+ if ns := args .ACLToken .NamespaceOrEmpty (); ns != "" {
489489 return fmt .Errorf ("token not found in namespace %s: %w" , ns , acl .ErrNotFound )
490490 }
491491 return fmt .Errorf ("token does not exist: %w" , acl .ErrNotFound )
@@ -630,7 +630,7 @@ func (a *ACL) TokenDelete(args *structs.ACLTokenDeleteRequest, reply *string) er
630630 return a .srv .forwardDC ("ACL.TokenDelete" , a .srv .config .PrimaryDatacenter , args , reply )
631631 } else {
632632 // in Primary Datacenter but the token does not exist - return early indicating it wasn't found.
633- if ns := args .EnterpriseMeta . NamespaceOrEmpty (); ns != "" {
633+ if ns := args .NamespaceOrEmpty (); ns != "" {
634634 return fmt .Errorf ("token not found in namespace %s: %w" , ns , acl .ErrNotFound )
635635 }
636636 return fmt .Errorf ("token does not exist: %w" , acl .ErrNotFound )
@@ -646,7 +646,7 @@ func (a *ACL) TokenDelete(args *structs.ACLTokenDeleteRequest, reply *string) er
646646 }
647647
648648 // Purge the identity from the cache to prevent using the previous definition of the identity
649- a .srv .ACLResolver . cache .RemoveIdentityWithSecretToken (token .SecretID )
649+ a .srv .cache .RemoveIdentityWithSecretToken (token .SecretID )
650650
651651 if reply != nil {
652652 * reply = token .AccessorID
@@ -684,15 +684,15 @@ func (a *ACL) TokenList(args *structs.ACLTokenListRequest, reply *structs.ACLTok
684684 return err
685685 }
686686 // merge the token default meta into the requests meta
687- args .EnterpriseMeta . Merge (& requestMeta )
688- args .EnterpriseMeta . FillAuthzContext (& authzContext )
687+ args .Merge (& requestMeta )
688+ args .FillAuthzContext (& authzContext )
689689 if err := authz .ToAllowAuthorizer ().ACLReadAllowed (& authzContext ); err != nil {
690690 return err
691691 }
692692
693693 var methodMeta * acl.EnterpriseMeta
694694 if args .AuthMethod != "" {
695- methodMeta = args .ACLAuthMethodEnterpriseMeta . ToEnterpriseMeta ()
695+ methodMeta = args .ToEnterpriseMeta ()
696696 // attempt to merge in the overall meta, wildcards will not be merged
697697 methodMeta .MergeNoWildcard (& args .EnterpriseMeta )
698698 // in the event that the meta above didn't merge due to being a wildcard
@@ -981,7 +981,7 @@ func (a *ACL) PolicySet(args *structs.ACLPolicySetRequest, reply *structs.ACLPol
981981 }
982982
983983 // Remove from the cache to prevent stale cache usage
984- a .srv .ACLResolver . cache .RemovePolicy (policy .ID )
984+ a .srv .cache .RemovePolicy (policy .ID )
985985
986986 if _ , policy , err := a .srv .fsm .State ().ACLPolicyGetByID (nil , policy .ID , & policy .EnterpriseMeta ); err == nil && policy != nil {
987987 * reply = * policy
@@ -1024,7 +1024,7 @@ func (a *ACL) PolicyDelete(args *structs.ACLPolicyDeleteRequest, reply *string)
10241024 }
10251025
10261026 if policy == nil {
1027- if ns := args .EnterpriseMeta . NamespaceOrEmpty (); ns != "" {
1027+ if ns := args .NamespaceOrEmpty (); ns != "" {
10281028 return fmt .Errorf ("policy not found in namespace %s: %w" , ns , acl .ErrNotFound )
10291029 }
10301030 return fmt .Errorf ("policy does not exist: %w" , acl .ErrNotFound )
@@ -1043,7 +1043,7 @@ func (a *ACL) PolicyDelete(args *structs.ACLPolicyDeleteRequest, reply *string)
10431043 return fmt .Errorf ("Failed to apply policy delete request: %v" , err )
10441044 }
10451045
1046- a .srv .ACLResolver . cache .RemovePolicy (policy .ID )
1046+ a .srv .cache .RemovePolicy (policy .ID )
10471047
10481048 * reply = policy .Name
10491049
@@ -1104,12 +1104,12 @@ func (a *ACL) PolicyResolve(args *structs.ACLPolicyBatchGetRequest, reply *struc
11041104 }
11051105
11061106 // get full list of policies for this token
1107- identity , policies , err := a .srv .ACLResolver . resolveTokenToIdentityAndPolicies (args .Token )
1107+ identity , policies , err := a .srv .resolveTokenToIdentityAndPolicies (args .Token )
11081108 if err != nil {
11091109 return err
11101110 }
11111111
1112- entIdentity , entPolicies , err := a .srv .ACLResolver . resolveEnterpriseIdentityAndPolicies (identity )
1112+ entIdentity , entPolicies , err := a .srv .resolveEnterpriseIdentityAndPolicies (identity )
11131113 if err != nil {
11141114 return err
11151115 }
@@ -1419,7 +1419,7 @@ func (a *ACL) RoleSet(args *structs.ACLRoleSetRequest, reply *structs.ACLRole) e
14191419 }
14201420
14211421 // Remove from the cache to prevent stale cache usage
1422- a .srv .ACLResolver . cache .RemoveRole (role .ID )
1422+ a .srv .cache .RemoveRole (role .ID )
14231423
14241424 if _ , role , err := a .srv .fsm .State ().ACLRoleGetByID (nil , role .ID , & role .EnterpriseMeta ); err == nil && role != nil {
14251425 * reply = * role
@@ -1462,7 +1462,7 @@ func (a *ACL) RoleDelete(args *structs.ACLRoleDeleteRequest, reply *string) erro
14621462 }
14631463
14641464 if role == nil {
1465- if ns := args .EnterpriseMeta . NamespaceOrEmpty (); ns != "" {
1465+ if ns := args .NamespaceOrEmpty (); ns != "" {
14661466 return fmt .Errorf ("role not found in namespace %s: %w" , ns , acl .ErrNotFound )
14671467 }
14681468 return fmt .Errorf ("role does not exist: %w" , acl .ErrNotFound )
@@ -1477,7 +1477,7 @@ func (a *ACL) RoleDelete(args *structs.ACLRoleDeleteRequest, reply *string) erro
14771477 return fmt .Errorf ("Failed to apply role delete request: %v" , err )
14781478 }
14791479
1480- a .srv .ACLResolver . cache .RemoveRole (role .ID )
1480+ a .srv .cache .RemoveRole (role .ID )
14811481
14821482 * reply = role .Name
14831483
@@ -1532,12 +1532,12 @@ func (a *ACL) RoleResolve(args *structs.ACLRoleBatchGetRequest, reply *structs.A
15321532 }
15331533
15341534 // get full list of roles for this token
1535- identity , roles , err := a .srv .ACLResolver . resolveTokenToIdentityAndRoles (args .Token )
1535+ identity , roles , err := a .srv .resolveTokenToIdentityAndRoles (args .Token )
15361536 if err != nil {
15371537 return err
15381538 }
15391539
1540- entIdentity , entRoles , err := a .srv .ACLResolver . resolveEnterpriseIdentityAndRoles (identity )
1540+ entIdentity , entRoles , err := a .srv .resolveEnterpriseIdentityAndRoles (identity )
15411541 if err != nil {
15421542 return err
15431543 }
@@ -1777,7 +1777,7 @@ func (a *ACL) BindingRuleDelete(args *structs.ACLBindingRuleDeleteRequest, reply
17771777 }
17781778
17791779 if rule == nil {
1780- if ns := args .EnterpriseMeta . NamespaceOrEmpty (); ns != "" {
1780+ if ns := args .NamespaceOrEmpty (); ns != "" {
17811781 return fmt .Errorf ("binding rule not found in namespace %s: %w" , ns , acl .ErrNotFound )
17821782 }
17831783 return fmt .Errorf ("binding rule does not exist: %w" , acl .ErrNotFound )
@@ -2025,7 +2025,7 @@ func (a *ACL) AuthMethodDelete(args *structs.ACLAuthMethodDeleteRequest, reply *
20252025 }
20262026
20272027 if method == nil {
2028- if ns := args .EnterpriseMeta . NamespaceOrEmpty (); ns != "" {
2028+ if ns := args .NamespaceOrEmpty (); ns != "" {
20292029 return fmt .Errorf ("auth method not found in namespace %s: %w" , ns , acl .ErrNotFound )
20302030 }
20312031 return fmt .Errorf ("auth method does not exist: %w" , acl .ErrNotFound )
0 commit comments