diff options
author | Steven Hammerton <steven.hammerton@openmarket.com> | 2015-10-12 14:43:17 +0100 |
---|---|---|
committer | Steven Hammerton <steven.hammerton@openmarket.com> | 2015-10-12 14:43:17 +0100 |
commit | 01a5f1991c8e54d0762cf1647c941d00c938f994 (patch) | |
tree | 6645d3d32b54b152e71c9cb1758bf3de6e799435 /synapse/config/cas.py | |
parent | Allow optional config params for a required attribute and it's value, if spec... (diff) | |
download | synapse-01a5f1991c8e54d0762cf1647c941d00c938f994.tar.xz |
Support multiple required attributes in CAS response, and in a nicer config format too
Diffstat (limited to 'synapse/config/cas.py')
-rw-r--r-- | synapse/config/cas.py | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/synapse/config/cas.py b/synapse/config/cas.py index 4d1dd8cc7b..e884d03fe6 100644 --- a/synapse/config/cas.py +++ b/synapse/config/cas.py @@ -27,28 +27,17 @@ class CasConfig(Config): if cas_config: self.cas_enabled = True self.cas_server_url = cas_config["server_url"] - - if "required_attribute" in cas_config: - self.cas_required_attribute = cas_config["required_attribute"] - else: - self.cas_required_attribute = None - - if "required_attribute_value" in cas_config: - self.cas_required_attribute_value = cas_config["required_attribute_value"] - else: - self.cas_required_attribute_value = None - + self.cas_required_attributes = cas_config.get("required_attributes", None) else: self.cas_enabled = False self.cas_server_url = None - self.cas_required_attribute = None - self.cas_required_attribute_value = None + self.cas_required_attributes = {} def default_config(self, config_dir_path, server_name, **kwargs): return """ # Enable CAS for registration and login. #cas_config: # server_url: "https://cas-server.com" - # #required_attribute: something - # #required_attribute_value: true + # #required_attributes: + # # name: value """ |