Auth: Add access token to in-proc communication and ServiceIdentity (#98926)

Use fake access token for in-proc grpc and add ServiceIdentity 
---------

Co-authored-by: gamab <gabriel.mabille@grafana.com>
Co-authored-by: Karl Persson <23356117+kalleep@users.noreply.github.com>
This commit is contained in:
Misi
2025-01-24 14:03:23 +01:00
committed by GitHub
co-authored by gamab Karl Persson
parent eb2d276a42
commit 437b7a565d
12 changed files with 193 additions and 179 deletions
+1 -8
View File
@@ -20,7 +20,6 @@ import (
"k8s.io/apimachinery/pkg/types"
claims "github.com/grafana/authlib/types"
"github.com/grafana/grafana/pkg/apimachinery/identity"
"github.com/grafana/grafana/pkg/apimachinery/utils"
)
@@ -233,13 +232,7 @@ func NewResourceServer(opts ResourceServerOptions) (ResourceServer, error) {
}
// Make this cancelable
ctx, cancel := context.WithCancel(claims.WithAuthInfo(context.Background(),
&identity.StaticRequester{
Type: claims.TypeServiceAccount,
Login: "watcher", // admin user for watch
UserID: 1,
IsGrafanaAdmin: true,
}))
ctx, cancel := context.WithCancel(context.Background())
s := &server{
tracer: opts.Tracer,
log: logger,