mirror of
https://github.com/paralus/paralus.git
synced 2026-08-24 15:47:19 +00:00
generate password feature for kratos admin creation
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
"github.com/paralus/paralus/pkg/common"
|
||||
"github.com/paralus/paralus/pkg/enforcer"
|
||||
"github.com/paralus/paralus/pkg/service"
|
||||
"github.com/paralus/paralus/pkg/utils"
|
||||
commonv3 "github.com/paralus/paralus/proto/types/commonpb/v3"
|
||||
rolev3 "github.com/paralus/paralus/proto/types/rolepb/v3"
|
||||
systemv3 "github.com/paralus/paralus/proto/types/systempb/v3"
|
||||
@@ -299,11 +300,12 @@ func main() {
|
||||
retry:
|
||||
numOfRetries := 0
|
||||
// should we directly interact with kratos and create a user with a password?
|
||||
orgA, err := us.Create(context.Background(), &userv3.User{
|
||||
_, err = us.Create(context.Background(), &userv3.User{
|
||||
Metadata: &commonv3.Metadata{Name: *oae, Partner: *partner, Organization: *org},
|
||||
Spec: &userv3.UserSpec{
|
||||
FirstName: *oafn,
|
||||
LastName: *oaln,
|
||||
Password: utils.GetRandomPassword(8),
|
||||
Groups: []string{admingrp.Metadata.Name, localUsersGrp.Metadata.Name},
|
||||
ProjectNamespaceRoles: []*userv3.ProjectNamespaceRole{{Role: "ADMIN", Group: &admingrp.Metadata.Name}}},
|
||||
})
|
||||
@@ -318,6 +320,4 @@ retry:
|
||||
time.Sleep(10 * time.Second)
|
||||
goto retry
|
||||
}
|
||||
|
||||
fmt.Println("Org Admin signup URL: ", *orgA.Spec.RecoveryUrl)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user