mirror of
https://github.com/grafana/grafana.git
synced 2025-07-29 04:52:10 +08:00

* Remove pfs dependency for IAM struct to avoid to import codegen code in main go.mod * Remove pointer * Remove dependency cycle * Update tests
27 lines
655 B
Go
27 lines
655 B
Go
package auth
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
type ExternalService struct {
|
|
ClientID string `json:"clientId"`
|
|
ClientSecret string `json:"clientSecret"`
|
|
PrivateKey string `json:"privateKey"`
|
|
}
|
|
|
|
type IAM struct {
|
|
Permissions []Permission `json:"permissions,omitempty"`
|
|
}
|
|
|
|
type Permission struct {
|
|
Action string `json:"action"`
|
|
Scope string `json:"scope"`
|
|
}
|
|
|
|
type ExternalServiceRegistry interface {
|
|
HasExternalService(ctx context.Context, pluginID string) (bool, error)
|
|
RegisterExternalService(ctx context.Context, pluginID string, pType string, svc *IAM) (*ExternalService, error)
|
|
RemoveExternalService(ctx context.Context, pluginID string) error
|
|
}
|