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

Possibility to configure name of the "secret" field in POST webhook #7487

Closed
margru opened this issue Jul 16, 2019 · 8 comments
Closed

Possibility to configure name of the "secret" field in POST webhook #7487

margru opened this issue Jul 16, 2019 · 8 comments
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@margru
Copy link

margru commented Jul 16, 2019

Would it be possible to be able to change the name of the field "secret" inside the POST HTTP request within a webhook? Currently, the field is always "secret". I am using another tool listening to these requests (ReadTheDocs) but it expects the secret token to be sent with a different name ("token"; and unfortunatelly, it is not cofigurable either). It means that I cannot use these two great tools together just because of such a tiny problem.

Or if you have any suggestion on how to solve this, it would be great. I was thinking about a proxy modifying the requests but it seems to be as a bad workaround.

@lunny lunny added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Jul 17, 2019
@steko
Copy link

steko commented May 14, 2020

Hi, sorry to needlessly bump this but it's a persistent annoyance for any Python open source project hosted on Gitea, e.g. in my case https://codeberg.org/steko/iosacal and others. Read the Docs is unfortunately hardcoded and treats just the big hubs as special cases.

I don't suppose it's enough to change the field value in templates/repo/settings/webhook/gitea.tmpl?

@zeripath
Copy link
Contributor

You'd likely have to change all references to json:"secret" to json:"token" in modules/structs/hook.go.

I'm not particularly au fait with the webhooks tbh - I still don't quite understand why we're not providing some template based rendering format for these tbh

@techknowlogick
Copy link
Member

json:"secret" in webhooks has been deprecated, and the hmac in header should be used instead, as the secret field will be removed. I am closing this now as secret as a field in the webhook will be removed.

@steko
Copy link

steko commented May 17, 2020

Thanks for the update and clarification! Just to be sure I understand correctly, when you refer to "hmac in header should be used instead" is this possible right now or will be enabled when json:"secret" is removed? I'm asking because I still see the same fields on try.gitea.io and I can't find any hmac field.

@techknowlogick
Copy link
Member

In the Webhook response you'll see the X-Gitea-Signature header (see screenshot for example), and that is calculated using the shared secret between both systems. As for the secret field inside of the webhook JSON, it'll eventually be removed.
Screen Shot 2020-05-17 at 3 28 04 PM

@margru
Copy link
Author

margru commented May 18, 2020

It's probably out of the Gitea scope but will this help in setting the integration with the ReadTheDocs server? It seems to me that it would be even worse for the integration...

@margru
Copy link
Author

margru commented Jun 18, 2020

@steko Were you able to setup the integration with the Read the Docs? As I still see no way...

@steko
Copy link

steko commented Jun 18, 2020

@margru unfortunately, no. I'm still building manually from the Readthedocs dashboard. I don't understand how to use the new hmac based method.

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

5 participants