IDToken: fix namespace format (#95341)
* Bump authlib version * Remove temporary formatter and start signing tokens with `stacks-` prefix * update workspace
This commit is contained in:
@@ -22,22 +22,8 @@ func GetNamespaceMapper(cfg *setting.Cfg) NamespaceMapper {
|
||||
if err != nil {
|
||||
stackId = 0
|
||||
}
|
||||
// Temporarily force this as plural
|
||||
cloudNamespace := fmt.Sprintf("stacks-%d", stackId)
|
||||
// cloudNamespace := claims.CloudNamespaceFormatter(stackIdInt)
|
||||
return func(_ int64) string { return cloudNamespace }
|
||||
}
|
||||
return claims.OrgNamespaceFormatter
|
||||
}
|
||||
|
||||
// Temporary version that is only passed to th
|
||||
func GetTemporarySingularNamespaceMapper(cfg *setting.Cfg) NamespaceMapper {
|
||||
if cfg != nil && cfg.StackID != "" {
|
||||
stackIdInt, err := strconv.ParseInt(cfg.StackID, 10, 64)
|
||||
if err != nil {
|
||||
stackIdInt = 0
|
||||
}
|
||||
cloudNamespace := claims.CloudNamespaceFormatter(stackIdInt)
|
||||
cloudNamespace := claims.CloudNamespaceFormatter(stackId)
|
||||
return func(_ int64) string { return cloudNamespace }
|
||||
}
|
||||
return claims.OrgNamespaceFormatter
|
||||
|
||||
@@ -39,7 +39,7 @@ func ProvideService(
|
||||
cfg: cfg, logger: log.New("id-service"),
|
||||
signer: signer, cache: cache,
|
||||
metrics: newMetrics(reg),
|
||||
nsMapper: request.GetTemporarySingularNamespaceMapper(cfg), // TODO replace with the plural one
|
||||
nsMapper: request.GetNamespaceMapper(cfg),
|
||||
}
|
||||
|
||||
authnService.RegisterPostAuthHook(s.hook, 140)
|
||||
|
||||
Reference in New Issue
Block a user