Get rid of hardcoded admin user uuid
The UUID is generated by `ocs init` now and stored in the config file. To avoid that every ocis install uses the same UUID Closes: #3524
This commit is contained in:
committed by
Ralf Haferkamp
parent
c312ecf926
commit
7ef205d232
@@ -100,6 +100,7 @@ type OcisConfig struct {
|
||||
MachineAuthApiKey string `yaml:"machine_auth_api_key"`
|
||||
TransferSecret string `yaml:"transfer_secret"`
|
||||
SystemUserID string `yaml:"system_user_id"`
|
||||
AdminUserID string `yaml:"admin_user_id"`
|
||||
Graph GraphExtension
|
||||
Idp LdapBasedExtension
|
||||
Idm IdmExtension
|
||||
@@ -162,6 +163,7 @@ func CreateConfig(insecure, forceOverwrite bool, configPath, adminPassword strin
|
||||
}
|
||||
|
||||
systemUserID := uuid.Must(uuid.NewV4()).String()
|
||||
adminUserID := uuid.Must(uuid.NewV4()).String()
|
||||
|
||||
idmServicePassword, err := generators.GenerateRandomPassword(passwordLength)
|
||||
if err != nil {
|
||||
@@ -203,6 +205,7 @@ func CreateConfig(insecure, forceOverwrite bool, configPath, adminPassword strin
|
||||
MachineAuthApiKey: machineAuthApiKey,
|
||||
TransferSecret: revaTransferSecret,
|
||||
SystemUserID: systemUserID,
|
||||
AdminUserID: adminUserID,
|
||||
Idm: IdmExtension{
|
||||
ServiceUserPasswords: ServiceUserPasswordsSettings{
|
||||
AdminPassword: ocisAdminServicePassword,
|
||||
|
||||
Reference in New Issue
Block a user