Auth: Add IsClientEnabled and IsEnabled for the authn.Service and authn.Client interfaces (#86034)
* Add `Service. IsClientEnabled` and `Client.IsEnabled` functions * Implement `IsEnabled` function for authn clients * Implement `IsClientEnabled` function for authn services
This commit is contained in:
@@ -70,6 +70,10 @@ func (s *APIKey) Authenticate(ctx context.Context, r *authn.Request) (*authn.Ide
|
||||
return newServiceAccountIdentity(key), nil
|
||||
}
|
||||
|
||||
func (s *APIKey) IsEnabled() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (s *APIKey) getAPIKey(ctx context.Context, token string) (*apikey.APIKey, error) {
|
||||
fn := s.getFromToken
|
||||
if !strings.HasPrefix(token, satokengen.GrafanaPrefix) {
|
||||
|
||||
Reference in New Issue
Block a user