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

Function DelegatedAPIKeyIDFromContext

coderd/aibridge/factory.go:48–51  ·  view source on GitHub ↗

DelegatedAPIKeyIDFromContext returns the API key ID attached by [WithDelegatedAPIKeyID] and whether a non-empty value was set.

(ctx context.Context)

Source from the content-addressed store, hash-verified

46// DelegatedAPIKeyIDFromContext returns the API key ID attached by
47// [WithDelegatedAPIKeyID] and whether a non-empty value was set.
48func DelegatedAPIKeyIDFromContext(ctx context.Context) (string, bool) {
49 id, ok := ctx.Value(delegatedAPIKeyIDCtxKey{}).(string)
50 return id, ok && id != ""
51}
52
53// TransportFactory returns an [http.RoundTripper] that dispatches an aibridge
54// request in-process for a given provider instance name.

Calls 1

ValueMethod · 0.45