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:
co-authored by
gamab
Karl Persson
parent
eb2d276a42
commit
437b7a565d
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user