Chore: Update plugin schema with service registration info (#70692)
This commit is contained in:
@@ -3,29 +3,9 @@ package oauth
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/grafana/grafana/pkg/services/accesscontrol"
|
||||
"github.com/grafana/grafana/pkg/plugins/plugindef"
|
||||
)
|
||||
|
||||
// SelfCfg is a subset of oauthserver.SelfCfg making some fields optional
|
||||
type SelfCfg struct {
|
||||
Enabled *bool `json:"enabled,omitempty"`
|
||||
Permissions []accesscontrol.Permission `json:"permissions,omitempty"`
|
||||
}
|
||||
|
||||
// ImpersonationCfg is a subset of oauthserver.ImpersonationCfg making some fields optional
|
||||
type ImpersonationCfg struct {
|
||||
Enabled *bool `json:"enabled,omitempty"`
|
||||
Groups *bool `json:"groups,omitempty"`
|
||||
Permissions []accesscontrol.Permission `json:"permissions,omitempty"`
|
||||
}
|
||||
|
||||
// PluginExternalServiceRegistration is a subset of oauthserver.ExternalServiceRegistration
|
||||
// simplified for the plugin use case.
|
||||
type ExternalServiceRegistration struct {
|
||||
Impersonation *ImpersonationCfg `json:"impersonation,omitempty"`
|
||||
Self *SelfCfg `json:"self,omitempty"`
|
||||
}
|
||||
|
||||
type ExternalService struct {
|
||||
ClientID string `json:"clientId"`
|
||||
ClientSecret string `json:"clientSecret"`
|
||||
@@ -33,5 +13,5 @@ type ExternalService struct {
|
||||
}
|
||||
|
||||
type ExternalServiceRegistry interface {
|
||||
RegisterExternalService(ctx context.Context, name string, svc *ExternalServiceRegistration) (*ExternalService, error)
|
||||
RegisterExternalService(ctx context.Context, name string, svc *plugindef.ExternalServiceRegistration) (*ExternalService, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user