mirror of
https://github.com/grafana/grafana.git
synced 2026-08-13 06:34:55 -05:00
Plugins: Rename oauth package to auth (#75611)
* Plugins: Rename oauth package to auth * Missed one comment
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package oauth
|
||||
package auth
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -14,8 +14,8 @@ import (
|
||||
"github.com/grafana/grafana-plugin-sdk-go/experimental/featuretoggles"
|
||||
|
||||
"github.com/grafana/grafana/pkg/plugins"
|
||||
"github.com/grafana/grafana/pkg/plugins/auth"
|
||||
"github.com/grafana/grafana/pkg/plugins/config"
|
||||
"github.com/grafana/grafana/pkg/plugins/oauth"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -74,7 +74,7 @@ func (s *Service) Get(ctx context.Context, p *plugins.Plugin) []string {
|
||||
}
|
||||
|
||||
// GetConfigMap returns a map of configuration that should be passed in a plugin request.
|
||||
func (s *Service) GetConfigMap(ctx context.Context, _ string, _ *oauth.ExternalService) map[string]string {
|
||||
func (s *Service) GetConfigMap(ctx context.Context, _ string, _ *auth.ExternalService) map[string]string {
|
||||
m := make(map[string]string)
|
||||
|
||||
// TODO add support via plugin SDK
|
||||
|
||||
@@ -9,9 +9,9 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/grafana/grafana/pkg/plugins"
|
||||
"github.com/grafana/grafana/pkg/plugins/auth"
|
||||
"github.com/grafana/grafana/pkg/plugins/config"
|
||||
"github.com/grafana/grafana/pkg/plugins/manager/fakes"
|
||||
"github.com/grafana/grafana/pkg/plugins/oauth"
|
||||
"github.com/grafana/grafana/pkg/plugins/plugindef"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
@@ -313,7 +313,7 @@ func TestInitializer_oauthEnvVars(t *testing.T) {
|
||||
ID: "test",
|
||||
ExternalServiceRegistration: &plugindef.ExternalServiceRegistration{},
|
||||
},
|
||||
ExternalService: &oauth.ExternalService{
|
||||
ExternalService: &auth.ExternalService{
|
||||
ClientID: "clientID",
|
||||
ClientSecret: "clientSecret",
|
||||
PrivateKey: "privatePem",
|
||||
|
||||
@@ -10,9 +10,9 @@ import (
|
||||
"github.com/grafana/grafana-plugin-sdk-go/backend"
|
||||
|
||||
"github.com/grafana/grafana/pkg/plugins"
|
||||
"github.com/grafana/grafana/pkg/plugins/auth"
|
||||
"github.com/grafana/grafana/pkg/plugins/backendplugin"
|
||||
"github.com/grafana/grafana/pkg/plugins/log"
|
||||
"github.com/grafana/grafana/pkg/plugins/oauth"
|
||||
"github.com/grafana/grafana/pkg/plugins/plugindef"
|
||||
"github.com/grafana/grafana/pkg/plugins/repo"
|
||||
"github.com/grafana/grafana/pkg/plugins/storage"
|
||||
@@ -425,11 +425,11 @@ func (f *FakePluginFileStore) File(ctx context.Context, pluginID, filename strin
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
type FakeOauthService struct {
|
||||
Result *oauth.ExternalService
|
||||
type FakeAuthService struct {
|
||||
Result *auth.ExternalService
|
||||
}
|
||||
|
||||
func (f *FakeOauthService) RegisterExternalService(ctx context.Context, name string, svc *plugindef.ExternalServiceRegistration) (*oauth.ExternalService, error) {
|
||||
func (f *FakeAuthService) RegisterExternalService(ctx context.Context, name string, svc *plugindef.ExternalServiceRegistration) (*auth.ExternalService, error) {
|
||||
return f.Result, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -14,11 +14,11 @@ import (
|
||||
|
||||
"github.com/grafana/grafana-plugin-sdk-go/backend"
|
||||
|
||||
"github.com/grafana/grafana/pkg/plugins/auth"
|
||||
"github.com/grafana/grafana/pkg/plugins/backendplugin"
|
||||
"github.com/grafana/grafana/pkg/plugins/backendplugin/pluginextensionv2"
|
||||
"github.com/grafana/grafana/pkg/plugins/backendplugin/secretsmanagerplugin"
|
||||
"github.com/grafana/grafana/pkg/plugins/log"
|
||||
"github.com/grafana/grafana/pkg/plugins/oauth"
|
||||
"github.com/grafana/grafana/pkg/plugins/plugindef"
|
||||
"github.com/grafana/grafana/pkg/services/org"
|
||||
"github.com/grafana/grafana/pkg/util"
|
||||
@@ -56,7 +56,7 @@ type Plugin struct {
|
||||
|
||||
AngularDetected bool
|
||||
|
||||
ExternalService *oauth.ExternalService
|
||||
ExternalService *auth.ExternalService
|
||||
|
||||
Renderer pluginextensionv2.RendererPlugin
|
||||
SecretsManager secretsmanagerplugin.SecretsManagerPlugin
|
||||
@@ -112,7 +112,7 @@ type JSONData struct {
|
||||
// Backend (Datasource + Renderer + SecretsManager)
|
||||
Executable string `json:"executable,omitempty"`
|
||||
|
||||
// Oauth App Service Registration
|
||||
// App Service Auth Registration
|
||||
ExternalServiceRegistration *plugindef.ExternalServiceRegistration `json:"externalServiceRegistration,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user