Introduce new config subnet api_key (#13793)

The earlier approach of using a license token for 
communicating with SUBNET is being replaced 
with a simpler mechanism of API keys. Unlike the 
license which is a JWT token, these API keys will 
be simple UUID tokens and don't have any embedded 
information in them. SUBNET would generate the 
API key on cluster registration, and then it would 
be saved in this config, to be used for subsequent 
communication with SUBNET.
This commit is contained in:
Shireesh Anjal
2021-12-03 23:02:11 +05:30
committed by GitHub
parent 7460fb8349
commit d29df6714a
5 changed files with 29 additions and 21 deletions

View File

@@ -193,6 +193,9 @@ func minioConfigToConsoleFeatures() {
if globalSubnetConfig.License != "" {
os.Setenv("CONSOLE_SUBNET_LICENSE", globalSubnetConfig.License)
}
if globalSubnetConfig.APIKey != "" {
os.Setenv("CONSOLE_SUBNET_API_KEY", globalSubnetConfig.APIKey)
}
}
func initConsoleServer() (*restapi.Server, error) {

View File

@@ -191,7 +191,7 @@ func initHelp() {
config.HelpKV{
Key: config.SubnetSubSys,
Type: "string",
Description: "set subnet config for the cluster e.g. license token",
Description: "set subnet config for the cluster e.g. api key",
Optional: true,
},
}
@@ -233,7 +233,7 @@ func initHelp() {
config.NotifyRedisSubSys: notify.HelpRedis,
config.NotifyWebhookSubSys: notify.HelpWebhook,
config.NotifyESSubSys: notify.HelpES,
config.SubnetSubSys: subnet.HelpLicense,
config.SubnetSubSys: subnet.HelpSubnet,
}
config.RegisterHelpSubSys(helpMap)