chore(cli): cleanup user profile errors (#3889)

This commit is contained in:
Julio López
2024-05-29 18:02:14 -07:00
committed by GitHub
parent ddbd8ede95
commit 7fd6e5912f
2 changed files with 2 additions and 1 deletions

View File

@@ -77,6 +77,7 @@ func ListUserProfiles(ctx context.Context, rep repo.Repository) ([]*Profile, err
}
// GetUserProfile returns the user profile with a given username.
// Returns ErrUserNotFound when the user does not exist.
func GetUserProfile(ctx context.Context, r repo.Repository, username string) (*Profile, error) {
manifests, err := r.FindManifests(ctx, map[string]string{
manifest.TypeLabelKey: ManifestType,

View File

@@ -32,7 +32,7 @@ func (p *Profile) setPassword(password string) error {
func computePasswordHash(password string, salt []byte, keyDerivationAlgorithm string) ([]byte, error) {
key, err := crypto.DeriveKeyFromPassword(password, salt, passwordHashLength, keyDerivationAlgorithm)
if err != nil {
return nil, errors.Wrap(err, "error deriving key from password")
return nil, errors.Wrap(err, "error hashing password")
}
payload := append(append([]byte(nil), salt...), key...)