Skip to content
This repository was archived by the owner on Jun 23, 2023. It is now read-only.

Commit 66ad918

Browse files
committed
Fixed bug
1 parent ac79c67 commit 66ad918

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

src/oidcop/configure.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@
7878
},
7979
}
8080

81+
AS_DEFAULT_CONFIG = copy.deepcopy(OP_DEFAULT_CONFIG)
82+
AS_DEFAULT_CONFIG["claims_interface"] = {
83+
"class": "oidcop.session.claims.OAuth2ClaimsInterface", "kwargs": {}}
84+
8185

8286
def add_base_path(conf: Union[dict, str], base_path: str, file_attributes: List[str]):
8387
if isinstance(conf, str):
@@ -186,6 +190,8 @@ def items(self):
186190

187191

188192
class EntityConfiguration(Base):
193+
default_config = AS_DEFAULT_CONFIG
194+
189195
def __init__(
190196
self,
191197
conf: Dict,
@@ -223,8 +229,8 @@ def __init__(
223229
for key in self.__dict__.keys():
224230
_val = conf.get(key)
225231
if not _val:
226-
if key in OP_DEFAULT_CONFIG:
227-
_dc = copy.deepcopy(OP_DEFAULT_CONFIG[key])
232+
if key in self.default_config:
233+
_dc = copy.deepcopy(self.default_config[key])
228234
add_base_path(_dc, base_path, file_attributes)
229235
_val = _dc
230236
else:
@@ -247,6 +253,7 @@ def __init__(
247253

248254
class OPConfiguration(EntityConfiguration):
249255
"Provider configuration"
256+
default_config = OP_DEFAULT_CONFIG
250257

251258
def __init__(
252259
self,
@@ -258,8 +265,6 @@ def __init__(
258265
file_attributes: Optional[List[str]] = None,
259266
):
260267
# OP special
261-
self.default_config = OP_DEFAULT_CONFIG
262-
263268
self.id_token = None
264269
self.login_hint2acrs = {}
265270
self.login_hint_lookup = None
@@ -270,11 +275,6 @@ def __init__(
270275
file_attributes=file_attributes)
271276

272277

273-
AS_DEFAULT_CONFIG = copy.deepcopy(OP_DEFAULT_CONFIG)
274-
AS_DEFAULT_CONFIG["claims_interface"] = {
275-
"class": "oidcop.session.claims.OAuth2ClaimsInterface", "kwargs": {}}
276-
277-
278278
class ASConfiguration(EntityConfiguration):
279279
"Authorization server configuration"
280280

@@ -287,8 +287,6 @@ def __init__(
287287
port: Optional[int] = 0,
288288
file_attributes: Optional[List[str]] = None,
289289
):
290-
self.default_config = AS_DEFAULT_CONFIG
291-
292290
EntityConfiguration.__init__(self, conf=conf, base_path=base_path,
293291
entity_conf=entity_conf, domain=domain, port=port,
294292
file_attributes=file_attributes)

0 commit comments

Comments
 (0)