Skip to content

Webhook doesn't work without a password/secret #18

@slPerryRhodan

Description

@slPerryRhodan

Gogs Version (Docker Tag): 0.10.8
Jenkins Plugin Version: 1.0.9
Reference: #gogs/gogs#4269

Hello,

I'm forced to use a password/secret when I want to use Webhooks of Gogs, otherwise the Jenkins plugin (1.0.9) throws an exception:

javax.servlet.ServletException: net.sf.json.JSONException: JSONObject["secret"] not found.
....
Caused by: net.sf.json.JSONException: JSONObject["secret"] not found.
	at net.sf.json.JSONObject.getString(JSONObject.java:2040)
	at org.jenkinsci.plugins.gogs.GogsWebHook.doIndex(GogsWebHook.java:163)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:335)
	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:175)
	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:108)
	at org.kohsuke.stapler.IndexDispatcher.dispatch(IndexDispatcher.java:26)
	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
	... 60 more

Since Gogs 0.10.x there is no JSON field "secret" anymore, only the header field "X-Gogs-Signature" will be send, which holds the encrypted secret or it is just empty. I guess the back-support for Gogs version 0.9.x and less causes the issue.

Anyway, older versions of "Gogs 0.9.x" are working fine together with the Jenkins plugin "1.0.9" or less. But I would appreciate, if you could fix this issue. Or is there any additional configuration I have to do?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions