Fixed a recursion problem.
Minor editorial changes.
This commit is contained in:
@@ -315,7 +315,6 @@ class Base(Entity):
|
||||
protocol_binding=binding,
|
||||
scoping=scoping, **args)
|
||||
|
||||
|
||||
def create_attribute_query(self, destination, name_id=None,
|
||||
attribute=None, message_id=0, consent=None,
|
||||
extensions=None, sign=False, sign_prepare=False,
|
||||
|
||||
@@ -103,7 +103,8 @@ def repack_cert(cert):
|
||||
|
||||
|
||||
class MetaData(object):
|
||||
def __init__(self, onts, attrc, metadata="", node_name=None, **kwargs):
|
||||
def __init__(self, onts, attrc, metadata="", node_name=None,
|
||||
check_validity=True, **kwargs):
|
||||
self.onts = onts
|
||||
self.attrc = attrc
|
||||
self.entity = {}
|
||||
@@ -112,6 +113,7 @@ class MetaData(object):
|
||||
self.node_name = node_name
|
||||
self.entities_descr = None
|
||||
self.entity_descr = None
|
||||
self.check_validity = check_validity
|
||||
|
||||
def items(self):
|
||||
return self.entity.items()
|
||||
@@ -129,6 +131,7 @@ class MetaData(object):
|
||||
return self.entity[item]
|
||||
|
||||
def do_entity_descriptor(self, entity_descr):
|
||||
if self.check_validity:
|
||||
try:
|
||||
if not valid(entity_descr.valid_until):
|
||||
logger.info("Entity descriptor (entity id:%s) to old" % (
|
||||
@@ -187,9 +190,11 @@ class MetaData(object):
|
||||
logger.error(exc.args[0])
|
||||
return
|
||||
|
||||
if self.check_validity:
|
||||
try:
|
||||
if not valid(self.entities_descr.valid_until):
|
||||
raise ToOld("Metadata not valid anymore, it's after %s" % (
|
||||
raise ToOld(
|
||||
"Metadata not valid anymore, it's after %s" % (
|
||||
self.entities_descr.valid_until,))
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
@@ -451,8 +451,8 @@ class AuthnResponse(StatusResponse):
|
||||
def __init__(self, sec_context, attribute_converters, entity_id,
|
||||
return_addrs=None, outstanding_queries=None,
|
||||
timeslack=0, asynchop=True, allow_unsolicited=False,
|
||||
test=False, allow_unknown_attributes=False, want_assertions_signed=False,
|
||||
**kwargs):
|
||||
test=False, allow_unknown_attributes=False,
|
||||
want_assertions_signed=False, **kwargs):
|
||||
|
||||
StatusResponse.__init__(self, sec_context, return_addrs, timeslack,
|
||||
asynchop=asynchop)
|
||||
|
||||
@@ -248,6 +248,8 @@ def valid_anytype(val):
|
||||
:return: True is value is valid otherwise an exception is raised
|
||||
"""
|
||||
for validator in VALIDATOR.values():
|
||||
if validator == valid_anytype: # To hinder recursion
|
||||
continue
|
||||
try:
|
||||
if validator(val):
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user