summaryrefslogtreecommitdiff
path: root/src/saml2/validate.py
diff options
context:
space:
mode:
authorRoland Hedberg <roland.hedberg@adm.umu.se>2014-03-13 15:15:20 +0100
committerRoland Hedberg <roland.hedberg@adm.umu.se>2014-03-13 15:15:20 +0100
commit5cd5ebdc034180ff47767fe9cca4d4eba1bb1f27 (patch)
tree24f9993486fbdbffbd7710e1898f0d01dbb7b523 /src/saml2/validate.py
parentd7f50d4b05472916cce2d52329da664c2751b7ce (diff)
downloadpysaml2-5cd5ebdc034180ff47767fe9cca4d4eba1bb1f27.tar.gz
Refactored the support for metadata extension in the config file.
Diffstat (limited to 'src/saml2/validate.py')
-rw-r--r--src/saml2/validate.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/saml2/validate.py b/src/saml2/validate.py
index 3ba2dff8..376df9ed 100644
--- a/src/saml2/validate.py
+++ b/src/saml2/validate.py
@@ -201,6 +201,18 @@ def valid_unsigned_short(val):
return True
+def valid_positive_integer(val):
+ try:
+ integer = int(val)
+ except ValueError:
+ raise NotValid("positive integer")
+
+ if integer > 0:
+ return True
+ else:
+ raise NotValid("positive integer")
+
+
def valid_non_negative_integer(val):
try:
integer = int(val)
@@ -269,6 +281,7 @@ VALIDATOR = {
"dateTime": valid_date_time,
"anyURI": valid_any_uri,
"nonNegativeInteger": valid_non_negative_integer,
+ "PositiveInteger": valid_positive_integer,
"boolean": valid_boolean,
"unsignedShort": valid_unsigned_short,
"duration": valid_duration,