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: add support for webhooks #5

Closed
greenpau opened this issue Jan 13, 2022 · 4 comments
Closed

feature: add support for webhooks #5

greenpau opened this issue Jan 13, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@greenpau
Copy link
Owner

greenpau commented Jan 13, 2022

Per @joeworkman,

webhook secret key is pretty simple. It's purely making sure that a specific header has a specific value.
For Github the header is X-Hub-Signature-256. We simply need to compare that with the stored key.
FYI. Gitlab's header for web hooks is X-Gitlab-Token

Add Caddyfile directive:

git {
  repo foo {
    webhook name <header> <secret>
  } 
}

When a request comes via API endpoint, inspect the header and authorize based on the presence of the webhook header and secret.

@greenpau greenpau self-assigned this Jan 13, 2022
greenpau added a commit that referenced this issue Jan 13, 2022
@greenpau greenpau added enhancement New feature or request and removed need triage labels Jan 13, 2022
@QuLogic
Copy link

QuLogic commented Feb 8, 2022

It doesn't appear that you actually validate X-Hub-Signature-256?

@greenpau
Copy link
Owner Author

@QuLogic , want to put a fix? :-)

@greenpau
Copy link
Owner Author

It doesn't appear that you actually validate X-Hub-Signature-256

Reopening it.

@greenpau greenpau reopened this Mar 12, 2022
@greenpau
Copy link
Owner Author

Will address the signature validation via #11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants