Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AnVIL audit when service account is not directly a group admin #365

Merged
merged 3 commits into from
Jun 9, 2023

Conversation

amstilp
Copy link
Contributor

@amstilp amstilp commented Jun 9, 2023

Fix the AnVIL membership audit for a ManagedGroup when the service account running the app is not directly an admin of the group (for example, when another group is an admin and the service account is a member of the other group).

Closes #362

This bug occurs when the app is not directly listed as an admin, but
is an admin of a group via being in another group (which is an admin
of the first group).
Add a try/except statement that removes the service account from
the list of ManagedGroup admins returned by AnVIL. This fixes the
bug where the managed group audit fails when the service account is
not directly an admin of the group.
@codecov
Copy link

codecov bot commented Jun 9, 2023

Codecov Report

Merging #365 (0adcee7) into main (93ad7d4) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 0adcee7 differs from pull request most recent head 46cb7fe. Consider uploading reports for the commit 46cb7fe to get more accurate results

@@           Coverage Diff           @@
##             main     #365   +/-   ##
=======================================
  Coverage   99.81%   99.81%           
=======================================
  Files         117      117           
  Lines       20614    20630   +16     
=======================================
+ Hits        20575    20591   +16     
  Misses         39       39           
Impacted Files Coverage Δ
anvil_consortium_manager/models.py 100.00% <100.00%> (ø)
...ortium_manager/tests/test_models_anvil_api_unit.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@amstilp amstilp merged commit d940c8e into main Jun 9, 2023
@amstilp amstilp deleted the bugfix/issue-362 branch October 25, 2023 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ManagedGroup.anvil_audit_membership fails when the app service account is not a direct admin of a group
1 participant