Skip to content

Commit

Permalink
Allow the bootstrap endpoint to be disabled in enterprise. (#7614)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkeeler authored and hashicorp-ci committed Apr 14, 2020
1 parent ea53fc6 commit cfab77e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions agent/consul/acl_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions agent/consul/acl_server_oss.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit cfab77e

Please sign in to comment.