Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Bugzilla/API/V1/UserObject.pm
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,9 @@ sub update {
$change->[0] = join(',', @{$change->[0]}) if ref $change->[0];
$change->[1] = join(',', @{$change->[1]}) if ref $change->[1];

# Never return the password hash, only that it changed.
$change->[1] = '******' if $field eq 'cryptpassword';

$hash{changes}{$field} = {
removed => $self->type('string', $change->[0]),
added => $self->type('string', $change->[1])
Expand Down
5 changes: 5 additions & 0 deletions qa/t/rest_user_update_credentials.t
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ sub update_target {
# Setting the same password still stores a new hash, so it shows as a change.
my $changes = update_target({password => $target_password});
ok(exists $changes->{cryptpassword}, 'password alone is a user field');
is_deeply(
$changes->{cryptpassword},
{removed => '', added => '******'},
'the password hash is not returned'
);

$changes
= update_target({email => $target_login, password => $target_password});
Expand Down
Loading