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

Fixed issue: Comment notification not working after implementing OAuth2 and Added PKCE code for OAuth2 #953

Conversation

raghavaggarwal2308
Copy link
Contributor

@raghavaggarwal2308 raghavaggarwal2308 commented Jun 15, 2023

Summary

  1. Comment webhooks not working: Comment webhook notifications were not working because earlier Jira wasn't sending info about the issue on which the comment was posted. So, we were using a dummy JWT to fetch that info separately. Since we are using OAuth2 now, that part of the code was giving an error. We explored a bit and found out that issue info is now sent in the webhook payload for comments. So, we removed it.
  2. Added PKCE along with authorization code while performing OAuth2.
  3. Did some code refactoring.

Issue/Enhancement Links:

  1. Add PKCE while performing OAuth
  2. Webhook notification not working

Fixes PR

#949 (Implement OAuth2 Authentication (reopened))

cwarnermm and others added 13 commits June 6, 2023 09:25
* Migrate Docs from GitBook

* Update readme.md

* Update readme.md

Co-authored-by: Katie Wiersgalla <39744472+wiersgallak@users.noreply.github.com>

* Update readme.md

Co-authored-by: Katie Wiersgalla <39744472+wiersgallak@users.noreply.github.com>

* Update readme.md

Co-authored-by: Katie Wiersgalla <39744472+wiersgallak@users.noreply.github.com>

---------

Co-authored-by: Katie Wiersgalla <39744472+wiersgallak@users.noreply.github.com>
[MI-3153] Fixed issue: comment webhook notification not working and added PKCE for authorization
[MI-3159] Implement OAuth for jira cloud instances
@mattermost-build
Copy link
Contributor

Hello @raghavaggarwal2308,

Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.

@DHaussermann
Copy link

@raghavaggarwal2308 FWIW - I'll try and do a test from this PR branch and see if the subscription bug is solved.

Maybe @hanzei can help you push this back up into #949 shortly.

@DHaussermann
Copy link

@raghavaggarwal2308 I'm a bit confused. I compiled this branch and upgraded the same server where I found the issue and I see no change in behavior. Updating several fields in the ticket is delivering the events but comment events do not get delivered.

I double checked my commit
image

{
 "caller": "app/plugin_api.go:976",
 "level": "error",
 "msg": "PostNotifications: error while getting jiraClient, err: failed to get Jira client for the user : error in getting token from token source: oauth2: token expired and refresh token is not set",
 "plugin_id": "jira",
 "timestamp": "2023-06-15 16:48:34.765 Z"
}

The error is now different. I don't know what token we're looking for here.

I also tried on a fresh server with a new installation and comments still don't work.

Please let me know if you can repro this.

Copy link

@esarafianou esarafianou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (for the PKCE part that I reviewed)

@raghavaggarwal2308
Copy link
Contributor Author

@DHaussermann We tried to reproduce this on MM server version v7.8.2 but we were unable to do so. Can you please share the server version you are using? Also, it would be helpful if you can share your Mattermost and Jira test cloud server credentials so that we can adequately debug the issue here.

@DHaussermann
Copy link

Hi @raghavaggarwal2308,

I will DM you a set of credentials now. I can also include an invite to a server where I see the issue.
Please ping me if you still cannot repo after.

@DHaussermann
Copy link

DHaussermann commented Jun 19, 2023

@raghavaggarwal2308 after re-testing this. I do see comment events being delivered after the last commit.

The issue I see now is that unlike other events, comment events don't work with security levels for me. (On a project without security levels, this would not be something you can find as the case is not applicable)

Scenario A - The Jira issue has no security level set

  • Create a subscription that targets a project with security levels such as DKH-Project
  • Add events including comment events
  • Do not add security level filter to your subscription
  • Create or locate an issue in the project
  • Remove the security level (If it was applied at time of creation)
  • Add or update a comment
    Observed Events are delivered

Scenario B - The Jira issue has a security level set

  • Create a subscription that targets a project with security levels such as DKH-Project
  • Add events including comment events
  • Add security level filter to your subscription (can be all of them so any security level will deliver)
  • Create or locate an issue in the project
  • Add a security level (If it was not already applied at time of creation)
  • Add or update a comment
    Observed Comment events are not delivered but other field changes get event deliveries as expected

@raghavaggarwal2308
Copy link
Contributor Author

