mirror of
https://github.com/grafana/grafana.git
synced 2026-06-10 17:11:31 -04:00
31 lines
844 B
Go
31 lines
844 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
|
|
}
|
|
|
|
// RBACCleanered to clean up RBAC data associated with plugins when they are uninstalled.
|
|
type RBACCleaner interface {
|
|
CleanupPluginRBAC(ctx context.Context, pluginIDs ...string) error
|
|
}
|