mirror of
https://github.com/paralus/paralus.git
synced 2026-08-24 15:47:19 +00:00
Stdout default admin password in initialize script
Signed-off-by: Akshay Gaikwad <akgaikwad001@gmail.com>
This commit is contained in:
@@ -40,6 +40,7 @@ func NewKratosAuthProvider(kc *kclient.APIClient) AuthProvider {
|
||||
|
||||
func (k *kratosAuthProvider) Create(ctx context.Context, password string, traits map[string]interface{}, forceReset bool) (string, error) {
|
||||
cib := kclient.NewAdminCreateIdentityBody("default", traits)
|
||||
cib.Credentials = kclient.NewAdminIdentityImportCredentials()
|
||||
cib.Credentials.SetPassword(kclient.AdminCreateIdentityImportCredentialsPassword{
|
||||
Config: &kclient.AdminCreateIdentityImportCredentialsPasswordConfig{
|
||||
Password: kclient.PtrString(password),
|
||||
|
||||
@@ -297,6 +297,7 @@ func main() {
|
||||
},
|
||||
})
|
||||
|
||||
p := utils.GetRandomPassword(8)
|
||||
retry:
|
||||
numOfRetries := 0
|
||||
// should we directly interact with kratos and create a user with a password?
|
||||
@@ -305,7 +306,7 @@ retry:
|
||||
Spec: &userv3.UserSpec{
|
||||
FirstName: *oafn,
|
||||
LastName: *oaln,
|
||||
Password: utils.GetRandomPassword(8),
|
||||
Password: p,
|
||||
Groups: []string{admingrp.Metadata.Name, localUsersGrp.Metadata.Name},
|
||||
ProjectNamespaceRoles: []*userv3.ProjectNamespaceRole{
|
||||
{Role: "ADMIN", Group: &admingrp.Metadata.Name},
|
||||
@@ -324,4 +325,5 @@ retry:
|
||||
time.Sleep(10 * time.Second)
|
||||
goto retry
|
||||
}
|
||||
fmt.Printf("Org Admin default password: %s\n", p)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user