Skip to content

Commit

Permalink
Fix loading current value for nexus user passwords
Browse files Browse the repository at this point in the history
There's two issues solved by this commit:

- The API calls to check if the new password works always failed;
- The new password was given as the old password value when the
  call failed, making it impossible to update the password.
  • Loading branch information
jlundqvist-criteo committed Jun 24, 2024
1 parent fa0e687 commit 747d54e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion resources/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# Check if we need to change the password.
if self.class.properties[:password].is_set?(desired)
begin
::Nexus3::Api.new(api_client.endpoint, username, desired.password).request(:get, '/service/rapture/session')
::Nexus3::Api.new(api_client.endpoint, username, desired.password).request(:get, 'status')
password desired.password
rescue ::Nexus3::ApiError
password 'Supercalifragilisticexpialidocious-that-does-not-exist-so-maybe-the-resource-will-need-to-converge'
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/resources/user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
user_response('user_with_role'),
user_response('user_with_role'))

stub_request(:get, 'http://localhost:8081/service/rapture/session')
stub_request(:get, 'http://localhost:8081/service/rest/v1/status')
.to_return(api_response(200))
end

Expand Down

0 comments on commit 747d54e

Please sign in to comment.