diff options
author | Colleen Murphy <colleen.murphy@suse.de> | 2018-08-15 15:41:20 +0200 |
---|---|---|
committer | Colleen Murphy <colleen.murphy@suse.de> | 2018-08-15 15:41:20 +0200 |
commit | e58e89526da18f9e0ab9d67d17a2766f3941e1ea (patch) | |
tree | 8e4ef679de4aa5737d8884dce58acd65b7a6d050 /src/saml2/saml.py | |
parent | a17f233c7a845105913ee4c72c33eb6c60a6d5c6 (diff) | |
download | pysaml2-e58e89526da18f9e0ab9d67d17a2766f3941e1ea.tar.gz |
Raise ValueError for invalid attribute type
Without this patch, the AttributeValueBase set_text method checks for a
valid xsi:type before setting the text value, but when it gets to the
catchall case, instead of raising an exception it simply creates an
unassigned ValueError instance and does nothing with it. This is clearly
not intentional, and it is a problem because it means it is possible to
set an invalid xsi:type for an AttributeValue. This patch corrects the
error by raising the ValueError exception rather than letting it
disappear into the ether.
Diffstat (limited to 'src/saml2/saml.py')
-rw-r--r-- | src/saml2/saml.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/saml2/saml.py b/src/saml2/saml.py index 7aefd408..8807966c 100644 --- a/src/saml2/saml.py +++ b/src/saml2/saml.py @@ -224,7 +224,7 @@ class AttributeValueBase(SamlBase): elif typ == "xs:base64Binary": pass else: - ValueError("Type and value doesn't match") + raise ValueError("Type and value doesn't match") elif isinstance(val, bool): if val: val = "true" |