Skip to content

WiP: extend support for UUID user ID as home dir#561

Draft
jonasbardino wants to merge 62 commits into
nextfrom
adjust/support-for-uuid-user-id-as-home-dir
Draft

WiP: extend support for UUID user ID as home dir#561
jonasbardino wants to merge 62 commits into
nextfrom
adjust/support-for-uuid-user-id-as-home-dir

Conversation

@jonasbardino

@jonasbardino jonasbardino commented May 28, 2026

Copy link
Copy Markdown
Contributor

Extend the existing skeleton to support using UUID as the name of the user home dir with just symlinks to the X509 form in order to ease updating any of the X509 fields without renaming entire user home.

First step is to add/extend unit test coverage of the relevant helpers to narrow down what works already and what is still missing. Therefore builds on top of #575, #576 and #580 , which were merged in the meantime. Further tests on top of stand-alone test suite extension PRs may follow.

We already identified and fixed some UUID issues based on those added unit tests so there should already be some progress.

Additional work is required if we also want e.g. the participation in VGrids to be independent of such X509 field updates.

@jonasbardino jonasbardino self-assigned this May 28, 2026
@jonasbardino jonasbardino added enhancement New feature or request WiP Work-in-Progress: any review requests do NOT mean it's ready for merge. labels May 28, 2026
jonasbardino added a commit that referenced this pull request May 29, 2026
…tantly

expected e.g. during useradm operations like edit_user, delete_user, etc. and
therefore difficult to do without when adding test coverage a.o. in #561.
Introduce two more common DNs used across tests: Other User and No Such User.
Polish a long comment with some typos and incomplete ending.
@jonasbardino

Copy link
Copy Markdown
Contributor Author

Hmmm, odd that one unit test consistently fails here while consistently succeeding when I run make distclean; make test locally. Perhaps some clean up missing and tests order being shuffled differently in the GH Action 🤔

jonasbardino added a commit that referenced this pull request Jun 9, 2026
…ion user helper (#563)

* Add a few more user state dirs made by actual user creation and importantly
expected e.g. during useradm operations like edit_user, delete_user, etc. and
therefore difficult to do without when adding test coverage a.o. in #561.
Introduce two more common DNs used across tests: Other User and No Such User.
Polish a long comment with some typos and incomplete ending.

* Add a couple of good points from review feedback (thanks @albu-diku) as
comments to get the PR wrapped up. Minor format-only changes from automatic
long-line wrap in editor.
@jonasbardino jonasbardino force-pushed the adjust/support-for-uuid-user-id-as-home-dir branch from 276d742 to bcb2dae Compare June 9, 2026 11:17
@jonasbardino

Copy link
Copy Markdown
Contributor Author

Hmmm, odd that one unit test consistently fails here while consistently succeeding when I run make distclean; make test locally. Perhaps some clean up missing and tests order being shuffled differently in the GH Action 🤔

Think I pinpointed the mentioned test failure to come from a different (by definition non-deterministic) order of entries in os.listdir and the lookup_client_id_from_uuid happening to return the short id link before the DN-dir link when running here, while yielding reverse order in my local runs. That would match the short id being returned instead of the expected DN and seems to be confirmed by the fact that the failure is gone after tightening the reverse lookup to skip anything but DN-dir links in 5e6faa3 .

@jonasbardino jonasbardino force-pushed the adjust/support-for-uuid-user-id-as-home-dir branch 3 times, most recently from 8e3cf0c to 9ce937a Compare June 12, 2026 07:57
@jonasbardino jonasbardino force-pushed the adjust/support-for-uuid-user-id-as-home-dir branch 2 times, most recently from c35ffa4 to 388cc27 Compare June 16, 2026 14:42
jonasbardino added a commit that referenced this pull request Jun 23, 2026
update_account_expire_cache and reset_account_expire_cache.
Simiplifi existing tests to rely more on before_each helper and constants.

Fix a bug in reset_account_expire_cache for specific client_id which wasn't
correctly translated from client_id to a client_dir style filemark.
…pire and

adjust test without start_time to be more robust against rounding issues.
…stants to

other existing tests for consistency.
…ectly

look up user X509 ID before checking account access. The default X509 user
format should remain functionally unchanged despite minor adjustments.

Extra care is needed while following the relative alias links from email, short
ID and X509 DN to the final UUID user home. Additionally we must be cautious
about the link traversal loop always terminating to avoid unpleasant surprises.
…D user ID

format cases. Also tests the recently adjusted check_account_accessible helper
thoroughly.
@jonasbardino jonasbardino force-pushed the adjust/support-for-uuid-user-id-as-home-dir branch from b77279c to 9c86f29 Compare June 23, 2026 13:57
jonasbardino added a commit that referenced this pull request Jun 24, 2026
…580)

* Implement fundamental unit test coverage of the `accountstate` module.
Fixes a corner-case bug in `reset_account_expire_cache` when called with a
specific `client_id` rather than the default (None) to reset all expire marks. 
NOTE: that form is not used anywhere else at the moment so it should be safe.

* Add tests for check_account_status .

* Add tests for check_account_accessible.

* Add tests for check_update_account_expire and sync back some constants to
other existing tests for consistency.

* Try to address review feedback by making the entangled asserts fail
independently even if the assertRaises does not kick in. The tested code is a
bit clunky to quietly patch incorrect use but this version should make the test
more consistent. Fixed a couple of similar issues with other tests using a
`with X` construct and not keeping variables aligned.
Simplified a few `self.configuration` uses where we already have aliased it as
`configuration`.

* Rework invalid expire test again into one for invalid types and one for invalid
values to avoid inconsistent handling and address further feedback.
The underlying function could really use more robust handling of such invalid
values but for now we just want to make sure that the tests closely cover the
existing behaviour in order to let the UUID version aim for complete
(bug-for-bug) compatibility as a start.

* Sync back some cosmetic changes from #561 branch and one additional test
using email alias.

* Reformat with make format-python.
… X509 and

a comment in conf that UUID format is still only experimental.
…d break

if both the UUID -> X509 link and say a leftover matching reverse X509 to UUID
link exist in the `user_id_alias_dir`.
Includes a regression test initially used to confirm its existence and assure
that it is now really fixed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request WiP Work-in-Progress: any review requests do NOT mean it's ready for merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant