Minors
This commit is contained in:
@@ -305,7 +305,7 @@ class SAML2Plugin(FormPluginBase):
|
|||||||
# used 2 times : one to get the ticket, the other to validate it
|
# used 2 times : one to get the ticket, the other to validate it
|
||||||
def _serviceURL(self, environ, qstr=None):
|
def _serviceURL(self, environ, qstr=None):
|
||||||
if qstr != None:
|
if qstr != None:
|
||||||
url = construct_url(environ, querystring=qstr)
|
url = construct_url(environ, querystring = qstr)
|
||||||
else:
|
else:
|
||||||
url = construct_url(environ)
|
url = construct_url(environ)
|
||||||
return url
|
return url
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ FORM_SPEC = """<form method="post" action="%s">
|
|||||||
<input type="submit" value="Submit" />
|
<input type="submit" value="Submit" />
|
||||||
</form>"""
|
</form>"""
|
||||||
|
|
||||||
LAX = True
|
LAX = False
|
||||||
|
|
||||||
SESSION_INFO = {"ava":{}, "came from":"", "not_on_or_after":0,
|
SESSION_INFO = {"ava":{}, "came from":"", "not_on_or_after":0,
|
||||||
"issuer":"", "session_id":-1}
|
"issuer":"", "session_id":-1}
|
||||||
@@ -295,7 +295,7 @@ class Saml2Client(object):
|
|||||||
condition = assertion.conditions
|
condition = assertion.conditions
|
||||||
log and log.info("condition: %s" % condition)
|
log and log.info("condition: %s" % condition)
|
||||||
now = time.gmtime()
|
now = time.gmtime()
|
||||||
log and log.info("now: %s" % time.mktime(now))
|
#log and log.info("now: %s" % time.mktime(now))
|
||||||
not_on_or_after = str_to_time(condition.not_on_or_after)
|
not_on_or_after = str_to_time(condition.not_on_or_after)
|
||||||
if not_on_or_after < now:
|
if not_on_or_after < now:
|
||||||
# To old ignore
|
# To old ignore
|
||||||
@@ -303,7 +303,7 @@ class Saml2Client(object):
|
|||||||
raise Exception("To old can't use it")
|
raise Exception("To old can't use it")
|
||||||
|
|
||||||
not_before = str_to_time(condition.not_before)
|
not_before = str_to_time(condition.not_before)
|
||||||
log and log.info("not_before: %s" % time.mktime(not_before))
|
#log and log.info("not_before: %s" % time.mktime(not_before))
|
||||||
if not_before > now:
|
if not_before > now:
|
||||||
# Can't use it yet
|
# Can't use it yet
|
||||||
if not LAX:
|
if not LAX:
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ from saml2.utils import kd_subject_confirmation_data, kd_success_status
|
|||||||
from saml2.utils import filter_attribute_value_assertions
|
from saml2.utils import filter_attribute_value_assertions
|
||||||
from saml2.utils import OtherError, do_attribute_statement
|
from saml2.utils import OtherError, do_attribute_statement
|
||||||
from saml2.utils import VersionMismatch, UnknownPrincipal, UnsupportedBinding
|
from saml2.utils import VersionMismatch, UnknownPrincipal, UnsupportedBinding
|
||||||
from saml2.utils import filter_on_attributes
|
from saml2.utils import filter_on_attributes, kd_status_from_exception
|
||||||
|
|
||||||
from saml2.sigver import correctly_signed_authn_request
|
from saml2.sigver import correctly_signed_authn_request
|
||||||
from saml2.sigver import pre_signature_part
|
from saml2.sigver import pre_signature_part
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ EXCEPTION2STATUS = {
|
|||||||
UnknownPrincipal: samlp.STATUS_UNKNOWN_PRINCIPAL,
|
UnknownPrincipal: samlp.STATUS_UNKNOWN_PRINCIPAL,
|
||||||
UnsupportedBinding: samlp.STATUS_UNSUPPORTED_BINDING,
|
UnsupportedBinding: samlp.STATUS_UNSUPPORTED_BINDING,
|
||||||
OtherError: samlp.STATUS_UNKNOWN_PRINCIPAL,
|
OtherError: samlp.STATUS_UNKNOWN_PRINCIPAL,
|
||||||
|
MissingValue: samlp.STATUS_REQUEST_UNSUPPORTED,
|
||||||
}
|
}
|
||||||
|
|
||||||
def decode_base64_and_inflate( string ):
|
def decode_base64_and_inflate( string ):
|
||||||
@@ -402,6 +403,8 @@ def ava_to_attributes(ava, bmap):
|
|||||||
|
|
||||||
def do_attributes(identity):
|
def do_attributes(identity):
|
||||||
attrs = []
|
attrs = []
|
||||||
|
if not identity:
|
||||||
|
return attrs
|
||||||
for key, val in identity.items():
|
for key, val in identity.items():
|
||||||
dic = {}
|
dic = {}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user