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)
| 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. |
| 42 | func 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. |
no outgoing calls