Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Stromweld committed Mar 3, 2024
1 parent 781ae79 commit 1f723dc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion resources/iam_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
name = new_resource.name
user_hash = new_resource.user_hash
user_json = user_hash.to_json
api_token = new_resource.api_token
# Try to fetch user from server
srv_user = get_iam_user(user_hash['id'], api_token)
# Test if user on server exists and any errors contacting server
Expand Down Expand Up @@ -70,6 +71,7 @@
name = new_resource.name
user_hash = new_resource.user_hash
user_json = user_hash.to_json
api_token = new_resource.api_token
# Try to fetch user from server
srv_user = get_iam_user(user_hash['id'], api_token)
# Test user from server and desired user match key by key from desired policy
Expand All @@ -80,7 +82,7 @@
user_hash['id'].eql?(srv_user['user']['id']) && user_hash['name'].eql?(srv_user['user']['name'])
end
http_request "update iam user #{name}" do
headers({ 'api-token' =>api_token, 'Content-Type' => 'application/json' })
headers({ 'api-token' => api_token, 'Content-Type' => 'application/json' })
message user_json
url "https://localhost/apis/iam/v2/users/#{user_hash['id']}"
action :put
Expand Down

0 comments on commit 1f723dc

Please sign in to comment.