CZ-NIC / django-eidas-specific-node

GNU General Public License v3.0
2 stars 2 forks source link

Case sensitivity in NameIDFormat comparison #88

Closed jtalir closed 4 years ago

jtalir commented 4 years ago

One country reported issue on our proxy service and corresponding error message is

File "/usr/lib/python3/dist-packages/eidas_node/models.py", line 144, in deserialize_name_id_format
   return NameIdFormat(elm.text) if elm.text else None
File "/usr/lib/python3.5/enum.py", line 241, in __call__
   return cls.__new__(cls, value)
File "/usr/lib/python3.5/enum.py", line 476, in __new__
   raise ValueError("%r is not a valid %s" % (value, cls.__name__))
ValueError: 'urn:oasis:names:tc:saml:1.1:nameid-format:unspecified' is not a valid NameIdFormat

Allowed formats are:

The difference is 'SAML' vs 'saml'. The question is if case sensitivity of this string comparison is bug or feature.

tpazderka commented 4 years ago

NameID is of a type string, which according to SAML specifications (https://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf 1.3.1) shoudl be compared as case sensitive.

So, I would qualify this as a feature.