diff options
author | rohe <roland.hedberg@adm.umu.se> | 2015-12-18 08:03:18 +0100 |
---|---|---|
committer | rohe <roland.hedberg@adm.umu.se> | 2015-12-18 08:03:18 +0100 |
commit | 75ae22eb09192cde0e9002f6a80a49d225f1b595 (patch) | |
tree | 457921cbfcc56c102f503787e91ee2b2c0319fb4 /src/saml2/entity.py | |
parent | b28774d9737ba278954fa6a3cb31b6df467b56c3 (diff) | |
download | pysaml2-75ae22eb09192cde0e9002f6a80a49d225f1b595.tar.gz |
Added support for one callback. Will be used by the saml2test tool.
Diffstat (limited to 'src/saml2/entity.py')
-rw-r--r-- | src/saml2/entity.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/saml2/entity.py b/src/saml2/entity.py index 174d2e83..2f1c4d52 100644 --- a/src/saml2/entity.py +++ b/src/saml2/entity.py @@ -124,7 +124,7 @@ def create_artifact(entity_id, message_handle, endpoint_index=0): class Entity(HTTPBase): def __init__(self, entity_type, config=None, config_file="", - virtual_organization=""): + virtual_organization="", msg_cb=None): self.entity_type = entity_type self.users = None @@ -177,6 +177,8 @@ class Entity(HTTPBase): else: self.sourceid = {} + self.msg_cb = msg_cb + def _issuer(self, entityid=None): """ Return an Issuer instance """ if entityid: @@ -465,7 +467,6 @@ class Entity(HTTPBase): kwargs[key] = val req = request_cls(**kwargs) - reqid = req.id if destination: req.destination = destination @@ -479,6 +480,11 @@ class Entity(HTTPBase): if nsprefix: req.register_prefix(nsprefix) + if self.msg_cb: + req = self.msg_cb(req) + + reqid = req.id + if sign: return reqid, self.sign(req, sign_prepare=sign_prepare, sign_alg=sign_alg, digest_alg=digest_alg) |