Merge ~pjdc/charm-k8s-mattermost/+git/charm-k8s-mattermost:add-saml-library-config into charm-k8s-mattermost:master

Proposed by Paul Collins
Status: Merged
Approved by: Barry Price
Approved revision: 43b2e30872da45cfcf03e91cfccc4535dd43eeeb
Merged at revision: e1c4c9c7bd671382239c420f91254b946594e8b6
Proposed branch: ~pjdc/charm-k8s-mattermost/+git/charm-k8s-mattermost:add-saml-library-config
Merge into: charm-k8s-mattermost:master
Diff against target: 47 lines (+15/-3)
2 files modified
config.yaml (+5/-0)
src/charm.py (+10/-3)
Reviewer Review Type Date Requested Status
Barry Price Approve
Canonical IS Reviewers Pending
Review via email: mp+390053@code.launchpad.net

Commit message

add use_experimental_saml_library, defaulting to true for backward-compatibility

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Barry Price (barryprice) wrote :

+1

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision e1c4c9c7bd671382239c420f91254b946594e8b6

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/config.yaml b/config.yaml
2index 5e8d551..22f73af 100644
3--- a/config.yaml
4+++ b/config.yaml
5@@ -186,3 +186,8 @@ options:
6 description: |
7 If set, apply miscellaneous Mattermost settings as used by Canonical.
8 default: false
9+ use_experimental_saml_library:
10+ type: boolean
11+ description: |
12+ If set, use the built-in Mattermost SAML library. Otherwise, use xmlsec1 to verify logins.
13+ default: true
14diff --git a/src/charm.py b/src/charm.py
15index 5d4446e..285d8e2 100755
16--- a/src/charm.py
17+++ b/src/charm.py
18@@ -427,7 +427,8 @@ class MattermostK8sCharm(CharmBase):
19 return
20 site_hostname = urlparse(config['site_url']).hostname
21
22- get_env_config(pod_spec, self.app.name).update(
23+ env_config = get_env_config(pod_spec, self.app.name)
24+ env_config.update(
25 {
26 'MM_EMAILSETTINGS_ENABLESIGNINWITHEMAIL': 'false',
27 'MM_EMAILSETTINGS_ENABLESIGNINWITHUSERNAME': 'false',
28@@ -446,11 +447,17 @@ class MattermostK8sCharm(CharmBase):
29 'MM_SAMLSETTINGS_FIRSTNAMEATTRIBUTE': 'fullname',
30 'MM_SAMLSETTINGS_LASTNAMEATTRIBUTE': '',
31 'MM_SAMLSETTINGS_IDPCERTIFICATEFILE': SAML_IDP_CRT,
32- # Otherwise we have to install xmlsec1 and Mattermost forks on every login(!).
33- 'MM_EXPERIMENTALSETTINGS_USENEWSAMLLIBRARY': 'true',
34 }
35 )
36
37+ if config['use_experimental_saml_library']:
38+ env_config.update(
39+ {
40+ # Otherwise we have to install xmlsec1 and Mattermost forks on every login(!).
41+ 'MM_EXPERIMENTALSETTINGS_USENEWSAMLLIBRARY': 'true',
42+ }
43+ )
44+
45 def _update_pod_spec_for_performance_monitoring(self, pod_spec):
46 """Update pod_spec with settings for the Prometheus exporter."""
47 config = self.model.config

Subscribers

People subscribed via source and target branches