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

Commit 8690a2b

Browse files
committed
fix: Session params
Session params was introduced here: 454f894 but this commit break it cf1450a#diff-6c1cca6748acc9f2583d0fca54d4bbbfc92e8836711cf318ca09d3cd4e60f00dR204 in this commit we fixed this feature and also added a unit test to prevent this kind of regressions for the future.
1 parent 83fb477 commit 8690a2b

6 files changed

Lines changed: 20 additions & 7 deletions

File tree

src/oidcop/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import secrets
22

3-
__version__ = "2.2.0"
3+
__version__ = "2.2.1"
44

55
DEF_SIGN_ALG = {
66
"id_token": "RS256",

src/oidcop/configure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ class EntityConfiguration(Base):
203203
"httpc_params": {},
204204
"issuer": "",
205205
"keys": None,
206-
"session_key": None,
206+
"session_params": None,
207207
"template_dir": None,
208208
"token_handler_args": {},
209209
"userinfo": None,

tests/op_config.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,19 +269,19 @@
269269
}
270270
},
271271
"session_params": {
272-
"password": "__password_used_to_encrypt_access_token_sid_value",
273-
"salt": "salt involved in session sub hash ",
272+
"password": "ses_key",
273+
"salt": "ses_salt",
274274
"sub_func": {
275275
"public": {
276276
"class": "oidcop.session.manager.PublicID",
277277
"kwargs": {
278-
"salt": "sdfsdfdsf"
278+
"salt": "mysalt"
279279
}
280280
},
281281
"pairwise": {
282282
"class": "oidcop.session.manager.PairWiseID",
283283
"kwargs": {
284-
"salt": "sdfsdfsdf"
284+
"salt": "mysalt"
285285
}
286286
}
287287
}

tests/test_00_configure.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ def test_op_configure():
3737
args = dict(configuration.items())
3838
assert "add_on" in args
3939

40+
assert "session_params" in configuration
41+
4042

4143
def test_op_configure_from_file():
4244
configuration = create_from_config_file(

tests/test_06_session_manager.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ def create_session_manager(self):
7373
},
7474
"token_endpoint": {"path": "{}/token", "class": Token, "kwargs": {}},
7575
},
76+
"session_params": {
77+
"password": "ses_key",
78+
"salt": "ses_salt"
79+
},
7680
"template_dir": "template",
7781
"claims_interface": {"class": "oidcop.session.claims.ClaimsInterface", "kwargs": {}},
7882
"userinfo": {
@@ -104,6 +108,11 @@ def _create_session(self, auth_req, sub_type="public", sector_identifier=""):
104108
ae, authz_req, USER_ID, client_id=client_id, sub_type=sub_type
105109
)
106110

111+
def test_session_manager_salt_key(self):
112+
sman = self.session_manager
113+
assert sman.key == "ses_key"
114+
assert sman.salt == "ses_salt"
115+
107116
@pytest.mark.parametrize(
108117
"sub_type, sector_identifier",
109118
[("pairwise", "https://all.example.com"), ("public", ""), ("ephemeral", "")],

tests/test_23_oidc_registration_endpoint.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ def create_endpoint(self):
7777
conf = {
7878
"issuer": "https://example.com/",
7979
"password": "mycket hemligt",
80-
"verify_ssl": False,
80+
"httpc_params": {
81+
"verify": False, "timeout": 1
82+
},
8183
"capabilities": {
8284
"subject_types_supported": ["public", "pairwise", "ephemeral"],
8385
"grant_types_supported": [

0 commit comments

Comments
 (0)