Skip to content

Commit 804af5b

Browse files
committed
Fixed Configure tests.
1 parent d03c2a1 commit 804af5b

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

src/idpyoidc/configure.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,16 +225,20 @@ def __init__(self,
225225
self.web_conf = lower_or_upper(self.conf, "webserver")
226226

227227
if entity_conf:
228-
skip = [ec["path"] for ec in entity_conf]
228+
skip = [ec["path"] for ec in entity_conf if 'path' in ec]
229+
check = [l[0] for l in skip]
229230

230231
self.extend(conf=self.conf, base_path=base_path,
231232
domain=self.domain, port=self.port, entity_conf=entity_conf,
232233
file_attributes=self._file_attributes,
233234
dir_attributes=self._dir_attributes)
234235
for key, val in conf.items():
235-
for path in skip:
236-
if key == path[0]:
237-
continue
236+
if key in ["logging", "webserver", "domain", "port"]:
237+
continue
238+
239+
if key in check:
240+
continue
241+
238242
setattr(self, key, val)
239243
else:
240244
for key, val in conf.items():

src/idpyoidc/server/configure.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class EntityConfiguration(Base):
149149
"endpoint": {},
150150
"httpc_params": {},
151151
"issuer": "",
152-
"keys": None,
152+
"key_conf": None,
153153
"session_params": None,
154154
"template_dir": None,
155155
"token_handler_args": {},
@@ -171,7 +171,7 @@ def __init__(
171171
Base.__init__(self, conf, base_path, file_attributes=file_attributes,
172172
dir_attributes=dir_attributes, domain=domain, port=port)
173173

174-
self.key_conf = conf.get('key_conf')
174+
self.key_conf = conf.get('key_conf', conf.get('keys'))
175175

176176
for key in self.parameter.keys():
177177
_val = conf.get(key)

tests/test_server_00_configure.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import json
22
import os
33

4-
import pytest
5-
64
from idpyoidc.configure import Configuration
75
from idpyoidc.configure import create_from_config_file
86
from idpyoidc.logging import configure_logging
97
from idpyoidc.server.configure import OPConfiguration
8+
import pytest
109

1110
BASEDIR = os.path.abspath(os.path.dirname(__file__))
1211

@@ -99,7 +98,13 @@ def test_op_configure_default_from_file():
9998
def test_server_configure():
10099
configuration = create_from_config_file(
101100
Configuration,
102-
entity_conf=[{"class": OPConfiguration, "attr": "op", "path": ["op", "server_info"]}],
101+
entity_conf=[
102+
{
103+
"class": OPConfiguration,
104+
"attr": "op",
105+
"path": ["op", "server_info"]
106+
}
107+
],
103108
filename=full_path("srv_config.json"),
104109
base_path=BASEDIR,
105110
)

tests/test_server_20a_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def test_capabilities_default():
111111
"code id_token token",
112112
}
113113
assert server.endpoint_context.provider_info["request_uri_parameter_supported"] is True
114-
assert server.endpoint_context.jwks_uri == 'https://127.0.0.1:80/static/jwks.json'
114+
assert server.endpoint_context.jwks_uri == 'https://127.0.0.1:443/static/jwks.json'
115115

116116

117117
def test_capabilities_subset1():

0 commit comments

Comments
 (0)