MCPcopy Create free account
hub / github.com/cortexproject/cortex / isDistributorWorkerOrgID

Function isDistributorWorkerOrgID

pkg/ingester/ingester.go:1750–1752  ·  view source on GitHub ↗

isDistributorWorkerOrgID reports whether orgID matches the synthetic worker-name pattern that the distributor injects as X-Scope-OrgID when opening a long-lived PushStream: "ingester- -stream-push-worker- " When this pattern is detected, PushStream bypasses the orgID == req.TenantID check

(orgID string)

Source from the content-addressed store, hash-verified

1748// pattern can spoof it and write to any tenant. The stream-level gRPC interceptor
1749// enabled via -distributor.sign-write-requests-keys provides cryptographic proof.
1750func isDistributorWorkerOrgID(orgID string) bool {
1751 return distributorWorkerOrgIDRe.MatchString(orgID)
1752}
1753
1754func (u *userTSDB) acquireReadLock() error {
1755 u.stateMtx.RLock()

Callers 1

PushStreamMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected