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

Function isSupported

pkg/util/users/tenant.go:112–132  ·  view source on GitHub ↗

this checks if a rune is supported in tenant IDs (according to https://cortexmetrics.io/docs/guides/limitations/#tenant-id-naming)

(c rune)

Source from the content-addressed store, hash-verified

110// this checks if a rune is supported in tenant IDs (according to
111// https://cortexmetrics.io/docs/guides/limitations/#tenant-id-naming)
112func isSupported(c rune) bool {
113 // characters
114 if ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') {
115 return true
116 }
117
118 // digits
119 if '0' <= c && c <= '9' {
120 return true
121 }
122
123 // special
124 return c == '!' ||
125 c == '-' ||
126 c == '_' ||
127 c == '.' ||
128 c == '*' ||
129 c == '\'' ||
130 c == '(' ||
131 c == ')'
132}
133
134// TenantIDsFromOrgID extracts different tenants from an orgID string value
135//

Callers 1

ValidTenantIDFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected