test(BA-4985): add component tests for auth security management#9873
Merged
Conversation
jopemachine
added a commit
that referenced
this pull request
Mar 11, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jopemachine
added a commit
that referenced
this pull request
Mar 11, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jopemachine
added a commit
that referenced
this pull request
Mar 11, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR consolidates previously split auth component tests into a single tests/component/auth/test_auth.py, expanding coverage for auth verification, role/scope access control, password management (including expiry), SSH keypair operations, signup, and cross-domain access rules.
Changes:
- Merged and reorganized auth component tests into one file with shared helper dataclasses/fixtures.
- Added new fixtures to create expired-password users and a second (“cross”) domain for access-control scenarios.
- Expanded test coverage across authorize, password-change/expiry flows, SSH keypair CRUD-like behavior, signup, and cross-domain restrictions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
tests/component/auth/test_auth.py |
Consolidates and expands auth component tests; adds fixtures for expired-password and cross-domain scenarios. |
changes/9873.test.md |
Adds a changelog entry for the new/updated component tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Superadmins have global privileges that extend across domain boundaries, so they should not be required to be a member of a group to query its role. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Split the test into two: superadmin now succeeds (global access), while regular user still gets NotFoundError for nonexistent groups. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
HyeockJinKim
approved these changes
Mar 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #9843 (BA-4985)
Summary
Merge auth component tests into a single
tests/component/auth/test_auth.py, covering verify-auth, role/scope control, authorize, full-name update, password management (including expiry), SSH keypair operations, signup, and cross-domain access enforcement.Previously split across
test_auth.py(basic) andtest_auth_security.py(extended), now consolidated with duplicate tests removed and additional coverage added.Target test file:
tests/component/auth/test_auth.pyTestVerifyAuthTestRoleAndScopeAccessTestAuthorizeTestUpdateFullNameTestPasswordChangeTestPasswordExpiryTestSSHKeypairTestSignupTestCrossDomainAccessTotal: 31 tests
Key improvements over original PR
test_auth.pyandtest_auth_security.pyinto a single file (eliminated duplicate tests)pytest.raises(Exception)with specific exception types (NotFoundError)try/finallyconfig restoration withmonkeypatch.setattrinTestPasswordExpiryrsa_keypairfixture_(e.g.,_ExpiredPasswordUserData,_CrossDomainFixtureData)Test plan
pants lintpassespants checkpassespants testpasses🤖 Generated with Claude Code