Add password to User schema

Make sure password is encrypted
Update tests

Signed-off-by: Andrea Waltlova <awaltlov@redhat.com>
This commit is contained in:
Andrea Waltlova 2024-07-18 16:45:29 +02:00 committed by Ondřej Ezr
parent 5d0e3ee85b
commit 7c830e90b0
4 changed files with 223 additions and 184 deletions

View file

@ -530,9 +530,10 @@ func (request *ComposeRequest) GetBlueprintFromCustomizations() (blueprint.Bluep
}
userCustomizations = append(userCustomizations,
blueprint.UserCustomization{
Name: user.Name,
Key: user.Key,
Groups: groups,
Name: user.Name,
Key: user.Key,
Password: user.Password,
Groups: groups,
},
)
}
@ -898,6 +899,10 @@ func (request *ComposeRequest) GetBlueprintFromCustomizations() (blueprint.Bluep
bp.Customizations = nil
}
err = bp.CryptPasswords()
if err != nil {
return bp, fmt.Errorf("Error hashing passwords: %s", err.Error())
}
return bp, nil
}