@DHaussermann @mickmister We explored the above issue. The reason for that is the webhook body for comment notification contains the issue details now, but they are incomplete. The custom/additional fields present on the issue are not listed in the issue details. So, when we are unable to match the filters for comment notifications when the "Security level" filter is set. To resolve this issue we need to make an extra API call to fetch the issue details separately for comment notification, but we need either the user's JiraAccountID or the MattermostUserID to get the Jira client and make an API call. The problem is that the webhook body contains only the account ID of the commenter, but that user may or may not be connected to Mattermost, so if we use that ID we won't be able to get issue details in case the user is not connected and the notification will not be posted. Can you suggest us a way to get the connected user's ID?

@DHaussermann
Copy link

@jasonblais heads-up Michael is likely the person with the most knowledge to provide guidance here but he's still away.

@hanzei may have some context but has not work on this functionality as much.

@hanzei hanzei added the Work In Progress Not yet ready for review label Jun 28, 2023
@hanzei
Copy link
Collaborator

hanzei commented Jun 28, 2023

I don't have context knowledge about the webhook handling in JIRA to share.

@mickmister
Copy link
Contributor

The reason for that is the webhook body for comment notification contains the issue details now, but they are incomplete. The custom/additional fields present on the issue are not listed in the issue details. So, when we are unable to match the filters for comment notifications when the "Security level" filter is set.

The problem is that the webhook body contains only the account ID of the commenter, but that user may or may not be connected to Mattermost, so if we use that ID we won't be able to get issue details in case the user is not connected and the notification will not be posted. Can you suggest us a way to get the connected user's ID?

@raghavaggarwal2308 This may be a limitation we need to accept. Can you please provide what information is missing from the payload, and what is present? Is there any way to have a superuser token / service account for Jira Cloud? If not, we may need to be clear that "any subscription post made from a comment will need to be made by a connected user."

@raghavaggarwal2308
Copy link
Contributor Author

raghavaggarwal2308 commented Jul 5, 2023

@mickmister

  1. According to what I have explored, I don't think Jira supports service account creation.
  2. In the webhook body for comment notification only the default fields are present like summary, issue type, project, assignee, priority, and status. The custom fields like security level, time tracking, etc. are not sent in the body.

Issue details in "comment created" webhook body:

{
  "issue": {
    "id": "10080",
    "self": "https://brightscout-dev.atlassian.net/rest/api/2/10080",
    "key": "TEST-68",
    "fields": {
      "summary": "Test-issue-summary",
      "issuetype": {
        "self": "https://brightscout-dev.atlassian.net/rest/api/2/issuetype/10001",
        "id": "10001",
        "description": "Created by Jira Agile - do not edit or delete. Issue type for a user story.",
        "iconUrl": "https://brightscout-dev.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10315?size=medium",
        "name": "Story",
        "subtask": false,
        "avatarId": 10315,
        "hierarchyLevel": 0
      },
      "project": {
        "self": "https://brightscout-dev.atlassian.net/rest/api/2/project/10000",
        "id": "10000",
        "key": "TEST",
        "name": "Test",
        "projectTypeKey": "software",
        "simplified": false,
        "avatarUrls": {
          "48x48": "https://brightscout-dev.atlassian.net/rest/api/2/universal_avatar/view/type/project/avatar/10424",
          "24x24": "https://brightscout-dev.atlassian.net/rest/api/2/universal_avatar/view/type/project/avatar/10424?size=small",
          "16x16": "https://brightscout-dev.atlassian.net/rest/api/2/universal_avatar/view/type/project/avatar/10424?size=xsmall",
          "32x32": "https://brightscout-dev.atlassian.net/rest/api/2/universal_avatar/view/type/project/avatar/10424?size=medium"
        }
      },
      "assignee": null,
      "priority": {
        "self": "https://brightscout-dev.atlassian.net/rest/api/2/priority/3",
        "iconUrl": "https://brightscout-dev.atlassian.net/images/icons/priorities/medium.svg",
        "name": "Medium",
        "id": "3"
      },
      "status": {
        "self": "https://brightscout-dev.atlassian.net/rest/api/2/status/10000",
        "description": "",
        "iconUrl": "https://brightscout-dev.atlassian.net/",
        "name": "Backlog",
        "id": "10000",
        "statusCategory": {
          "self": "https://brightscout-dev.atlassian.net/rest/api/2/statuscategory/2",
          "id": 2,
          "key": "new",
          "colorName": "blue-gray",
          "name": "To Do"
        }
      }
    }
  }
}

Issue details in "issue created" webhook body:

