-
Notifications
You must be signed in to change notification settings - Fork 176
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
[8.0] feat (VOMS2IAM): add options to sync from IAM #7612
Conversation
741d4d5
to
bba8478
Compare
def compare_entry(self, iam_entry, voms_entry, is_robot): | ||
"""Compare a VOMS and IAM entry""" | ||
|
||
if not iam_entry.get("mail") == voms_entry.get("mail"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if not iam_entry.get("mail") == voms_entry.get("mail"): | |
if iam_entry.get("mail") != voms_entry.get("mail"): |
if not iam_entry.get(field) == voms_entry.get(field): | ||
self.log.info(f"{iam_entry['nickname']} - {field} : {iam_entry.get(field)} vs {voms_entry.get(field)}") | ||
|
||
if not sorted(iam_entry["Roles"]) == sorted(voms_entry["Roles"]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if not sorted(iam_entry["Roles"]) == sorted(voms_entry["Roles"]): | |
if sorted(iam_entry["Roles"]) != sorted(voms_entry["Roles"]): |
"""Compare a VOMS and IAM entry""" | ||
|
||
if not iam_entry.get("mail") == voms_entry.get("mail"): | ||
self.log.info(f"{iam_entry['nickname']} - mail : {iam_entry.get('mail')} vs {voms_entry.get('mail')}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe make this logs (message, varmsg)
?
self.log.info("No extra entry entries in IAM, GOOD !") | ||
|
||
# We are waiting for IAM to synchronize also suspended people | ||
# https://github.com/indigo-iam/voms-importer/pull/22 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be in a release?
iam_list_url = f"{self.iam_url}/scim/Users" | ||
iam_users = [] | ||
startIndex = 1 | ||
totalResults = 1000 # total number of users |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
errors = 0 | ||
for user in self.iam_users_raw: | ||
try: | ||
users.update(self.convert_iam_to_voms(user)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So IAM returns a list of dictionaries where each dictionary has one key (the username)?
Might be nice to put some example responses in docstrings to make it easier to follow.
Sweep summary Sweep ran in https://github.com/DIRACGrid/DIRAC/actions/runs/9382608769 Failed:
|
Addresses part of #7416
This does not yet work, because there are still too many bugs in the
voms-importer
https://github.com/indigo-iam/voms-importer/Wht this PR does is to add 2 options to the VOMS2CSAgent`:
CompareWithIAM
: when set to true, we will dump the users from IAM, and print a comparison with what VOMS seesUseIAM
: not query voms-admin anymore, but the IAM endpointBEGINRELEASENOTES
NEW: VOMS2CSAgent can query IAM
ENDRELEASENOTES