|
|
|
|
@ -134,7 +134,7 @@ func (b *Server) CreateInitialAuthMethod(ctx context.Context) (*password.AuthMet
|
|
|
|
|
}
|
|
|
|
|
loginName = strings.ToLower(b.DevLoginName)
|
|
|
|
|
}
|
|
|
|
|
if b.DevPassword == "" {
|
|
|
|
|
if loginPassword == "" {
|
|
|
|
|
b.DevPassword, err = base62.Random(20)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, fmt.Errorf("unable to generate password: %w", err)
|
|
|
|
|
@ -166,10 +166,11 @@ func (b *Server) CreateInitialAuthMethod(ctx context.Context) (*password.AuthMet
|
|
|
|
|
|
|
|
|
|
// Create a new user and associate it with the account
|
|
|
|
|
if userId == "" {
|
|
|
|
|
userId, err = db.NewPublicId(iam.UserPrefix)
|
|
|
|
|
b.DevUserId, err = db.NewPublicId(iam.UserPrefix)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, fmt.Errorf("error generating initial user id: %w", err)
|
|
|
|
|
}
|
|
|
|
|
userId = b.DevUserId
|
|
|
|
|
}
|
|
|
|
|
opts := []iam.Option{
|
|
|
|
|
iam.WithPublicId(userId),
|
|
|
|
|
@ -245,9 +246,7 @@ func (b *Server) CreateInitialScopes(ctx context.Context) (*iam.Scope, *iam.Scop
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, nil, fmt.Errorf("error creating kms cache: %w", err)
|
|
|
|
|
}
|
|
|
|
|
if err := kmsCache.AddExternalWrappers(
|
|
|
|
|
kms.WithRootWrapper(b.RootKms),
|
|
|
|
|
); err != nil {
|
|
|
|
|
if err := kmsCache.AddExternalWrappers(kms.WithRootWrapper(b.RootKms)); err != nil {
|
|
|
|
|
return nil, nil, fmt.Errorf("error adding config keys to kms: %w", err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|