Service Accounts: Display name to ID (#46258)
* ServiceAccounts: modernize SA creation interface * ServiceAccounts: improve service account ID generation * ServiceAccounts: remove unused method * ServiceAccounts: Make SA ID display name dependent * ServiceAccounts: Add tests for Service Account creation * trim trailing whitespace * Update pkg/services/serviceaccounts/api/api.go Co-authored-by: Ieva <ieva.vasiljeva@grafana.com> * Update pkg/services/serviceaccounts/api/api.go Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
This commit is contained in:
@@ -6,6 +6,17 @@ import (
|
||||
"github.com/grafana/grafana/pkg/models"
|
||||
)
|
||||
|
||||
type ErrSAInvalidName struct {
|
||||
}
|
||||
|
||||
func (e *ErrSAInvalidName) Error() string {
|
||||
return "service account name already in use"
|
||||
}
|
||||
|
||||
func (e *ErrSAInvalidName) Unwrap() error {
|
||||
return models.ErrUserAlreadyExists
|
||||
}
|
||||
|
||||
type ErrMisingSAToken struct {
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user