MCPcopy Index your code
hub / github.com/cortexproject/cortex / ExtractTenantIDFromHTTPRequest

Function ExtractTenantIDFromHTTPRequest

pkg/util/users/resolver.go:142–155  ·  view source on GitHub ↗

ExtractTenantIDFromHTTPRequest extracts a single TenantID through a given resolver directly from a HTTP request.

(req *http.Request)

Source from the content-addressed store, hash-verified

140// ExtractTenantIDFromHTTPRequest extracts a single TenantID through a given
141// resolver directly from a HTTP request.
142func ExtractTenantIDFromHTTPRequest(req *http.Request) (string, context.Context, error) {
143 //lint:ignore faillint wrapper around upstream method
144 _, ctx, err := user.ExtractOrgIDFromHTTPRequest(req)
145 if err != nil {
146 return "", nil, err
147 }
148
149 tenantID, err := defaultResolver.TenantID(ctx)
150 if err != nil {
151 return "", nil, err
152 }
153
154 return tenantID, ctx, nil
155}

Callers 8

getConfigMethod · 0.92
setConfigMethod · 0.92
deactivateConfigMethod · 0.92
restoreConfigMethod · 0.92
GetOverridesMethod · 0.92
SetOverridesMethod · 0.92
DeleteOverridesMethod · 0.92

Calls 1

TenantIDMethod · 0.65

Tested by 1