mirror of
https://github.com/kopia/kopia.git
synced 2026-02-18 15:05:46 -05:00
chore(cli): cleanup user profile errors (#3889)
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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...)
|
||||
|
||||
Reference in New Issue
Block a user