From b346b0db8acd14b260f33c0e654b37222bd0f3cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89loi=20Rivard?= Date: Wed, 17 May 2023 08:54:13 +0200 Subject: [PATCH] Use generic Consent.consent_id instead of LDAP Consent.cn attribute --- canaille/oidc/consents.py | 2 +- canaille/oidc/endpoints.py | 2 +- tests/oidc/conftest.py | 2 +- tests/oidc/test_authorization_code_flow.py | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/canaille/oidc/consents.py b/canaille/oidc/consents.py index de5cad80..439031c0 100644 --- a/canaille/oidc/consents.py +++ b/canaille/oidc/consents.py @@ -119,7 +119,7 @@ def revoke_preconsent(user, client_id): ) consent = Consent( - cn=str(uuid.uuid4()), + consent_id=str(uuid.uuid4()), client=client, subject=user, scope=client.scope, diff --git a/canaille/oidc/endpoints.py b/canaille/oidc/endpoints.py index 7b229263..0de6c0e5 100644 --- a/canaille/oidc/endpoints.py +++ b/canaille/oidc/endpoints.py @@ -149,7 +149,7 @@ def authorize(): ).split(" ") else: consent = Consent( - cn=str(uuid.uuid4()), + consent_id=str(uuid.uuid4()), client=client, subject=user, scope=scopes, diff --git a/tests/oidc/conftest.py b/tests/oidc/conftest.py index efe9f559..1e801546 100644 --- a/tests/oidc/conftest.py +++ b/tests/oidc/conftest.py @@ -195,7 +195,7 @@ def id_token(testclient, client, user, slapd_connection): @pytest.fixture def consent(testclient, client, user, slapd_connection): t = Consent( - cn=str(uuid.uuid4()), + consent_id=str(uuid.uuid4()), client=client, subject=user, scope=["openid", "profile"], diff --git a/tests/oidc/test_authorization_code_flow.py b/tests/oidc/test_authorization_code_flow.py index 1e1b19ac..d71d75d7 100644 --- a/tests/oidc/test_authorization_code_flow.py +++ b/tests/oidc/test_authorization_code_flow.py @@ -605,7 +605,7 @@ def test_authorization_code_flow_but_user_cannot_use_oidc( def test_prompt_none(testclient, logged_user, client): consent = Consent( - cn=str(uuid.uuid4()), + consent_id=str(uuid.uuid4()), client=client, subject=logged_user, scope=["openid", "profile"], @@ -632,7 +632,7 @@ def test_prompt_none(testclient, logged_user, client): def test_prompt_not_logged(testclient, user, client): consent = Consent( - cn=str(uuid.uuid4()), + consent_id=str(uuid.uuid4()), client=client, subject=user, scope=["openid", "profile"],