{
  "issue": {
    "id": "10080",
    "self": "https://brightscout-dev.atlassian.net/rest/api/2/10080",
    "key": "TEST-68",
    "fields": {
      "statuscategorychangedate": "2023-07-05T04:39:41.891-0500",
      "issuetype": {
        "self": "https://brightscout-dev.atlassian.net/rest/api/2/issuetype/10001",
        "id": "10001",
        "description": "Functionality or a feature expressed as a user goal.",
        "iconUrl": "https://brightscout-dev.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10315?size=medium",
        "name": "Story",
        "subtask": false,
        "avatarId": 10315,
        "hierarchyLevel": 0
      },
      "timespent": null,
      "customfield_10030": null,
      "project": {
        "self": "https://brightscout-dev.atlassian.net/rest/api/2/project/10000",
        "id": "10000",
        "key": "TEST",
        "name": "Test",
        "projectTypeKey": "software",
        "simplified": false,
        "avatarUrls": {
          "48x48": "https://brightscout-dev.atlassian.net/rest/api/2/universal_avatar/view/type/project/avatar/10424",
          "24x24": "https://brightscout-dev.atlassian.net/rest/api/2/universal_avatar/view/type/project/avatar/10424?size=small",
          "16x16": "https://brightscout-dev.atlassian.net/rest/api/2/universal_avatar/view/type/project/avatar/10424?size=xsmall",
          "32x32": "https://brightscout-dev.atlassian.net/rest/api/2/universal_avatar/view/type/project/avatar/10424?size=medium"
        }
      },
      "customfield_10033": [],
      "fixVersions": [],
      "aggregatetimespent": null,
      "customfield_10034": null,
      "customfield_10035": null,
      "resolution": null,
      "customfield_10036": null,
      "customfield_10037": null,
      "customfield_10027": null,
      "customfield_10028": null,
      "customfield_10029": null,
      "resolutiondate": null,
      "workratio": -1,
      "issuerestriction": {
        "issuerestrictions": {},
        "shouldDisplay": false
      },
      "lastViewed": null,
      "watches": {
        "self": "https://brightscout-dev.atlassian.net/rest/api/2/issue/TEST-68/watchers",
        "watchCount": 0,
        "isWatching": false
      },
      "created": "2023-07-05T04:39:41.497-0500",
      "customfield_10020": null,
      "customfield_10021": null,
      "customfield_10022": null,
      "customfield_10023": null,
      "priority": {
        "self": "https://brightscout-dev.atlassian.net/rest/api/2/priority/3",
        "iconUrl": "https://brightscout-dev.atlassian.net/images/icons/priorities/medium.svg",
        "name": "Medium",
        "id": "3"
      },
      "customfield_10024": null,
      "customfield_10025": null,
      "customfield_10026": null,
      "labels": [],
      "customfield_10016": null,
      "customfield_10017": null,
      "customfield_10018": {
        "hasEpicLinkFieldDependency": false,
        "showField": false,
        "nonEditableReason": {
          "reason": "PLUGIN_LICENSE_ERROR",
          "message": "The Parent Link is only available to Jira Premium users."
        }
      },
      "customfield_10019": "0|i000h3:",
      "aggregatetimeoriginalestimate": null,
      "timeestimate": null,
      "versions": [],
      "issuelinks": [],
      "assignee": null,
      "updated": "2023-07-05T04:39:41.497-0500",
      "status": {
        "self": "https://brightscout-dev.atlassian.net/rest/api/2/status/10000",
        "description": "",
        "iconUrl": "https://brightscout-dev.atlassian.net/",
        "name": "Backlog",
        "id": "10000",
        "statusCategory": {
          "self": "https://brightscout-dev.atlassian.net/rest/api/2/statuscategory/2",
          "id": 2,
          "key": "new",
          "colorName": "blue-gray",
          "name": "New"
        }
      },
      "components": [],
      "customfield_10050": null,
      "customfield_10051": null,
      "timeoriginalestimate": null,
      "customfield_10052": null,
      "description": null,
      "customfield_10010": null,
      "customfield_10014": null,
      "customfield_10015": null,
      "timetracking": {},
      "customfield_10005": null,
      "customfield_10006": null,
      "security": {
        "self": "https://brightscout-dev.atlassian.net/rest/api/2/securitylevel/10001",
        "id": "10001",
        "description": "",
        "name": "TEST_SECURITY_LEVEL"
      },
      "customfield_10007": null,
      "customfield_10008": null,
      "aggregatetimeestimate": null,
      "customfield_10009": null,
      "attachment": [],
      "summary": "Test-issue-summary",
      "creator": {
        "self": "https://brightscout-dev.atlassian.net/rest/api/2/user?accountId=6282e44146f77e006f20c3d9",
        "accountId": "6282e44146f77e006f20c3d9",
        "avatarUrls": {
          "48x48": "https://secure.gravatar.com/avatar/010054b5381598d1f6e68b4eed5a0550?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FRA-2.png",
          "24x24": "https://secure.gravatar.com/avatar/010054b5381598d1f6e68b4eed5a0550?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FRA-2.png",
          "16x16": "https://secure.gravatar.com/avatar/010054b5381598d1f6e68b4eed5a0550?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FRA-2.png",
          "32x32": "https://secure.gravatar.com/avatar/010054b5381598d1f6e68b4eed5a0550?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FRA-2.png"
        },
        "displayName": "Raghav Aggarwal",
        "active": true,
        "timeZone": "America/Chicago",
        "accountType": "atlassian"
      },
      "subtasks": [],
      "customfield_10040": null,
      "customfield_10041": null,
      "customfield_10042": null,
      "reporter": {
        "self": "https://brightscout-dev.atlassian.net/rest/api/2/user?accountId=6282e44146f77e006f20c3d9",
        "accountId": "6282e44146f77e006f20c3d9",
        "avatarUrls": {
          "48x48": "https://secure.gravatar.com/avatar/010054b5381598d1f6e68b4eed5a0550?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FRA-2.png",
          "24x24": "https://secure.gravatar.com/avatar/010054b5381598d1f6e68b4eed5a0550?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FRA-2.png",
          "16x16": "https://secure.gravatar.com/avatar/010054b5381598d1f6e68b4eed5a0550?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FRA-2.png",
          "32x32": "https://secure.gravatar.com/avatar/010054b5381598d1f6e68b4eed5a0550?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FRA-2.png"
        },
        "displayName": "Raghav Aggarwal",
        "active": true,
        "timeZone": "America/Chicago",
        "accountType": "atlassian"
      },
      "customfield_10044": null,
      "aggregateprogress": {
        "progress": 0,
        "total": 0
      },
      "customfield_10045": null,
      "customfield_10001": null,
      "customfield_10046": null,
      "customfield_10002": null,
      "customfield_10047": null,
      "customfield_10003": null,
      "customfield_10004": null,
      "customfield_10048": null,
      "customfield_10038": null,
      "customfield_10039": null,
      "environment": null,
      "duedate": null,
      "progress": {
        "progress": 0,
        "total": 0
      },
      "votes": {
        "self": "https://brightscout-dev.atlassian.net/rest/api/2/issue/TEST-68/votes",
        "votes": 0,
        "hasVoted": false
      }
    }
  }
}

