# HG changeset patch # User Chris Rule # Date 2018-05-01 17:08:36 # Node ID 861ef58bc36e20494a51b8a2e12e557979ad1f61 # Parent 1bdda21f186a951d3dbface660ee732ed58eb019 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] diff --git a/kallithea/lib/auth_modules/auth_crowd.py b/kallithea/lib/auth_modules/auth_crowd.py --- a/kallithea/lib/auth_modules/auth_crowd.py +++ b/kallithea/lib/auth_modules/auth_crowd.py @@ -131,6 +131,8 @@ class CrowdServer(object): class KallitheaAuthPlugin(auth_modules.KallitheaExternalAuthPlugin): + def __init__(self): + self._protocol_values = ["http", "https"] @hybrid_property def name(self): @@ -139,6 +141,14 @@ class KallitheaAuthPlugin(auth_modules.K 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", diff --git a/kallithea/tests/functional/test_admin_auth_settings.py b/kallithea/tests/functional/test_admin_auth_settings.py --- a/kallithea/tests/functional/test_admin_auth_settings.py +++ b/kallithea/tests/functional/test_admin_auth_settings.py @@ -229,6 +229,7 @@ class TestAuthSettingsController(TestCon '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',