Repository: IdentityPython/oidc-op (language: python)

Issue:
v2.2.0-1 - additional requirements for the release
fix: updated oidcop version in source tree
documentation inconsistency
In many tests and examples, including the [main example](https://github.com/IdentityPython/oidc-op/blob/a87177e7a5d0b40dcff11ed75b39a72bd2d3f015/docs/source/contents/conf.rst), the configuration option for claims is written as `add_claim_by_scope` (singular `claim`), but in the source code, it is `add_claims_by_scope` (plular `claims`):

https://github.com/IdentityPython/oidc-op/blob/a87177e7a5d0b40dcff11ed75b39a72bd2d3f015/src/oidcop/session/claims.py#L28

https://github.com/IdentityPython/oidc-op/blob/a87177e7a5d0b40dcff11ed75b39a72bd2d3f015/src/oidcop/oidc/userinfo.py#L38

I guess the documentation and tests should be fixed to `add_claims_by_scope`.
documentation inconsistency
In many tests and examples, including the [main example](https://github.com/IdentityPython/oidc-op/blob/a87177e7a5d0b40dcff11ed75b39a72bd2d3f015/docs/source/contents/conf.rst), the configuration option for claims is written as `add_claim_by_scope` (singular `claim`), but in the source code, it is `add_claims_by_scope` (plular `claims`):

https://github.com/IdentityPython/oidc-op/blob/a87177e7a5d0b40dcff11ed75b39a72bd2d3f015/src/oidcop/session/claims.py#L28

https://github.com/IdentityPython/oidc-op/blob/a87177e7a5d0b40dcff11ed75b39a72bd2d3f015/src/oidcop/oidc/userinfo.py#L38

I guess the documentation and tests should be fixed to `add_claims_by_scope`.


Discussion / hints:

Fix patch:
diff --git a/docs/source/contents/conf.rst b/docs/source/contents/conf.rst
index 92e97711..e5450105 100644
--- a/docs/source/contents/conf.rst
+++ b/docs/source/contents/conf.rst
@@ -571,7 +571,7 @@ An example::
                 "phone_number",
                 "phone_number_verified"
               ],
-              "add_claim_by_scope": true,
+              "add_claims_by_scope": true,
               "aud": ["https://example.org/appl"]
            }
         },
diff --git a/example/flask_op/config.json b/example/flask_op/config.json
index 36bded78..1f0fb783 100644
--- a/example/flask_op/config.json
+++ b/example/flask_op/config.json
@@ -311,7 +311,7 @@
               "phone_number",
               "phone_number_verified"
             ],
-            "add_claim_by_scope": true,
+            "add_claims_by_scope": true,
             "aud": [
               "https://example.org/appl"
             ]
diff --git a/example/flask_op/config.yaml b/example/flask_op/config.yaml
index 00efd4b8..b79a5fc9 100644
--- a/example/flask_op/config.yaml
+++ b/example/flask_op/config.yaml
@@ -88,7 +88,7 @@ op:
           - email_verified
           - phone_number
           - phone_number_verified
-        add_claim_by_scope: True
+        add_claims_by_scope: True
         aud:
           - https://example.org/appl
       refresh:


Test patch:
diff --git a/tests/op_config.json b/tests/op_config.json
index 47d2fd72..af959286 100644
--- a/tests/op_config.json
+++ b/tests/op_config.json
@@ -325,7 +325,7 @@
           "phone_number",
           "phone_number_verified"
         ],
-        "add_claim_by_scope": true,
+        "add_claims_by_scope": true,
         "aud": [
           "https://example.org/appl"
         ]
diff --git a/tests/op_config_defaults.py b/tests/op_config_defaults.py
index 429b42ec..e3d73f0e 100644
--- a/tests/op_config_defaults.py
+++ b/tests/op_config_defaults.py
@@ -133,7 +133,7 @@
             "kwargs": {
                 "lifetime": 3600,
                 "add_claims": ["email", "email_verified", "phone_number", "phone_number_verified",],
-                "add_claim_by_scope": True,
+                "add_claims_by_scope": True,
                 "aud": ["https://example.org/appl"],
             },
         },
diff --git a/tests/srv_config.yaml b/tests/srv_config.yaml
index fc63798d..5593c7ca 100644
--- a/tests/srv_config.yaml
+++ b/tests/srv_config.yaml
@@ -96,7 +96,7 @@ op:
           - email_verified
           - phone_number
           - phone_number_verified
-        add_claim_by_scope: True
+        add_claims_by_scope: True
         aud:
           - https://example.org/appl
       refresh:
diff --git a/tests/test_06_session_manager.py b/tests/test_06_session_manager.py
index eaa189e8..054c3c96 100644
--- a/tests/test_06_session_manager.py
+++ b/tests/test_06_session_manager.py
@@ -56,7 +56,7 @@ def create_session_manager(self):
                     "kwargs": {
                         "lifetime": 3600,
                         "add_claims": True,
-                        "add_claim_by_scope": True,
+                        "add_claims_by_scope": True,
                         "aud": ["https://example.org/appl"],
                     },
                 },
diff --git a/tests/test_08_session_life.py b/tests/test_08_session_life.py
index bb29fdff..729f7dbc 100644
--- a/tests/test_08_session_life.py
+++ b/tests/test_08_session_life.py
@@ -269,7 +269,7 @@ def setup_session_manager(self):
                             "phone_number",
                             "phone_number_verified",
                         ],
-                        "add_claim_by_scope": True,
+                        "add_claims_by_scope": True,
                         "aud": ["https://example.org/appl"],
                     },
                 },
diff --git a/tests/test_40_oauth2_pushed_authorization.py b/tests/test_40_oauth2_pushed_authorization.py
index 56ef1d2d..fe60c38f 100644
--- a/tests/test_40_oauth2_pushed_authorization.py
+++ b/tests/test_40_oauth2_pushed_authorization.py
@@ -95,7 +95,7 @@ def create_endpoint(self):
                             "phone_number",
                             "phone_number_verified",
                         ],
-                        "add_claim_by_scope": True,
+                        "add_claims_by_scope": True,
                         "aud": ["https://example.org/appl"],
                     },
                 },