You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support Github compatible webhooks from non-Github sources #1353
Could we remove these header checks? They don't really provide any value I can see, security is easily bypassed by adding those headers in to the request. Perhaps it reduces the cost of unmarshalling a webhook which isn't Github-compatible but that is probably only a minor saving.
At the moment we are having to work around this by having Gogs send to a webhook proxy endpoint that strips the body & sends to a configured OpenShift generic webhook endpoint instead (generic webhooks can only accept a body that is of a certain format, not Github-compatible webhook format). Not optimal.
Yes that looks fine. We can use generic webhooks instead, even if the gogs webhook is GitHub api compatible AFAIK. Is there any different behaviour when using generic webhook vs GitHub webhook?
From the user perspective there are none, both trigger a build. The only difference is that github webhook is prepared to specifically run with github whereas generic has broader application.
Still I'll have a look at gogs to see how much it differs from what we expect in github webhook.
@jimmidyson right, it's setting X-Gogs-Event (see here). Unfortunately with X-GitHub-Event we know whether there was a push or just ping event, based on which we do or don't trigger a new build. The other option is to match both headers, I guess. @smarterclayton thoughts?
@jimmidyson right, it's setting X-Gogs-Event (see here).
Unfortunately with X-GitHub-Event we know whether there was a push or just
ping event, based on which we do or don't trigger a new build. The other
option is to match both headers, I guess. @smarterclayton thoughts?
Reply to this email directly or view it on GitHub: #1353 (comment)
Activity
soltysh commentedon Mar 18, 2015
For #1317 I've created #1333 to ignore errors from json unmarshalling. Have a look at it and lemme know it that works for you?
jimmidyson commentedon Mar 18, 2015
Yes that looks fine. We can use generic webhooks instead, even if the gogs webhook is GitHub api compatible AFAIK. Is there any different behaviour when using generic webhook vs GitHub webhook?
soltysh commentedon Mar 19, 2015
From the user perspective there are none, both trigger a build. The only difference is that github webhook is prepared to specifically run with github whereas generic has broader application.
Still I'll have a look at gogs to see how much it differs from what we expect in github webhook.
smarterclayton commentedon Apr 1, 2015
We should remove the requirement to have the user agent and x-github-event headers checked unless it's a security issue
soltysh commentedon May 8, 2015
@jimmidyson right, it's setting
X-Gogs-Event(see here). Unfortunately withX-GitHub-Eventwe know whether there was a push or just ping event, based on which we do or don't trigger a new build. The other option is to match both headers, I guess. @smarterclayton thoughts?smarterclayton commentedon May 8, 2015
I don't know that we need to check User-Agent for Github, but X-GitHub-Event seems to provide value.
What do we do on "ping"? Are we positive that ping means we shouldn't trigger a build?
----- Original Message -----
soltysh commentedon May 8, 2015
Yes, we can remove that.
We ignore that event, as this is what gets send when you test your webhook.
smarterclayton commentedon May 8, 2015
Ok, so the absence of Ping can probably default to "Push"
----- Original Message -----
soltysh commentedon May 8, 2015
Still we could check for either
X-Github-EventorX-Gogs-Event, as this is not too big overhead IMHO.smarterclayton commentedon May 8, 2015
Is it X-Gogs-Event=Ping?
----- Original Message -----
soltysh commentedon May 8, 2015
From the current code base here they support just the Push event, but since they state they are github-compatible I'd prefer to check that event name.
smarterclayton commentedon May 8, 2015
Ok
----- Original Message -----
Squashed 'cmd/service-catalog/go/src/github.com/kubernetes-incubator/…
Squashed 'cmd/service-catalog/go/src/github.com/kubernetes-incubator/…
Detect removed catalog entries (openshift#1353)