|
|
@ -498,16 +498,6 @@ func (s *Server) initializeACLs(ctx context.Context) error {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Ignoring expiration times to avoid an insertion collision.
|
|
|
|
// Ignoring expiration times to avoid an insertion collision.
|
|
|
|
if token == nil {
|
|
|
|
if token == nil {
|
|
|
|
// DEPRECATED (ACL-Legacy-Compat) - Don't need to query for previous "anonymous" token
|
|
|
|
|
|
|
|
// check for legacy token that needs an upgrade
|
|
|
|
|
|
|
|
_, legacyToken, err := state.ACLTokenGetBySecret(nil, anonymousToken, nil)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return fmt.Errorf("failed to get anonymous token: %v", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// Ignoring expiration times to avoid an insertion collision.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// the token upgrade routine will take care of upgrading the token if a legacy version exists
|
|
|
|
|
|
|
|
if legacyToken == nil {
|
|
|
|
|
|
|
|
token = &structs.ACLToken{
|
|
|
|
token = &structs.ACLToken{
|
|
|
|
AccessorID: structs.ACLTokenAnonymousID,
|
|
|
|
AccessorID: structs.ACLTokenAnonymousID,
|
|
|
|
SecretID: anonymousToken,
|
|
|
|
SecretID: anonymousToken,
|
|
|
@ -527,7 +517,6 @@ func (s *Server) initializeACLs(ctx context.Context) error {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
s.logger.Info("Created ACL anonymous token from configuration")
|
|
|
|
s.logger.Info("Created ACL anonymous token from configuration")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// launch the upgrade go routine to generate accessors for everything
|
|
|
|
// launch the upgrade go routine to generate accessors for everything
|
|
|
|
s.startACLUpgrade(ctx)
|
|
|
|
s.startACLUpgrade(ctx)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|