mirror of
https://github.com/pgsty/minio.git
synced 2026-07-23 14:10:25 +03:00
Order all keys in config (#8541)
New changes - return default values when sub-sys is not configured. - state is hidden parameter now - remove worm mode to be saved in config
This commit is contained in:
@@ -41,10 +41,18 @@ const (
|
||||
// DefaultKVS - default config for OPA config
|
||||
var (
|
||||
DefaultKVS = config.KVS{
|
||||
config.State: config.StateOff,
|
||||
config.Comment: "This is a default OPA configuration",
|
||||
URL: "",
|
||||
AuthToken: "",
|
||||
config.KV{
|
||||
Key: config.State,
|
||||
Value: config.StateOff,
|
||||
},
|
||||
config.KV{
|
||||
Key: URL,
|
||||
Value: "",
|
||||
},
|
||||
config.KV{
|
||||
Key: AuthToken,
|
||||
Value: "",
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -21,11 +21,6 @@ import "github.com/minio/minio/cmd/config"
|
||||
// Help template for OPA policy feature.
|
||||
var (
|
||||
Help = config.HelpKVS{
|
||||
config.HelpKV{
|
||||
Key: config.State,
|
||||
Description: "Indicates if OPA policy is enabled or not",
|
||||
Type: "on|off",
|
||||
},
|
||||
config.HelpKV{
|
||||
Key: URL,
|
||||
Description: `Points to URL for OPA HTTP API endpoint. eg: "http://localhost:8181/v1/data/httpapi/authz/allow"`,
|
||||
|
||||
@@ -33,8 +33,17 @@ func SetPolicyOPAConfig(s config.Config, opaArgs Args) {
|
||||
return
|
||||
}
|
||||
s[config.PolicyOPASubSys][config.Default] = config.KVS{
|
||||
config.State: config.StateOn,
|
||||
URL: opaArgs.URL.String(),
|
||||
AuthToken: opaArgs.AuthToken,
|
||||
config.KV{
|
||||
Key: config.State,
|
||||
Value: config.StateOn,
|
||||
},
|
||||
config.KV{
|
||||
Key: URL,
|
||||
Value: opaArgs.URL.String(),
|
||||
},
|
||||
config.KV{
|
||||
Key: AuthToken,
|
||||
Value: opaArgs.AuthToken,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user