MCPcopy
hub / github.com/autobrr/qui / GetClientAPIKeyFromContext

Function GetClientAPIKeyFromContext

internal/proxy/middleware.go:168–173  ·  view source on GitHub ↗

GetClientAPIKeyFromContext retrieves the client API key from the request context

(ctx context.Context)

Source from the content-addressed store, hash-verified

166
167// GetClientAPIKeyFromContext retrieves the client API key from the request context
168func GetClientAPIKeyFromContext(ctx context.Context) *models.ClientAPIKey {
169 if key, ok := ctx.Value(ClientAPIKeyContextKey).(*models.ClientAPIKey); ok {
170 return key
171 }
172 return nil
173}
174
175// GetInstanceIDFromContext retrieves the instance ID from the request context
176func GetInstanceIDFromContext(ctx context.Context) int {

Callers 15

rewriteRequestMethod · 0.85
errorHandlerMethod · 0.85
handleSyncMainDataMethod · 0.85
prepareProxyContextMethod · 0.85
validateQueryParamsMethod · 0.85
handleTorrentsInfoMethod · 0.85
handleTorrentSearchMethod · 0.85
handleCategoriesMethod · 0.85
handleTagsMethod · 0.85
handleTorrentTrackersMethod · 0.85
handleTorrentPeersMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected