File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -8,22 +8,22 @@ import (
88)
99
1010type TOKEN_CONFIG_ struct {
11- TOKEN string `koanf:"token "`
11+ TOKENS [] string `koanf:"tokens "`
1212 OVERRIDES * SETTING_ `koanf:"overrides"`
1313}
1414
1515func LoadTokens () {
1616 log .Debug ("Loading Configs " , ENV .TOKENS_DIR )
1717
18- LoadDir ("tokens " , ENV .TOKENS_DIR , tokensLayer , yaml .Parser ())
18+ LoadDir ("tokenConfigs " , ENV .TOKENS_DIR , tokensLayer , yaml .Parser ())
1919}
2020
2121func InitTokens () {
2222 apiTokens := config .Strings ("api.tokens" )
2323
2424 var tokenConfigs []TOKEN_CONFIG_
2525
26- tokensLayer .Unmarshal ("tokens " , & tokenConfigs )
26+ tokensLayer .Unmarshal ("tokenConfigs " , & tokenConfigs )
2727
2828 overrides := ParseTokenConfigs (tokenConfigs )
2929
@@ -56,7 +56,9 @@ func ParseTokenConfigs(configs []TOKEN_CONFIG_) (map[string]*SETTING_) {
5656 settings := map [string ]* SETTING_ {}
5757
5858 for _ , config := range configs {
59- settings [config .TOKEN ] = config .OVERRIDES
59+ for _ , token := range config .TOKENS {
60+ settings [token ] = config .OVERRIDES
61+ }
6062 }
6163
6264 return settings
You can’t perform that action at this time.
0 commit comments