Skip to content

Commit

Permalink
redundant advisory lock (already locking in private method)
Browse files Browse the repository at this point in the history
  • Loading branch information
suprjinx committed Nov 27, 2024
1 parent d25b651 commit 31d011d
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions app/lib/clients/vault/policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,14 @@ def rotate_token
def assign_entity_policy(identity, policy_name)
sub = identity.sub
email = identity.email
Domain.with_advisory_lock(sub) do
put_entity(sub, [ policy_name ])
put_entity_alias(sub, email, "oidc")
end
put_entity(sub, [ policy_name ])
put_entity_alias(sub, email, "oidc")
end

def assign_groups_policy(groups, policy_name)
groups.each do |group|
Domain.with_advisory_lock(group) do
put_group(group, [ policy_name ])
put_group_alias(group, group, "oidc")
end
put_group(group, [ policy_name ])
put_group_alias(group, group, "oidc")
end
end

Expand Down

0 comments on commit 31d011d

Please sign in to comment.