From bec439d6b184cfa40a7aa47fec8abdd3add6153a Mon Sep 17 00:00:00 2001 From: Jack Baldry Date: Thu, 10 Feb 2022 12:01:48 +0000 Subject: [PATCH 1/3] Revise "About tenant IDs" Signed-off-by: Jack Baldry --- docs/sources/about-tenant-ids.md | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/docs/sources/about-tenant-ids.md b/docs/sources/about-tenant-ids.md index 58477646529..0d625c4c032 100644 --- a/docs/sources/about-tenant-ids.md +++ b/docs/sources/about-tenant-ids.md @@ -1,19 +1,17 @@ --- title: "About tenant IDs" description: "" -weight: 100 +weight: 10 --- # About tenant IDs -The tenant ID (also called "user ID" or "org ID") is the unique identifier of a tenant within a Grafana Mimir cluster. The tenant ID is an opaque information to Grafana Mimir, which doesn't make any assumption on its format/content, but its naming has two limitations: +The tenant ID is the unique identifier of a tenant within a Grafana Mimir cluster. +For information about how Grafana Mimir components use tenant IDs, refer to [About authentication and authorization]({{}}). -1. Supported characters -2. Length +## Restrictions -## Supported characters - -The following character sets are generally **safe for use in the tenant ID**: +Tenant IDs must be less than 150 bytes/characters in length and must comprise only supported characters: - Alphanumeric characters - `0-9` @@ -23,14 +21,12 @@ The following character sets are generally **safe for use in the tenant ID**: - Exclamation point (`!`) - Hyphen (`-`) - Underscore (`_`) - - Single Period (`.`), but the tenant IDs `.` and `..` are considered invalid + - Single Period (`.`) - Asterisk (`*`) - Single quote (`'`) - Open parenthesis (`(`) - Close parenthesis (`)`) -All other characters are not safe to use. In particular, slashes `/` and whitespaces (` `) are **not supported**. - -## Length +> **Note:** For security reasons, `.` and `..` aren't valid tenant IDs. -The tenant ID length should not exceed 150 bytes/characters. +All other characters, including slashes and whitespace, aren't supported. From e239d1da05e2737be391eb5e15499c25b7e2b299 Mon Sep 17 00:00:00 2001 From: Jack Baldry Date: Sat, 12 Feb 2022 08:06:25 +0000 Subject: [PATCH 2/3] Correct the supported length of tenant IDs Signed-off-by: Jack Baldry Co-authored-by: replay --- docs/sources/about-tenant-ids.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/about-tenant-ids.md b/docs/sources/about-tenant-ids.md index 0d625c4c032..6007897e5a9 100644 --- a/docs/sources/about-tenant-ids.md +++ b/docs/sources/about-tenant-ids.md @@ -11,7 +11,7 @@ For information about how Grafana Mimir components use tenant IDs, refer to [Abo ## Restrictions -Tenant IDs must be less than 150 bytes/characters in length and must comprise only supported characters: +Tenant IDs must be less-than or equal-to 150 bytes/characters in length and must comprise only supported characters: - Alphanumeric characters - `0-9` From dbb06b4d32ca8330eb7baca93b34a4353f8846ea Mon Sep 17 00:00:00 2001 From: Jack Baldry Date: Sat, 12 Feb 2022 08:12:24 +0000 Subject: [PATCH 3/3] Fix references to tenant ID limitations Signed-off-by: Jack Baldry --- docs/sources/configuration/about-versioning.md | 2 -- docs/sources/glossary.md | 2 +- pkg/tenant/resolver.go | 2 +- pkg/tenant/tenant.go | 5 +++-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/sources/configuration/about-versioning.md b/docs/sources/configuration/about-versioning.md index 11b1aa56fe4..f4ee5f20a18 100644 --- a/docs/sources/configuration/about-versioning.md +++ b/docs/sources/configuration/about-versioning.md @@ -26,8 +26,6 @@ Grafana Mimir strives to be 100% API compatible with Prometheus (under `/prometh - Additional API around pushing metrics (under `/prometheus/api/push`). - Additional API endpoints for management of Grafana Mimir itself, such as the ring. These APIs are not part of the any compatibility guarantees. -_For more information, please refer to the [limitations](../guides/limitations.md) doc._ - ## Experimental features Grafana Mimir is an actively developed project and we want to encourage the introduction of new features and capabilities. As such, not everything in each release of Grafana Mimir is considered "production-ready". Features not considered "production-ready" and the flags used to enable and/or configure these features will be marked "Experimental". There are no backwards compatibility guarantees on anything marked experimental. Configuration and flags are subject to change. diff --git a/docs/sources/glossary.md b/docs/sources/glossary.md index 0f315378b82..0afd0055748 100644 --- a/docs/sources/glossary.md +++ b/docs/sources/glossary.md @@ -81,7 +81,7 @@ A tenant (also called "user" or "org") is the owner of a set of series written t For more information, please refer to: - [HTTP API authentication](../api/_index.md#authentication) -- [Tenant ID limitations](./limitations.md#tenant-id-naming) +- [About tenant IDs]({{}}) ### Time series diff --git a/pkg/tenant/resolver.go b/pkg/tenant/resolver.go index c7c4e94ba7c..51b27115124 100644 --- a/pkg/tenant/resolver.go +++ b/pkg/tenant/resolver.go @@ -108,7 +108,7 @@ type MultiResolver struct { // NewMultiResolver creates a tenant resolver, which allows request to have // multiple tenant ids submitted separated by a '|' character. This enforces // further limits on the character set allowed within tenants as detailed here: -// https://github.com/grafana/mimir/blob/main/docs/sources/guides/limitations.md) +// https://github.com/grafana/mimir/blob/main/docs/sources/about-tenant-ids.md func NewMultiResolver() *MultiResolver { return &MultiResolver{} } diff --git a/pkg/tenant/tenant.go b/pkg/tenant/tenant.go index abf58e6b43a..b6c2d03d7c6 100644 --- a/pkg/tenant/tenant.go +++ b/pkg/tenant/tenant.go @@ -77,8 +77,9 @@ func JoinTenantIDs(tenantIDs []string) string { return strings.Join(tenantIDs, tenantIDsLabelSeparator) } -// this checks if a rune is supported in tenant IDs (according to -// https://github.com/grafana/mimir/blob/main/docs/sources/guides/limitations.md) +// This checks if a rune is supported in tenant IDs according to the rules +// documented in "About tenant IDs": +// https://github.com/grafana/mimir/blob/main/docs/sources/about-tenant-ids.md func isSupported(c rune) bool { // characters if ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') {