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

Plugin v2.x webhook URL syntax no longer supported #982

Closed
mickmister opened this issue Oct 5, 2023 · 1 comment
Closed

Plugin v2.x webhook URL syntax no longer supported #982

mickmister opened this issue Oct 5, 2023 · 1 comment

Comments

@mickmister
Copy link
Contributor

Summary

When we introduced multiple Jira instance support in v3.0, we changed the webhook URL structure to include an identifier of the intended Jira instance. Updating the webhook URL was optional, since there was a check for backwards compatibility for the old webhook URL structure, though this backwards compatibility check regressed in v4.0.0.

As mentioned in the v2.2 tag's README, we previously a supported a syntax like:

https://SITEURL/plugins/jira/api/v2/webhook?secret=WEBHOOKSECRET

While it looks like this today:

https://SITEURL/plugins/jira/instance/INSTANCE_ID/api/v2/webhook?secret=WEBHOOKSECRET

The task here is to restore backwards compatibility for the 2.x webhook URL syntax. This will involve modifying the mux.Router to allow the /webhook and api/v2/webhook endpoints that do not have the instance/INSTANCE_ID part of the URL.

The below block which handles this case was in 3.x but is not in 4.0.0. Note the ResolveWebhookInstanceURL that is called here. This is what normalizes the URL to make the INSTANCE_ID optional:

routeIncomingWebhook,
routeOAuth1Complete,
routeUserDisconnect,
routeUserConnect,
routeUserStart,
routeAPISubscribeWebhook:
callbackInstanceID, err = p.ResolveWebhookInstanceURL(instanceURL)
if err != nil {
return respondErr(w, http.StatusInternalServerError, err)
}

mickmister pushed a commit that referenced this issue Oct 23, 2023
* [MI-3636]:Added support for webhook of plugin version v2.x.x

* [MI-3636]:Added support for legacy webhooks
@raghavaggarwal2308
Copy link
Contributor

@mickmister Can we close this as done via #989

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

No branches or pull requests

2 participants