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

Function CheckTenantIDIsSupported

pkg/util/users/tenant.go:88–104  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

86}
87
88func CheckTenantIDIsSupported(s string) error {
89 // check tenantID is "__markers__"
90 if s == GlobalMarkersDir {
91 return errTenantIDMarkers
92 }
93
94 if s == "user-index.json.gz" {
95 return errTenantIDUserIndex
96 }
97
98 // check tenantID is "." or ".."
99 if containsUnsafePathSegments(s) {
100 return errTenantIDUnsafe
101 }
102
103 return nil
104}
105
106func JoinTenantIDs(tenantIDs []string) string {
107 return strings.Join(tenantIDs, tenantIDsLabelSeparator)

Callers 2

TenantIDMethod · 0.92
ValidTenantIDFunction · 0.85

Calls 1

Tested by

no test coverage detected