Documentation
¶
Index ¶
- func Bearer(ctx context.Context) string
- func CanonicalUserID(ctx context.Context) string
- func EffectiveUserID(ctx context.Context) string
- func IDToken(ctx context.Context) string
- func MCPAuthToken(ctx context.Context, useIDToken bool) string
- func Provider(ctx context.Context) string
- func TokensFromContext(ctx context.Context) *scyauth.Token
- func WithBearer(ctx context.Context, token string) context.Context
- func WithCanonicalUserID(ctx context.Context, id string) context.Context
- func WithIDToken(ctx context.Context, token string) context.Context
- func WithProvider(ctx context.Context, provider string) context.Context
- func WithTokens(ctx context.Context, t *scyauth.Token) context.Context
- func WithUserInfo(ctx context.Context, info *UserInfo) context.Context
- func WithoutTokens(ctx context.Context) context.Context
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanonicalUserID ¶
CanonicalUserID returns the canonical Agently users.id from context, or an empty string when no canonical owner has been resolved. Callers persisting delegated (per-provider) credentials must fail closed on empty results and must never fall back to EffectiveUserID.
func EffectiveUserID ¶
EffectiveUserID returns a stable user identifier from context (subject or email). Returns empty string when no identity is present.
func MCPAuthToken ¶
MCPAuthToken selects a single token string suitable for outbound MCP calls. When useIDToken is true, it prefers a live IDToken and falls back to the access token or legacy bearer when the ID token has expired. When false, it prefers AccessToken and falls back to the legacy bearer key.
func TokensFromContext ¶
TokensFromContext returns the token bundle from context, if present.
func WithBearer ¶
WithBearer stores a raw bearer token in context.
func WithCanonicalUserID ¶
WithCanonicalUserID stores the canonical Agently users.id resolved for the verified workspace identity. It is a persistence identity only: it never replaces EffectiveUserID, which stays on the workspace provider subject/email for the entire request lifetime.
func WithIDToken ¶
WithIDToken stores a raw ID token in context.
func WithProvider ¶
WithProvider stores an auth provider name in context.
func WithTokens ¶
WithTokens stores a token bundle in context.
func WithUserInfo ¶
WithUserInfo stores identity data in context.