K8s: Add org ID and role authorizers (#75701)

This commit is contained in:
Todd Treece
2023-09-28 18:28:58 -04:00
committed by GitHub
parent 0af7247612
commit c31ddce0b6
8 changed files with 161 additions and 7 deletions

View File

@@ -9,6 +9,10 @@ import (
func OrgIDFrom(ctx context.Context) (int64, bool) {
ns := request.NamespaceValue(ctx)
return ParseOrgID(ns)
}
func ParseOrgID(ns string) (int64, bool) {
if len(ns) < 5 || ns[:4] != "org-" {
return 0, false
}