IsDelegated (authctx/principal.go)

authorizer · internal/authctx/principal.go · go · Apache-2.0
auth

Package authctx carries authentication principal details on context.Context.

// Source: https://github.com/authorizerdev/authorizer | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
// Package authctx carries authentication principal details on context.Context.
package authctx

import (
	"context"
	"strings"
)

type principalContextKey struct{}

// Principal is the authenticated caller identity resolved by transport auth.
type Principal struct {
	UserID       string
	LoginMethod  string
	Nonce        string
	IsSuperAdmin bool
	// ActorID is the immediate actor of an RFC 8693 delegated token — the
	// agent's client_id from `act.sub`. Empty for first-party callers.
	//
	// UserID stays the delegating user: the request IS being made for them.
	// ActorID recor

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key