mattermost-plugin-gitlab icon indicating copy to clipboard operation
mattermost-plugin-gitlab copied to clipboard

Fixes Issue MM-257, invalid scopes during /gitlab connect

Open maisnamrajusingh opened this issue 3 years ago • 4 comments
trafficstars

This PR fixes the bug bug in https://github.com/mattermost/mattermost-plugin-gitlab/issues/257

The problem with the error The requested scope is invalid, unknown, or malformed is caused by more scopes being selected in the Mattermost plugin gitlab than in the gitlab.

the changed code is in the 'server/plugin.go' file. Precisely changing scopes which were originally "api" & "read_user" to empty array string. Then when /gitlab connect is tried it shows connected successfully.

When selecting a scope other than "api", for example choosing "profile" only without 'API'. The gitlab server sends the error The requested scope is invalid, unknown, or malformed. The above situation can be concluded that the gitlab server will send the same error if it does not check 'api'.

maisnamrajusingh avatar Apr 27 '22 09:04 maisnamrajusingh

Hello @maisnamrajusingh,

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.

mattermod avatar Apr 27 '22 09:04 mattermod

Codecov Report

Merging #292 (011c548) into master (bbd7d38) will not change coverage. The diff coverage is 0.00%.

@@           Coverage Diff           @@
##           master     #292   +/-   ##
=======================================
  Coverage   39.36%   39.36%           
=======================================
  Files          16       16           
  Lines        1801     1801           
=======================================
  Hits          709      709           
  Misses       1015     1015           
  Partials       77       77           
Impacted Files Coverage Δ
server/plugin.go 11.61% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update bbd7d38...011c548. Read the comment docs.

codecov[bot] avatar Apr 27 '22 09:04 codecov[bot]

@maisnamrajusingh Heads up that you need to merge master

hanzei avatar May 02 '22 10:05 hanzei

This PR has been automatically labelled "stale" because it hasn't had recent activity. A core team member will check in on the status of the PR to help with questions. Thank you for your contribution!

mattermod avatar May 22 '22 01:05 mattermod

I'm not convinced that this PR takes the right direction. https://github.com/mattermost/mattermost-plugin-gitlab/issues/257 is caused by an invalid user input, not by a code issue. It can't work properly if the OAuth app is not granted the right scopes. With the changes in this PR, issues will arise at another level.

hanzei avatar Feb 22 '23 21:02 hanzei

This PR has been automatically labelled "stale" because it hasn't had recent activity. A core team member will check in on the status of the PR to help with questions. Thank you for your contribution!

mattermost-build avatar Mar 05 '23 01:03 mattermost-build

Closing per https://github.com/mattermost/mattermost-plugin-gitlab/pull/292#issuecomment-1440810847

hanzei avatar Mar 23 '23 09:03 hanzei