Allow the bootstrap endpoint to be disabled in enterprise. (#7614)

pull/7650/head
Matt Keeler 2020-04-14 11:45:39 -04:00 committed by GitHub
parent 4bfaeb5cd2
commit da893c36a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -115,6 +115,10 @@ func (a *ACL) BootstrapTokens(args *structs.DCSpecificRequest, reply *structs.AC
return err
}
if err := a.srv.aclBootstrapAllowed(); err != nil {
return err
}
// Verify we are allowed to serve this request
if !a.srv.InACLDatacenter() {
return acl.ErrDisabled

View File

@ -16,3 +16,11 @@ func (s *Server) ResolveEntTokenToIdentityAndAuthorizer(token string) (structs.A
func (s *Server) validateEnterpriseToken(identity structs.ACLIdentity) error {
return nil
}
// aclBootstrapAllowed returns whether the server's configuration would allow ACL bootstrapping
//
// This endpoint does not take into account whether bootstrapping has been performed previously
// nor the bootstrap reset file.
func (s *Server) aclBootstrapAllowed() error {
return nil
}