-
Notifications
You must be signed in to change notification settings - Fork 70
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
For non-cloud plugin settings, set hosting property to on-prem
#269
Conversation
…plugin settings
Currently WIP since the source code of the plugin still needs to change to support the correct functionality for both hosting environments |
This reverts commit b862b40.
Codecov Report
@@ Coverage Diff @@
## master #269 +/- ##
======================================
Coverage 0.00% 0.00%
======================================
Files 8 8
Lines 882 888 +6
======================================
- Misses 882 888 +6
Continue to review full report at Codecov.
|
on-prem
for non-cloud plugin settingson-prem
@@ -82,7 +82,7 @@ func findManifest() (*model.Manifest, error) { | |||
// we don't want to accidentally clobber anything we won't preserve. | |||
var manifest model.Manifest | |||
decoder := json.NewDecoder(manifestFile) | |||
decoder.DisallowUnknownFields() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is commented out to support compiling the plugin with an "unknown" property on the plugin settings. Updating the server version to otherwise support this is not trivial because:
- The newer mattermost-server commit to import requires Go 1.18 to compile
- circleci then needs to be updated to use Go 1.18
- Updating circleci's Go image is blocked by Move to cimg/go circleci-orbs#29
- I tried to continue the work on that PR, but getting Go 1.18 working on there was non-trivial
- The
golang:1.18-node
image also updates the node version, making it so it is a newer version than this plugin currently compiles with
The reason for this DisallowUnknownFields
call is to prevent the manifest field structure from being out of sync, which is something that's occurring in this PR. We are purposely "breaking the rules here", while the circleci update is still underway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @hanzei for discussion on this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Details on the error I was getting in CI mattermost/circleci-orbs#29 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and passed with mattermost/mattermost-webapp#10799 and mattermost/mattermost#20677
- JWT fields are correctly hidden when using a non Cloud license
- Tested upgrade case for servers with cloud license
- Tested that any server with cloud who may have oAuth disabled is seamlessly using oAuth config on upgrade
- As a precaution ensured that oAuth is still functional on upgrade
@@ -47,7 +47,8 @@ | |||
"type": "bool", | |||
"help_text": "When true, OAuth will be used as the authentication means with Zoom. \n When false, JWT will be used as the authentication means with Zoom. \n If you're currently using a JWT Zoom application and switch to OAuth, all users will need to connect their Zoom account using OAuth the next time they try to start a meeting. [More information](https://mattermost.gitbook.io/plugin-zoom/installation/zoom-configuration).", | |||
"placeholder": "", | |||
"default": false | |||
"default": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just double checking this default value change is intended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@larkox Yes it's intended, since the OAuth feature is now our "main" feature offering, and we want to discourage using the JWT method.
* set hosting to on-prem for `Enable OAuth`, `APIKey`, and `APISecret` plugin settings * use actual server commit * force oauth to be used when using cloud version of the plugin * bump go mod version * test circleci config * remove references to plugin-ci * bump Go version in circleci * use cimg * add other cimg changes * go mod tidy * revert circleci changes * revert build/go.mod changes so we are using the old server version * extend manifest struct to support hosting field * Revert "extend manifest struct to support hosting field" This reverts commit b862b40. * revert all go mod changes * remove manifest field name restriction * add comment explaining commented out code * reorder conditions for readability
* Cross-plugin task: Enable the CircleCI "test" job in each plugin repo that has a webapp plugin (#237) Co-authored-by: maisnamrajusingh <[email protected]> * [MM-223] Fixing Post Permissions Access (#233) * For non-cloud plugin settings, set hosting property to `on-prem` (#269) * set hosting to on-prem for `Enable OAuth`, `APIKey`, and `APISecret` plugin settings * use actual server commit * force oauth to be used when using cloud version of the plugin * bump go mod version * test circleci config * remove references to plugin-ci * bump Go version in circleci * use cimg * add other cimg changes * go mod tidy * revert circleci changes * revert build/go.mod changes so we are using the old server version * extend manifest struct to support hosting field * Revert "extend manifest struct to support hosting field" This reverts commit b862b40. * revert all go mod changes * remove manifest field name restriction * add comment explaining commented out code * reorder conditions for readability * Fix OAuth token refresh (#253) * avoid refreshing token if an error occurs while fetching current token * pass in firstConnect bool * lint * explicitly assign firstConnect boolean to local variable * ensure oauth token is decrypted when fetched from the kv store * rename functions * wrap account level token refresh in firstConnect block as well * Cherrypick "Correct docs and cleanup screenshots" * Revert "Cherrypick "Correct docs and cleanup screenshots"" This reverts commit 7164075. * preserve access token when saving encrypted version * use refresh token for check Co-authored-by: Mattermod <[email protected]> Co-authored-by: Ben Schumacher <[email protected]> Co-authored-by: Daniel Espino García <[email protected]> * bump to 1.6.1 * add GetLicense call in test * check nil license features (#277) Co-authored-by: sibasankarnayak <[email protected]> Co-authored-by: maisnamrajusingh <[email protected]> Co-authored-by: Jupri Abel <[email protected]> Co-authored-by: Mattermod <[email protected]> Co-authored-by: Ben Schumacher <[email protected]> Co-authored-by: Daniel Espino García <[email protected]>
Summary
This PR makes uses the
hosting
plugin setting property added by mattermost/mattermost#20677, in order to hide these settings on cloud servers.Ticket Link
Fixes https://mattermost.atlassian.net/browse/MM-44843
Related Pull Requests