summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/saml2/entity.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/saml2/entity.py b/src/saml2/entity.py
index 7fd18da9..71e9ecfb 100644
--- a/src/saml2/entity.py
+++ b/src/saml2/entity.py
@@ -151,13 +151,12 @@ class Entity(HTTPBase):
self.config.getattr('digest_algorithm')
or def_sig.get_digest_alg()
)
- sign_config = (
- self.config.getattr("authn_requests_signed", "sp")
- if self.entity_type == "sp"
- else self.config.getattr("sign_response", "idp")
- if self.entity_type == "idp"
- else False
- )
+
+ sign_config_per_entity_type = {
+ 'sp': self.config.getattr("authn_requests_signed", "sp"),
+ 'idp': self.config.getattr("sign_response", "idp"),
+ }
+ sign_config = sign_config_per_entity_type.get(self.entity_type, False)
self.should_sign = sign_config
for item in ["cert_file", "key_file", "ca_certs"]: