mirror of
https://github.com/DeBrosOfficial/network.git
synced 2026-01-30 08:23:02 +00:00
22 lines
639 B
Go
22 lines
639 B
Go
package gateway
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/DeBrosOfficial/network/pkg/client"
|
|
"github.com/DeBrosOfficial/network/pkg/gateway/ctxkeys"
|
|
)
|
|
|
|
// Context keys for request-scoped values
|
|
const (
|
|
ctxKeyAPIKey = ctxkeys.APIKey
|
|
ctxKeyJWT = ctxkeys.JWT
|
|
CtxKeyNamespaceOverride = ctxkeys.NamespaceOverride
|
|
)
|
|
|
|
// withInternalAuth creates a context for internal gateway operations that bypass authentication.
|
|
// This is used when the gateway needs to make internal calls to services without auth checks.
|
|
func (g *Gateway) withInternalAuth(ctx context.Context) context.Context {
|
|
return client.WithInternalAuth(ctx)
|
|
}
|