changeset 7257:861ef58bc36e

auth: add https ability to the crowd auth module (issue #315) [Thomas De Schampheleire: - use select iso checkbox to remove need for bool->string conversion - update tests]
author Chris Rule <crule@aegistg.com>
date Tue, 01 May 2018 17:08:36 +0200
parents 1bdda21f186a
children 6e75963503cc
files kallithea/lib/auth_modules/auth_crowd.py kallithea/tests/functional/test_admin_auth_settings.py
diffstat 2 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/lib/auth_modules/auth_crowd.py	Tue May 01 21:51:54 2018 +0200
+++ b/kallithea/lib/auth_modules/auth_crowd.py	Tue May 01 17:08:36 2018 +0200
@@ -131,6 +131,8 @@
 
 
 class KallitheaAuthPlugin(auth_modules.KallitheaExternalAuthPlugin):
+    def __init__(self):
+        self._protocol_values = ["http", "https"]
 
     @hybrid_property
     def name(self):
@@ -139,6 +141,14 @@
     def settings(self):
         settings = [
             {
+                "name": "method",
+                "validator": self.validators.OneOf(self._protocol_values),
+                "type": "select",
+                "values": self._protocol_values,
+                "description": "The protocol used to connect to the Atlassian CROWD server.",
+                "formname": "Protocol"
+            },
+            {
                 "name": "host",
                 "validator": self.validators.UnicodeString(strip=True),
                 "type": "string",
--- a/kallithea/tests/functional/test_admin_auth_settings.py	Tue May 01 21:51:54 2018 +0200
+++ b/kallithea/tests/functional/test_admin_auth_settings.py	Tue May 01 17:08:36 2018 +0200
@@ -229,6 +229,7 @@
                        'auth_crowd_app_password': 'secret',
                        'auth_crowd_admin_groups': 'mygroup',
                        'auth_crowd_port': '123',
+                       'auth_crowd_method': 'https',
                        'auth_crowd_app_name': 'xyzzy'})
 
         test_url = url(controller='admin/auth_settings',