api: keep local cache of API clients from idp (#88697) #1317
No reviewers
Labels
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: entrouvert/wcs#1317
Loading…
Reference in New Issue
No description provided.
Delete Branch "wip/88697-api-afterjob-idp-client"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
WIP: api: serialize user as attributes to support api clients in afterjobs (#88697)to api: serialize user as attributes to support api clients in afterjobs (#88697)api: serialize user as attributes to support api clients in afterjobs (#88697)to WIP: api: serialize user as attributes to support api clients in afterjobs (#88697)2e12fbad77
to4faf2e5da8
WIP: api: serialize user as attributes to support api clients in afterjobs (#88697)to api: serialize user as attributes to support api clients in afterjobs (#88697)Dans une première version je modifiais la sérialisation dans l'afterjob mais en dormant dessus j'ai trouvé ça moche, j'ai refait en simplement enregistrant en local les clients d'API d'authentic, ça mélange moins les choses et posera moins de problème au moment où il faudra journaliser les accès API (#52966).
api: serialize user as attributes to support api clients in afterjobs (#88697)to api: keep local cache of API clients from idp (#88697)@ -147,3 +155,3 @@
try:
api_access.restrict_to_anonymised_data = data['data']['restrict_to_anonymised_data']
api_access._role_ids = data['data']['roles']
api_access.roles = [role_class.get(x, ignore_errors=True) for x in data['data']['roles']]
Ok, vu ce
ignore_errors=True
puis la ligne juste en dessous, pour zapper en douce les rôles qui ne correspondent à rien dans w.c.s.Je ne sais pas exactement comment ça peut arriver (notamment les rôles techniques cantonnés à authentic ne sont pas attribuables aux client d’API), mais ok.
Moi non plus mais j'ai préféré renforcer.