unmarshal token to filter spaces for current user (#6596)

* unmarshal token to filter spaces for current user

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* Fix tests

---------

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Co-authored-by: André Duffeck <andre.duffeck@firondu.de>
This commit is contained in:
Jörn Friedrich Dreyer
2023-06-22 16:15:17 +02:00
committed by GitHub
co-authored by André Duffeck
parent abf94f1ccb
commit 2ea3b8c400
10 changed files with 79 additions and 20 deletions
@@ -83,6 +83,14 @@ func EnsureDefaults(cfg *config.Config) {
cfg.Tracing = &config.Tracing{}
}
if cfg.TokenManager == nil && cfg.Commons != nil && cfg.Commons.TokenManager != nil {
cfg.TokenManager = &config.TokenManager{
JWTSecret: cfg.Commons.TokenManager.JWTSecret,
}
} else if cfg.TokenManager == nil {
cfg.TokenManager = &config.TokenManager{}
}
if cfg.MachineAuthAPIKey == "" && cfg.Commons != nil && cfg.Commons.MachineAuthAPIKey != "" {
cfg.MachineAuthAPIKey = cfg.Commons.MachineAuthAPIKey
}