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

Commit ff3ce22

Browse files
authored
Merge pull request #145 from IdentityPython/develop
v2.2.1
2 parents 754385f + ffeaefc commit ff3ce22

33 files changed

+90
-65
lines changed

docs/source/contents/conf.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ An example::
571571
"phone_number",
572572
"phone_number_verified"
573573
],
574-
"add_claim_by_scope": true,
574+
"add_claims_by_scope": true,
575575
"aud": ["https://example.org/appl"]
576576
}
577577
},

example/flask_op/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@
311311
"phone_number",
312312
"phone_number_verified"
313313
],
314-
"add_claim_by_scope": true,
314+
"add_claims_by_scope": true,
315315
"aud": [
316316
"https://example.org/appl"
317317
]

example/flask_op/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ op:
8888
- email_verified
8989
- phone_number
9090
- phone_number_verified
91-
add_claim_by_scope: True
91+
add_claims_by_scope: True
9292
aud:
9393
- https://example.org/appl
9494
refresh:

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: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
from oidcop.scopes import SCOPE2CLAIMS
1414
from oidcop.utils import load_yaml_config
1515

16+
logger = logging.getLogger(__name__)
17+
18+
1619
DEFAULT_FILE_ATTRIBUTE_NAMES = [
1720
"server_key",
1821
"server_cert",
@@ -84,7 +87,8 @@
8487

8588
AS_DEFAULT_CONFIG = copy.deepcopy(OP_DEFAULT_CONFIG)
8689
AS_DEFAULT_CONFIG["claims_interface"] = {
87-
"class": "oidcop.session.claims.OAuth2ClaimsInterface", "kwargs": {}}
90+
"class": "oidcop.session.claims.OAuth2ClaimsInterface", "kwargs": {}
91+
}
8892

8993

9094
def add_base_path(conf: Union[dict, str], base_path: str, file_attributes: List[str]):
@@ -203,12 +207,10 @@ class EntityConfiguration(Base):
203207
"httpc_params": {},
204208
"issuer": "",
205209
"keys": None,
206-
"session_key": None,
210+
"session_params": None,
207211
"template_dir": None,
208212
"token_handler_args": {},
209213
"userinfo": None,
210-
"password": None,
211-
"salt": None,
212214
}
213215

214216
def __init__(
@@ -243,6 +245,15 @@ def __init__(
243245
else:
244246
continue
245247

248+
if key not in DEFAULT_EXTENDED_CONF:
249+
logger.warning(
250+
f"{key} not seems to be a valid configuration parameter"
251+
)
252+
elif not _val:
253+
logger.warning(
254+
f"{key} not configured, using default configuration values"
255+
)
256+
246257
if key == "template_dir":
247258
_val = os.path.abspath(_val)
248259

@@ -585,4 +596,23 @@ def __init__(
585596
},
586597
},
587598
"userinfo": {"class": "oidcop.user_info.UserInfo", "kwargs": {"db_file": "users.json"}, },
599+
"scopes_to_claims": SCOPE2CLAIMS,
600+
"session_params": {
601+
"password": "ses_key",
602+
"salt": "ses_salt",
603+
"sub_func": {
604+
"public": {
605+
"class": "oidcop.session.manager.PublicID",
606+
"kwargs": {
607+
"salt": "mysalt"
608+
}
609+
},
610+
"pairwise": {
611+
"class": "oidcop.session.manager.PairWiseID",
612+
"kwargs": {
613+
"salt": "mysalt"
614+
}
615+
}
616+
}
617+
},
588618
}

tests/op_config.json

Lines changed: 5 additions & 5 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
}
@@ -325,7 +325,7 @@
325325
"phone_number",
326326
"phone_number_verified"
327327
],
328-
"add_claim_by_scope": true,
328+
"add_claims_by_scope": true,
329329
"aud": [
330330
"https://example.org/appl"
331331
]

tests/op_config_defaults.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
"kwargs": {
134134
"lifetime": 3600,
135135
"add_claims": ["email", "email_verified", "phone_number", "phone_number_verified",],
136-
"add_claim_by_scope": True,
136+
"add_claims_by_scope": True,
137137
"aud": ["https://example.org/appl"],
138138
},
139139
},

tests/srv_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ op:
9696
- email_verified
9797
- phone_number
9898
- phone_number_verified
99-
add_claim_by_scope: True
99+
add_claims_by_scope: True
100100
aud:
101101
- https://example.org/appl
102102
refresh:

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_00_server.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ def full_path(local_file):
3636

3737
CONF = {
3838
"issuer": "https://example.com/",
39-
"password": "mycket hemligt",
40-
"verify_ssl": False,
39+
"httpc_params": {"verify": False, "timeout": 1},
4140
"capabilities": {},
4241
"keys": {"uri_path": "static/jwks.json", "key_defs": KEYDEFS, "read_only": True},
4342
"endpoint": {

0 commit comments

Comments
 (0)