WIPACrepo / keycloak-rest-services

Services surrounding KeyCloak, that use the REST API to read/update state
MIT License
1 stars 1 forks source link

`InstitutionAttrsMismatchError` for UW-River-Falls #42

Closed ric-evans closed 2 years ago

ric-evans commented 2 years ago
In [20]: pprint.pprint(await institutions.list_insts_flat(rest_client=rc))                                                                               
WARNING:krs.institutions:inst attr mismatch - UW-River-Falls
---------------------------------------------------------------------------
InstitutionAttrsMismatchError             Traceback (most recent call last)
<ipython-input-20-54f94b34b364> in <module>
----> 1 pprint.pprint(await institutions.list_insts_flat(rest_client=rc))

~/.local/lib/python3.8/site-packages/krs/institutions.py in list_insts_flat(experiment, filter_func, rest_client)
     81         if inst_key in ret and ret[inst_key] != attrs:
     82             logger.warning(f'inst attr mismatch - {inst_key}')
---> 83             raise InstitutionAttrsMismatchError(inst_key)
     84         ret[inst_key] = attrs
     85     return ret

InstitutionAttrsMismatchError: UW-River-Falls

The two River Falls' attrs are identical except that their collaboratorSecurityContact lists are in reverse from each other [a, b] vs [b, a]. I won't post the lists here for security reasons.

I'm not sure the best solution here: change the logic, replace lists with sets, or just "flip" the data in the db.

dsschult commented 2 years ago

I think the issue is that LDAP doesn't keep an order, so when they got imported a second time it switched. Should just be an edit in Keycloak. Remind me tomorrow.

dsschult commented 2 years ago

Should be fixed now. I just deleted Jim, since he's at Madison now.

briedel commented 2 years ago

We have a person at UWRF: https://www.uwrf.edu/FacultyStaff/5722731.cfm

dsschult commented 2 years ago

@briedel yes, it is now set to only them