revert all changes to auth-machine
This commit is contained in:
@@ -20,6 +20,7 @@ type Config struct {
|
|||||||
|
|
||||||
SkipUserGroupsInToken bool `yaml:"skip_user_groups_in_token" env:"AUTH_MACHINE_SKIP_USER_GROUPS_IN_TOKEN" desc:"Disables the encoding of the user's group memberships in the reva access token. This reduces the token size, especially when users are members of a large number of groups."`
|
SkipUserGroupsInToken bool `yaml:"skip_user_groups_in_token" env:"AUTH_MACHINE_SKIP_USER_GROUPS_IN_TOKEN" desc:"Disables the encoding of the user's group memberships in the reva access token. This reduces the token size, especially when users are members of a large number of groups."`
|
||||||
|
|
||||||
|
MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY;AUTH_MACHINE_API_KEY" desc:"Machine auth API key used to validate internal requests necessary for the access to resources from other services."`
|
||||||
|
|
||||||
Supervised bool `yaml:"-"`
|
Supervised bool `yaml:"-"`
|
||||||
Context context.Context `yaml:"-"`
|
Context context.Context `yaml:"-"`
|
||||||
|
|||||||
@@ -72,6 +72,10 @@ func EnsureDefaults(cfg *config.Config) {
|
|||||||
cfg.TokenManager = &config.TokenManager{}
|
cfg.TokenManager = &config.TokenManager{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if cfg.MachineAuthAPIKey == "" && cfg.Commons != nil && cfg.Commons.MachineAuthAPIKey != "" {
|
||||||
|
cfg.MachineAuthAPIKey = cfg.Commons.MachineAuthAPIKey
|
||||||
|
}
|
||||||
|
|
||||||
if cfg.GRPC.TLS == nil && cfg.Commons != nil {
|
if cfg.GRPC.TLS == nil && cfg.Commons != nil {
|
||||||
cfg.GRPC.TLS = structs.CopyOrZeroValue(cfg.Commons.GRPCServiceTLS)
|
cfg.GRPC.TLS = structs.CopyOrZeroValue(cfg.Commons.GRPCServiceTLS)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,5 +37,9 @@ func Validate(cfg *config.Config) error {
|
|||||||
if cfg.TokenManager.JWTSecret == "" {
|
if cfg.TokenManager.JWTSecret == "" {
|
||||||
return shared.MissingJWTTokenError(cfg.Service.Name)
|
return shared.MissingJWTTokenError(cfg.Service.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if cfg.MachineAuthAPIKey == "" {
|
||||||
|
return shared.MissingMachineAuthApiKeyError(cfg.Service.Name)
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ func AuthMachineConfigFromStruct(cfg *config.Config) map[string]interface{} {
|
|||||||
"auth_manager": "machine",
|
"auth_manager": "machine",
|
||||||
"auth_managers": map[string]interface{}{
|
"auth_managers": map[string]interface{}{
|
||||||
"machine": map[string]interface{}{
|
"machine": map[string]interface{}{
|
||||||
|
"api_key": cfg.MachineAuthAPIKey,
|
||||||
"gateway_addr": cfg.Reva.Address,
|
"gateway_addr": cfg.Reva.Address,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user