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

[FEATURE REQUEST] add a webhook on the onbarding endpoint #261

Open
fcomte opened this issue Sep 22, 2023 · 7 comments
Open

[FEATURE REQUEST] add a webhook on the onbarding endpoint #261

fcomte opened this issue Sep 22, 2023 · 7 comments

Comments

@fcomte
Copy link
Contributor

fcomte commented Sep 22, 2023

We shoud handle to send webhook on the onboarding endpoint. It can an organisation to handle complexe onboarding on their own.

@titigmr
Copy link

titigmr commented Aug 24, 2024

Interested by this feature, for example to create an custom action when usernamespace is created

@olevitt
Copy link
Contributor

olevitt commented Sep 9, 2024

This could be implemented without much effort but I'm wondering what the behaviour should be if a webhook is configured but fails to respond ?
Should the webhook be considered mandatory (or even be a "validating" webhook) ? If so, should it happen before the namespace creation (and whatever is done for onboarding) ? If it's not mandatory then admin will have to manually intervene for onboardings done during the webhook downtime.
I don't think Onyxia can support retrying until webhook is back online.
Any thought on this ?

Also note that the events system currently in place (with output in the API logs) has a onboarding.createNamespace event that is triggered at the time of onboarding.
We could also make the events system call a webhook for each event instead or in addition to the current logs output. That would solve this issue and also let admins react to other events.

Discussions and opinions welcome :)

@titigmr
Copy link

titigmr commented Sep 10, 2024

Thank you for your attention :)

In my case, the webhook is not mandatory webhook. We only need (for now) to create user's bucket with policies when a new user log in. In my opinion, if the webhook is down, it's ok for an admin reload the action manually (an api call for example).

The last proposition is also very good, but we can adapt to your choices.

@olevitt
Copy link
Contributor

olevitt commented Sep 20, 2024

I just wrote #500 that adds webhook as an output for events.
@titigmr I think that will fit your need

@titigmr
Copy link

titigmr commented Sep 20, 2024

Nice thanks! We need to get the user id when the event createNamespace is trigger, the Onyxia api can send it to the webhook?

@olevitt
Copy link
Contributor

olevitt commented Sep 20, 2024

Nice thanks! We need to get the user id when the event createNamespace is trigger, the Onyxia api can send it to the webhook?

It's present in the event so it will be sent to the webhook (the data sent to the webhook are the exact same data that are currently output in thé logs) , see https://github.com/InseeFrLab/onyxia-api/blob/main/onyxia-api/src/main/java/fr/insee/onyxia/api/events/InitNamespaceEvent.java
If you want to test the webhook feature, feel free to use tag events-webhook for API image (it's based on API V3 / onyxia V9 so make sure your instance is up to date first)

@titigmr
Copy link

titigmr commented Sep 20, 2024

Perfect!

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

No branches or pull requests

3 participants