|
|
|
@ -184,7 +184,7 @@ func (a *ACL) BootstrapTokens(args *structs.DCSpecificRequest, reply *structs.AC
|
|
|
|
|
if err := a.aclPreCheck(); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.BootstrapTokens", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.BootstrapTokens", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -279,7 +279,7 @@ func (a *ACL) TokenRead(args *structs.ACLTokenGetRequest, reply *structs.ACLToke
|
|
|
|
|
args.Datacenter = a.srv.config.ACLDatacenter
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.TokenRead", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.TokenRead", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -348,7 +348,7 @@ func (a *ACL) TokenClone(args *structs.ACLTokenSetRequest, reply *structs.ACLTok
|
|
|
|
|
args.Datacenter = a.srv.config.ACLDatacenter
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.TokenClone", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.TokenClone", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -419,7 +419,7 @@ func (a *ACL) TokenSet(args *structs.ACLTokenSetRequest, reply *structs.ACLToken
|
|
|
|
|
return fmt.Errorf("Local tokens are disabled")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.TokenSet", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.TokenSet", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -825,7 +825,7 @@ func (a *ACL) TokenDelete(args *structs.ACLTokenDeleteRequest, reply *string) er
|
|
|
|
|
args.Datacenter = a.srv.config.ACLDatacenter
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.TokenDelete", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.TokenDelete", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -911,7 +911,7 @@ func (a *ACL) TokenList(args *structs.ACLTokenListRequest, reply *structs.ACLTok
|
|
|
|
|
args.Datacenter = a.srv.config.ACLDatacenter
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.TokenList", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.TokenList", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -974,7 +974,7 @@ func (a *ACL) TokenBatchRead(args *structs.ACLTokenBatchGetRequest, reply *struc
|
|
|
|
|
args.Datacenter = a.srv.config.ACLDatacenter
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.TokenBatchRead", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.TokenBatchRead", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1028,7 +1028,7 @@ func (a *ACL) PolicyRead(args *structs.ACLPolicyGetRequest, reply *structs.ACLPo
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.PolicyRead", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.PolicyRead", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1066,7 +1066,7 @@ func (a *ACL) PolicyBatchRead(args *structs.ACLPolicyBatchGetRequest, reply *str
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.PolicyBatchRead", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.PolicyBatchRead", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1104,7 +1104,7 @@ func (a *ACL) PolicySet(args *structs.ACLPolicySetRequest, reply *structs.ACLPol
|
|
|
|
|
args.Datacenter = a.srv.config.ACLDatacenter
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.PolicySet", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.PolicySet", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1235,7 +1235,7 @@ func (a *ACL) PolicyDelete(args *structs.ACLPolicyDeleteRequest, reply *string)
|
|
|
|
|
args.Datacenter = a.srv.config.ACLDatacenter
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.PolicyDelete", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.PolicyDelete", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1288,7 +1288,7 @@ func (a *ACL) PolicyList(args *structs.ACLPolicyListRequest, reply *structs.ACLP
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.PolicyList", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.PolicyList", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1328,7 +1328,7 @@ func (a *ACL) PolicyResolve(args *structs.ACLPolicyBatchGetRequest, reply *struc
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.PolicyResolve", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.PolicyResolve", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1386,7 +1386,7 @@ func makeACLETag(parent string, policy *acl.Policy) string {
|
|
|
|
|
// GetPolicy is used to retrieve a compiled policy object with a TTL. Does not
|
|
|
|
|
// support a blocking query.
|
|
|
|
|
func (a *ACL) GetPolicy(args *structs.ACLPolicyResolveLegacyRequest, reply *structs.ACLPolicyResolveLegacyResponse) error {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.GetPolicy", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.GetPolicy", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1433,7 +1433,7 @@ func (a *ACL) ReplicationStatus(args *structs.DCSpecificRequest,
|
|
|
|
|
// re-using a structure where we don't support all the options.
|
|
|
|
|
args.RequireConsistent = true
|
|
|
|
|
args.AllowStale = false
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.ReplicationStatus", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.ReplicationStatus", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1461,7 +1461,7 @@ func (a *ACL) RoleRead(args *structs.ACLRoleGetRequest, reply *structs.ACLRoleRe
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.RoleRead", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.RoleRead", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1500,7 +1500,7 @@ func (a *ACL) RoleBatchRead(args *structs.ACLRoleBatchGetRequest, reply *structs
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.RoleBatchRead", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.RoleBatchRead", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1538,7 +1538,7 @@ func (a *ACL) RoleSet(args *structs.ACLRoleSetRequest, reply *structs.ACLRole) e
|
|
|
|
|
args.Datacenter = a.srv.config.ACLDatacenter
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.RoleSet", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.RoleSet", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1696,7 +1696,7 @@ func (a *ACL) RoleDelete(args *structs.ACLRoleDeleteRequest, reply *string) erro
|
|
|
|
|
args.Datacenter = a.srv.config.ACLDatacenter
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.RoleDelete", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.RoleDelete", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1745,7 +1745,7 @@ func (a *ACL) RoleList(args *structs.ACLRoleListRequest, reply *structs.ACLRoleL
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.RoleList", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.RoleList", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1779,7 +1779,7 @@ func (a *ACL) RoleResolve(args *structs.ACLRoleBatchGetRequest, reply *structs.A
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.RoleResolve", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.RoleResolve", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1844,7 +1844,7 @@ func (a *ACL) BindingRuleRead(args *structs.ACLBindingRuleGetRequest, reply *str
|
|
|
|
|
return errAuthMethodsRequireTokenReplication
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.BindingRuleRead", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.BindingRuleRead", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1883,7 +1883,7 @@ func (a *ACL) BindingRuleSet(args *structs.ACLBindingRuleSetRequest, reply *stru
|
|
|
|
|
return errAuthMethodsRequireTokenReplication
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.BindingRuleSet", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.BindingRuleSet", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2012,7 +2012,7 @@ func (a *ACL) BindingRuleDelete(args *structs.ACLBindingRuleDeleteRequest, reply
|
|
|
|
|
return errAuthMethodsRequireTokenReplication
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.BindingRuleDelete", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.BindingRuleDelete", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2063,7 +2063,7 @@ func (a *ACL) BindingRuleList(args *structs.ACLBindingRuleListRequest, reply *st
|
|
|
|
|
return errAuthMethodsRequireTokenReplication
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.BindingRuleList", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.BindingRuleList", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2103,7 +2103,7 @@ func (a *ACL) AuthMethodRead(args *structs.ACLAuthMethodGetRequest, reply *struc
|
|
|
|
|
return errAuthMethodsRequireTokenReplication
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.AuthMethodRead", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.AuthMethodRead", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2145,7 +2145,7 @@ func (a *ACL) AuthMethodSet(args *structs.ACLAuthMethodSetRequest, reply *struct
|
|
|
|
|
return errAuthMethodsRequireTokenReplication
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.AuthMethodSet", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.AuthMethodSet", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2257,7 +2257,7 @@ func (a *ACL) AuthMethodDelete(args *structs.ACLAuthMethodDeleteRequest, reply *
|
|
|
|
|
return errAuthMethodsRequireTokenReplication
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.AuthMethodDelete", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.AuthMethodDelete", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2313,7 +2313,7 @@ func (a *ACL) AuthMethodList(args *structs.ACLAuthMethodListRequest, reply *stru
|
|
|
|
|
return errAuthMethodsRequireTokenReplication
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.AuthMethodList", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.AuthMethodList", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2367,7 +2367,7 @@ func (a *ACL) Login(args *structs.ACLLoginRequest, reply *structs.ACLToken) erro
|
|
|
|
|
return errors.New("do not provide a token when logging in")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.Login", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.Login", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2512,7 +2512,7 @@ func (a *ACL) Logout(args *structs.ACLLogoutRequest, reply *bool) error {
|
|
|
|
|
return acl.ErrNotFound
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.Logout", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.Logout", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2559,7 +2559,7 @@ func (a *ACL) Authorize(args *structs.RemoteACLAuthorizationRequest, reply *[]st
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.Authorize", args, args, reply); done {
|
|
|
|
|
if done, err := a.srv.ForwardRPC("ACL.Authorize", args, reply); done {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|