MCPcopy Index your code
hub / github.com/coder/coder / WithDelegatedAPIKeyID

Function WithDelegatedAPIKeyID

coderd/aibridge/factory.go:42–44  ·  view source on GitHub ↗

WithDelegatedAPIKeyID returns a copy of ctx carrying an API key ID on whose behalf the request is being made. The in-process aibridge transport requires this on every RoundTrip and rejects calls whose context lacks it. The caller is responsible for having established that the user owning this key a

(ctx context.Context, id string)

Source from the content-addressed store, hash-verified

40// has not expired, and belongs to a non-deleted, non-system user. It does not
41// verify the key secret, because the caller never has it.
42func WithDelegatedAPIKeyID(ctx context.Context, id string) context.Context {
43 return context.WithValue(ctx, delegatedAPIKeyIDCtxKey{}, id)
44}
45
46// DelegatedAPIKeyIDFromContext returns the API key ID attached by
47// [WithDelegatedAPIKeyID] and whether a non-empty value was set.

Calls

no outgoing calls