@mickmister
Copy link
Contributor

@raghavaggarwal2308 In that case, I think we'll need to accept the fact that any subscription post made from a comment will need to be made by a connected user. DM mentions should still work in this case though right?

@mickmister
Copy link
Contributor

Do we need to make this change for all the APIs or just for the DM comment notifications?

@raghavaggarwal2308 Sorry I don't know the answer to this. I would say if Atlassian recommends this, and it all works when making the change, then we should just change all of them.

…for comment webhook notification (#58)

* [MI-3282] Added logic to expand issue in comment webhook notification

* [MI-3282] Fix lint errors

* [MI-3315] Fixed issue: comment DM notification not working due to invalid API call

* [MI-3282] Review fixes

* [MI-3282] Review fix
@codecov-commenter
Copy link

codecov-commenter commented Jul 25, 2023

Codecov Report

Patch coverage: 3.14% and project coverage change: -1.51% ⚠️

Comparison is base (7c1b921) 31.16% compared to head (0186841) 29.66%.

Additional details and impacted files
@@                        Coverage Diff                         @@
##           MM-51310_oauth2_authentication     #953      +/-   ##
==================================================================
- Coverage                           31.16%   29.66%   -1.51%     
==================================================================
  Files                                  50       52       +2     
  Lines                                7409     7777     +368     
==================================================================
- Hits                                 2309     2307       -2     
- Misses                               4909     5278     +369     
- Partials                              191      192       +1     
Files Changed Coverage Δ
server/client.go 8.04% <0.00%> (ø)
server/command.go 15.32% <0.00%> (-0.69%) ⬇️
server/instance.go 89.47% <0.00%> (-10.53%) ⬇️
server/instance_cloud.go 6.43% <0.00%> (-0.08%) ⬇️
server/instance_cloud_oauth.go 0.00% <0.00%> (ø)
server/instance_server.go 18.88% <0.00%> (-0.43%) ⬇️
server/kv.go 17.24% <0.00%> (-1.02%) ⬇️
server/plugin.go 11.56% <0.00%> (-0.05%) ⬇️
server/setup_flow.go 0.00% <0.00%> (ø)
server/user.go 26.70% <ø> (ø)
... and 8 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@raghavaggarwal2308
Copy link
Contributor Author

raghavaggarwal2308 commented Jul 25, 2023

@mickmister Fixed both issues with the comment webhook notification:

  1. Comment webhook notification not working when "Security Level" filter is applied in subscription: Updated the logic to expand the issue details in the webhook notification. NOTE: The details will be expanded only when the comment is made by a connected user.

  2. DM notification not working for comment webhook notifications: Updated the code to make API call with proper base URL.

Copy link
Contributor

@mickmister mickmister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, though I want to make sure the comment fetching works for Jira Server on this line

err = client.RESTGet(fmt.Sprintf("/2/issue/%s/comment/%s", wh.Issue.ID, wh.Comment.ID), nil, &struct{}{})

server/webhook_jira.go Outdated Show resolved Hide resolved
server/webhook_jira.go Outdated Show resolved Hide resolved
@@ -140,7 +140,7 @@ func (wh *webhook) PostNotifications(p *Plugin, instanceID types.ID) ([]*model.P

isCommentEvent := wh.Events().Intersection(commentEvents).Len() > 0
if isCommentEvent {
err = client.RESTGet(notification.commentSelf, nil, &struct{}{})
err = client.RESTGet(fmt.Sprintf("/2/issue/%s/comment/%s", wh.Issue.ID, wh.Comment.ID), nil, &struct{}{})
Copy link
Contributor

@mickmister mickmister Jul 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if this works for all 3 Jira instance types. This is my main remaining concern here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mickmister I have tested this code on Jira cloud-oauth and server instances but since the Jira JWT is not working for us, we were not able to test it there.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'm hesitant to introduce this change for Jira server. We need to make sure it works on Jira server v7 before release. If it works for Jira 9, it likely works for Jira 7, but we should avoid a regression on Jira server for something related to Jira cloud. Maybe we can wrap this in a conditional block "if cloud" etc. Please let me know your thoughts on risks of both options if you can

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mickmister Added the conditional block

Comment on lines +739 to +762
func (p *Plugin) getIssueDataForCloudWebhook(instance Instance, issueKey string) (*jira.Issue, error) {
ci, ok := instance.(*cloudInstance)
if !ok {
return nil, errors.Errorf("must be a Jira cloud instance, is %s", instance.Common().Type)
}

jiraClient, err := ci.getClientForBot()
if err != nil {
return nil, err
}

issue, resp, err := jiraClient.Issue.Get(issueKey, nil)
if err != nil {
switch {
case resp == nil:
return nil, errors.WithMessage(userFriendlyJiraError(nil, err), "request to Jira failed")
case resp.StatusCode == http.StatusNotFound || resp.StatusCode == http.StatusUnauthorized:
return nil, errors.New(`we couldn't find the issue key, or the cloud "bot" client does not have the appropriate permissions to view the issue`)
}
}

return issue, nil
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did this function exist somewhere else earlier? Was it deleted at some point? I'm asking because there is no red diff related to this function in this commit

Copy link
Contributor Author

@raghavaggarwal2308 raghavaggarwal2308 Jul 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mickmister Yes, it was removed earlier.

…ue) (#60)

* [MI-3331] Review fixes on PR mattermost#953 (Comment notification issue)

* [MI-3331] Added separate condition to check if the instance is a cloud instance or not
@raghavaggarwal2308
Copy link
Contributor Author

@mickmister FIxed the review comments mentioned by you

@mickmister mickmister added 3: QA Review Requires review by a QA tester and removed Work In Progress Not yet ready for review labels Jul 25, 2023
@raghavaggarwal2308
Copy link
Contributor Author

raghavaggarwal2308 commented Jul 31, 2023

@DHaussermann Are you testing this PR? If not, can Brightscout team QA test it?

@mickmister
Copy link
Contributor

@raghavaggarwal2308: @DHaussermann is currently on vacation so he won't be able to respond

Also there's an unresolved discussion here #953 (comment). I'm thinking we should keep it the way it was for Jira Server, to avoid having to test with Jira Server v7. However, Jira Server v9 should be regression tested before OAuth is released.

@Kshitij-Katiyar
Copy link
Contributor

@raghavaggarwal2308: @DHaussermann is currently on vacation so he won't be able to respond

Also there's an unresolved discussion here #953 (comment). I'm thinking we should keep it the way it was for Jira Server, to avoid having to test with Jira Server v7. However, Jira Server v9 should be regression tested before OAuth is released.

@mickmister Sure, we will be making this today after that as @DHaussermann is not available, so should brightscout QA do the QA review if this is urgent or should we wait for Dylan to come back ?

@mickmister
Copy link
Contributor

@Kshitij-Katiyar Brightscout can do QA on this PR. FYI Dylan will be back on Monday

raghavaggarwal2308 added a commit to Brightscout/mattermost-plugin-jira that referenced this pull request Aug 2, 2023
… issue)

1. Added conditional for separation out the logic for jira cloud and server
… issue) (#62)

1. Added conditional for separation out the logic for jira cloud and server
@mickmister mickmister merged commit 6df75bc into mattermost:MM-51310_oauth2_authentication Aug 11, 2023
4 checks passed
@mickmister
Copy link
Contributor

@DHaussermann Note that I've merged this into the main OAuth PR #949

@AayushChaudhary0001
Copy link

Tested and approved, LGTM

  • This PR was tested on MM version-7.8.2 with latest Jira cloud instance and server version - 9.
  • Comment notifications were found working during the testing of this PR.
  • This PR is tested and the setup of OAuth 2.0 is completely working fine.

mickmister added a commit that referenced this pull request Aug 29, 2023
* Initial commit to support OAuth2 authentication

* Implemented modal to configure OAuth2 credentials

* Made the field names consistent

* Removed install_cloud_oauth.md template

* Added telemetry tracking for oauth2 setup flow

* Fixed typo

* Implemented few review comments

* Reverted webapp changes

* Reverted package-lock.json file

* Fixed depreciation

* Using refresh token to get another access token

* Implemented review comments & QA findings

* Implemented few additional review comments

* fixed enterprise check while updating instances

* Renamed function name for easy understanding

* Fixed failing instances test

* fix merge issue

* fix merge issue 2

* check for cloud oauth instance for comment webhooks

* Fixed issue: Comment notification not working after implementing OAuth2 and Added PKCE code for OAuth2 (#953)

* Migrate Docs from GitBook (#948)

* Migrate Docs from GitBook

* Update readme.md

* Update readme.md

Co-authored-by: Katie Wiersgalla <39744472+wiersgallak@users.noreply.github.com>

* Update readme.md

Co-authored-by: Katie Wiersgalla <39744472+wiersgallak@users.noreply.github.com>

* Update readme.md

Co-authored-by: Katie Wiersgalla <39744472+wiersgallak@users.noreply.github.com>

---------

Co-authored-by: Katie Wiersgalla <39744472+wiersgallak@users.noreply.github.com>

* [MI-3153] Fixed issue: comment webhook notification not working

* [MI-3153] Added PKCE along with authorization code for getting the access token

* [MI-3153] Review fixes

* [MI-3159] Review fixes of comments given by Kshitij

* [MI-3159] Review fixes given by Ayush

* [MI-3159] Removed the code which was forcing the template window to close after user is connected

* [MI-3153] Review fixes

* [MI-3159] Review fixes

* [MI-3159] Review fix

* [MI-3282] Added logic to expand issue and issue with DM notification for comment webhook notification (#58)

* [MI-3282] Added logic to expand issue in comment webhook notification

* [MI-3282] Fix lint errors

* [MI-3315] Fixed issue: comment DM notification not working due to invalid API call

* [MI-3282] Review fixes

* [MI-3282] Review fix

* [MI-3331] Review fixes on PR #953 (Comment notification issue) (#60)

* [MI-3331] Review fixes on PR #953 (Comment notification issue)

* [MI-3331] Added separate condition to check if the instance is a cloud instance or not

* [MI-3335] Review fixes on Jira PR #953(Comment notification issue) (#62)

1. Added conditional for separation out the logic for jira cloud and server

---------

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>
Co-authored-by: Katie Wiersgalla <39744472+wiersgallak@users.noreply.github.com>

---------

Co-authored-by: Rohitesh Gupta <1429138+srkgupta@users.noreply.github.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Raghav Aggarwal <raghav.aggarwal@brightscout.com>
Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>
Co-authored-by: Katie Wiersgalla <39744472+wiersgallak@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3: QA Review Requires review by a QA tester Contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants