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:
Selene
2025-01-10 22:43:40 +02:00
committed by GitHub
parent c9d22f06c3
commit 9e5fd78b52
17 changed files with 90 additions and 191 deletions
+10 -3
View File
@@ -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
}