|
13 | 13 | from oidcservice.state_interface import StateInterface |
14 | 14 |
|
15 | 15 | from oidcrp.http import HTTPLib |
| 16 | +from oidcrp.util import do_add_ons |
16 | 17 | from oidcrp.util import get_deserialization_method |
17 | 18 |
|
18 | 19 | __author__ = 'Roland Hedberg' |
@@ -41,7 +42,7 @@ def __init__(self, state_db, ca_certs=None, client_authn_factory=None, |
41 | 42 | :param keyjar: A py:class:`oidcmsg.key_jar.KeyJar` instance |
42 | 43 | :param verify_ssl: Whether the SSL certificate should be verified. |
43 | 44 | :param config: Configuration information passed on to the |
44 | | - :py:class:`oidcservice.service_context.ServiceContext` |
| 45 | + :py:class:`oidcservice.service_context.ServiceContext` |
45 | 46 | initialization |
46 | 47 | :param client_cert: Certificate used by the HTTP client |
47 | 48 | :param httplib: A HTTP client to use |
@@ -72,6 +73,9 @@ def __init__(self, state_db, ca_certs=None, client_authn_factory=None, |
72 | 73 | self.service = init_services(_srvs, self.service_context, state_db, |
73 | 74 | _cam) |
74 | 75 |
|
| 76 | + if 'add_ons' in config: |
| 77 | + do_add_ons(config['add_ons'], self.service) |
| 78 | + |
75 | 79 | self.service_context.service = self.service |
76 | 80 |
|
77 | 81 | self.verify_ssl = verify_ssl |
@@ -142,6 +146,11 @@ def service_request(self, service, url, method="GET", body=None, |
142 | 146 | if 'error' in response: |
143 | 147 | pass |
144 | 148 | else: |
| 149 | + try: |
| 150 | + kwargs['key'] = kwargs['state'] |
| 151 | + except KeyError: |
| 152 | + pass |
| 153 | + |
145 | 154 | service.update_service_context(response, **kwargs) |
146 | 155 | return response |
147 | 156 |
|
|
0 commit comments