Add Jira connect subscriptions REST API
What does this MR do and why?
This adds a new API endpoint to subscribe namespace to Jira Connect installations. The logic is same as in the JiraConnect::SubscriptionsController. The benefit of the API endpoint is that the user can be authenticated with an access token.
The token authentication is needed because we are changing the frontend to receive an access token using the OAuth flow, and then use the API to interact with GitLab. (related discussion)
This change is behind the jira_connect_oauth
feature flag.
Related issue: #357243 (closed)
How to set up and validate locally
I couldn't find a good way to validate this locally. The problem is that the JWT token must be generated by Atlassian and for that a publicly available GitLab instance is needed to do the installation handshake. We have a way to set up a development environment for the GitLab for Jira app, but I couldn't find a way to fetch the JWT token needed for the API request. Therefor, I added this change behind a feature flag so we can validate it once the frontend parts are done.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.