diff options
author | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2022-06-08 19:01:31 +0200 |
---|---|---|
committer | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2022-06-08 19:01:31 +0200 |
commit | d88a979a957c3f52719cc85ae0376ea3fca8771e (patch) | |
tree | 133dfaa13e3007b15ee79bee8cc0945b0cd0126e /src | |
parent | 348a78179207da3a9547913e6b6616c8c4daedf3 (diff) | |
download | pysaml2-d88a979a957c3f52719cc85ae0376ea3fca8771e.tar.gz |
Add partial supprot for xs:date AttributeValue type
Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/saml2/saml.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/saml2/saml.py b/src/saml2/saml.py index af91bdeb..d63509fe 100644 --- a/src/saml2/saml.py +++ b/src/saml2/saml.py @@ -15,6 +15,8 @@ import base64 +from datetime import date +from datetime import datetime from saml2.validate import valid_ipv4, MustValueError from saml2.validate import valid_ipv6 @@ -307,6 +309,11 @@ class AttributeValueBase(SamlBase): }[str(x).lower()], 'to_text': lambda x: str(x).lower(), }, + 'date': { + 'type': date, + 'to_type': lambda x: datetime.strptime(x, '%Y-%m-%d').date(), + 'to_text': str, + }, 'base64Binary': { 'type': str, 'to_type': str, |