Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FW][FIX] auth_ldap: LDAP login fails if it creates a new user. #163645

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Apr 26, 2024

Steps:

  • Set up LDAP authentication with Create User enabled and a Template User set
  • Log in with an LDAP identity that doesn't have an account yet

Get

odoo.exceptions.MissingError: Record does not exist or has been deleted

See #41060


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Forward-Port-Of: #162456

@robodoo
Copy link
Contributor

robodoo commented Apr 26, 2024

@fw-bot
Copy link
Contributor Author

fw-bot commented Apr 26, 2024

This PR targets saas-17.1 and is part of the forward-port chain. Further PRs will be created up to master.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Apr 26, 2024
@C3POdoo C3POdoo added the RD research & development, internal work label Apr 26, 2024
@fw-bot fw-bot force-pushed the saas-17.1-16.0-fix-ldap-create-user-fzd7-fw branch from dc18f91 to 9ca7d75 Compare May 2, 2024 09:28
@C3POdoo C3POdoo requested review from a team, HydrionBurst, ryv-odoo and Julien00859 and removed request for a team May 2, 2024 09:31
@fw-bot fw-bot force-pushed the saas-17.1-16.0-fix-ldap-create-user-fzd7-fw branch from 9ca7d75 to bc63293 Compare May 2, 2024 11:04
eLBati and others added 3 commits May 2, 2024 13:19
Steps:

 - Set up LDAP authentication with Create User enabled and a Template User set
 - Log in with an LDAP identity that doesn't have an account yet

Get

odoo.exceptions.MissingError: Record does not exist or has been deleted

See odoo#41060

X-original-commit: 524ab56
This commit adds a test to the auth_ldap module to verify the user registration functionality.
The test ensures that users can be successfully registered through LDAP authentication.

task-3879911

X-original-commit: 3812822
While running the test tagged as `database_breaking:TestAuthLDAP.test_auth_ldap`,
we need to send a HTTP request in order to retrieve a CSRF token to be
able to authenticate our mock user.

This request creates a new thread that attempts to establish a registry.
However, a deadlock occurs due to an RLock already held by the main test
thread on the Registry class. This lock prevents the new thread from
acquiring it, causing the test to hang. This lock was introduced in
master in PR odoo#161438, that PR is ultimately going to be backport in
saas-16.3.

Mocking the lock while setting up the test should resolve this issue
(similar behavior as HttpCase/enter_test_mode is doing).

X-original-commit: b32fe5e
@fw-bot fw-bot force-pushed the saas-17.1-16.0-fix-ldap-create-user-fzd7-fw branch from bc63293 to 95782e4 Compare May 2, 2024 11:19
@robodoo
Copy link
Contributor

robodoo commented May 2, 2024

@Julien00859 you may want to rebuild or fix this PR as it has failed CI.

robodoo pushed a commit that referenced this pull request May 2, 2024
Steps:

 - Set up LDAP authentication with Create User enabled and a Template User set
 - Log in with an LDAP identity that doesn't have an account yet

Get

odoo.exceptions.MissingError: Record does not exist or has been deleted

See #41060

X-original-commit: 524ab56
Part-of: #163645
robodoo pushed a commit that referenced this pull request May 2, 2024
This commit adds a test to the auth_ldap module to verify the user registration functionality.
The test ensures that users can be successfully registered through LDAP authentication.

task-3879911

X-original-commit: 3812822
Part-of: #163645
robodoo pushed a commit that referenced this pull request May 2, 2024
While running the test tagged as `database_breaking:TestAuthLDAP.test_auth_ldap`,
we need to send a HTTP request in order to retrieve a CSRF token to be
able to authenticate our mock user.

This request creates a new thread that attempts to establish a registry.
However, a deadlock occurs due to an RLock already held by the main test
thread on the Registry class. This lock prevents the new thread from
acquiring it, causing the test to hang. This lock was introduced in
master in PR #161438, that PR is ultimately going to be backport in
saas-16.3.

Mocking the lock while setting up the test should resolve this issue
(similar behavior as HttpCase/enter_test_mode is doing).

closes #163645

X-original-commit: b32fe5e
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
robodoo pushed a commit that referenced this pull request May 2, 2024
Steps:

 - Set up LDAP authentication with Create User enabled and a Template User set
 - Log in with an LDAP identity that doesn't have an account yet

Get

odoo.exceptions.MissingError: Record does not exist or has been deleted

See #41060

X-original-commit: 524ab56
Part-of: #163645
robodoo pushed a commit that referenced this pull request May 2, 2024
This commit adds a test to the auth_ldap module to verify the user registration functionality.
The test ensures that users can be successfully registered through LDAP authentication.

task-3879911

X-original-commit: 3812822
Part-of: #163645
robodoo pushed a commit that referenced this pull request May 2, 2024
While running the test tagged as `database_breaking:TestAuthLDAP.test_auth_ldap`,
we need to send a HTTP request in order to retrieve a CSRF token to be
able to authenticate our mock user.

This request creates a new thread that attempts to establish a registry.
However, a deadlock occurs due to an RLock already held by the main test
thread on the Registry class. This lock prevents the new thread from
acquiring it, causing the test to hang. This lock was introduced in
master in PR #161438, that PR is ultimately going to be backport in
saas-16.3.

Mocking the lock while setting up the test should resolve this issue
(similar behavior as HttpCase/enter_test_mode is doing).

closes #163645

X-original-commit: b32fe5e
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forwardport This PR was created by @fw-bot RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants