Artifact 3c062ef41e77ca522ed66e2edf7b1fcec777b8d55737292d269c3fa37cc6d094:
- File
hub/hub.go
-
2026-05-04 20:53:37
— part of check-in
[a8e62ce82d]
on branch feat/130-hub-setusercaps
— feat(hub): SetUserCaps + Config.NobodyCaps for unauth-clone hubs
Adds Repo.SetUserCaps(login, caps) and a Hub delegate, wrapping libfossil's Repo.SetCaps. Lets consumers grant or change caps on existing users without leaving the hub package — primarily for the common bones case where the libfossil-pre-populated 'nobody' user needs 'gio' to allow unauthenticated clone/pull/push.
Also adds Config.NobodyCaps so the typical setup is one declarative field instead of a manual SetUserCaps call after every NewHub. NobodyCaps is applied at bootstrap by calling SetUserCaps("nobody", v) internally — no method-body duplication. Empty NobodyCaps leaves nobody at whatever libfossil set it to (idempotent re-open path preserves prior caps, doesn't overwrite).
Tests: - TestRepo_SetUserCaps_RoundTrip — set + read back - TestRepo_SetUserCaps_RejectsEmptyLogin - TestNewHub_NobodyCaps_AppliedAtBootstrap — Config field works - TestNewHub_NobodyCaps_Idempotent — re-running with same caps OK - TestNewHub_NobodyCaps_EmptyDoesNotOverwrite — empty doesn't reset
Closes #130 (user: [email protected], size: 7592) [annotate] [blame] [check-ins using]
-
2026-05-04 20:59:25
— part of check-in
[93ab4aa0e9]
on branch trunk
— feat(hub): SetUserCaps + Config.NobodyCaps for unauth-clone hubs (#135)
Adds Repo.SetUserCaps(login, caps) and a Hub delegate, wrapping libfossil's Repo.SetCaps. Lets consumers grant or change caps on existing users without leaving the hub package — primarily for the common bones case where the libfossil-pre-populated 'nobody' user needs 'gio' to allow unauthenticated clone/pull/push.
Also adds Config.NobodyCaps so the typical setup is one declarative field instead of a manual SetUserCaps call after every NewHub. NobodyCaps is applied at bootstrap by calling SetUserCaps("nobody", v) internally — no method-body duplication. Empty NobodyCaps leaves nobody at whatever libfossil set it to (idempotent re-open path preserves prior caps, doesn't overwrite).
Tests: - TestRepo_SetUserCaps_RoundTrip — set + read back - TestRepo_SetUserCaps_RejectsEmptyLogin - TestNewHub_NobodyCaps_AppliedAtBootstrap — Config field works - TestNewHub_NobodyCaps_Idempotent — re-running with same caps OK - TestNewHub_NobodyCaps_EmptyDoesNotOverwrite — empty doesn't reset
Closes #130 (user: [email protected], size: 7592) [annotate] [blame] [check-ins using]
-
2026-05-04 20:53:37
— part of check-in
[a8e62ce82d]
on branch feat/130-hub-setusercaps
— feat(hub): SetUserCaps + Config.NobodyCaps for unauth-clone hubs