Skip to content

Auto-create editor delegation on DataPass validation webhook#246

Merged
Un3x merged 5 commits into
developfrom
feature/api-6622-t2-creation-automatique-de-delegation-au-webhook-datapass
Jul 7, 2026
Merged

Auto-create editor delegation on DataPass validation webhook#246
Un3x merged 5 commits into
developfrom
feature/api-6622-t2-creation-automatique-de-delegation-au-webhook-datapass

Conversation

@Un3x

@Un3x Un3x commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

DataPass approve/validate webhooks on an editor form now auto-create the EditorDelegation (idempotent, created_via: datapass_auto).

  • New created_via column + enum on EditorDelegation
  • EditorDelegation::AutoCreate inserted after CreateOrProlongToken in both webhook organizer chains; a non-delegable editor alerts Sentry without failing the webhook

Closes API-6622 → https://linear.app/pole-api/issue/API-6622/t2-creation-automatique-de-delegation-au-webhook-datapass

🤖 Generated with Claude Code

Un3x added 4 commits July 6, 2026 13:47
Distinguishes manual delegations from upcoming DataPass auto-creation.
A non-delegable editor alerts Sentry without failing the context, so the
webhook keeps flowing and DataPass does not retry.
Inserted in the V1 organizer chains right after token creation: V2
webhooks flow through them via AdaptV2ToV1, and V1 webhooks no-op since
no editor form_uid matches their demarches.
Reuse MonitoringService for the Sentry warning and move the form_uids
lookup onto Editor where the column lives.
@linear

linear Bot commented Jul 6, 2026

Copy link
Copy Markdown

API-6622

@Un3x Un3x requested review from Samuelfaure and skelz0r and removed request for skelz0r July 6, 2026 12:18
Comment thread site/app/organizers/datapass_webhook/api_entreprise.rb Outdated
Comment thread site/app/interactors/editor_delegation/auto_create.rb Outdated
Comment thread site/app/interactors/editor_delegation/auto_create.rb Outdated
Review feedback: the delegation formalizes an already-existing reality,
so the webhook records it unconditionally; the boolean will gate editor
token usage instead. Also move the interactor under DatapassWebhook
since it is webhook-specific.
@Un3x Un3x merged commit d918096 into develop Jul 7, 2026
10 checks passed
@Un3x Un3x deleted the feature/api-6622-t2-creation-automatique-de-delegation-au-webhook-datapass branch July 7, 2026 07:42
@skelz0r

skelz0r commented Jul 7, 2026

Copy link
Copy Markdown
Member

Je note ça là pour trace : du coup maintenant les usagers auront sur la vue d'une habilitation les délégations, et il me semble que c'est "révocable" ici, même si ça n'a pas vraiment de sens.

J'ai une PR avec une itération en cours sur l'ensemble de la vue (qui certes traine) qui clarifie un peu plus.

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.

2 participants