Codegen: Remove pfs codegen dependency from Grafana codebase (#98840)
* Remove pfs dependency for IAM struct to avoid to import codegen code in main go.mod * Remove pointer * Remove dependency cycle * Update tests
This commit is contained in:
@@ -2,8 +2,6 @@ package auth
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/grafana/grafana/pkg/plugins/codegen/pfs"
|
||||
)
|
||||
|
||||
type ExternalService struct {
|
||||
@@ -12,8 +10,17 @@ type ExternalService struct {
|
||||
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 pfs.Type, svc *pfs.IAM) (*ExternalService, error)
|
||||
RegisterExternalService(ctx context.Context, pluginID string, pType string, svc *IAM) (*ExternalService, error)
|
||||
RemoveExternalService(ctx context.Context, pluginID string) error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user