Repository navigation
feat: private repositories visible only to creators, managers and administrators - #13
Merged
Merged
Conversation
…inistrators public_read=false now hides a repository from everyone except its creator, its managers, site administrators signed in on the website and the deployment credential. Personal API keys read as their owner, an administrator's included. Hidden repositories answer like unregistered names, statistics keep only visible registered names, an administrator's key prepares only repositories it can see, and a taken registration name returns its registrant so the caller can ask to be added as a manager. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Background
public_read=falseonly hid a repository from anonymous callers. Every signed-in user and every personal API key (website, HTTP and MCP) could still list, search and read it, so there was no way to keep a repository private.This change implements private repositories (
public_read=false):Repositories registered before
public_readexisted stay public.Changes
internal/identity:ReadsAllRepositories— administrator sessions, the deployment credential and background work without a request identity are not narrowed.internal/service/visibility.go: onevisiblerule;RepoandCatalogfilter by caller, shared by the website, HTTP and MCP. Hidden repositories answer the same404 REPOSITORY_NOT_FOUND("Repository is not registered.") as unregistered names._overflow; unregistered, deleted and hidden names are all omitted, so a guessed name cannot be probed.prepare_access.go: an administrator's personal key prepares only repositories it can see.409 REPOSITORY_EXISTS, now with the registrant increator(id/name/email/department); the website asks the user to contact them to be added as a manager, or a site administrator when no registrant is recorded.docs/interfaces.md.Risks
public_read=falsethat signed-in users could read before become invisible to anyone who is not their creator, a manager or an administrator. Add those users as managers or make the repository public.Backward compatibility
409 REPOSITORY_EXISTSgains an optionalcreator.Testing
bun run check,go test ./... -count=1andbun run buildpass.internal/service/visibility_test.go: catalog and lookup for ten kinds of caller, administrator-key prepare, the statistics allow-list including a guessed name.internal/httpserver/private_repository_test.go: real personal keys end to end over the website, HTTP and MCP for every row above; search/read/list/diff/resolve/plugins/commits/prepare answer hidden callers exactly like an unregistered name; a taken name returns 409 with its registrant.🤖 Generated with Claude Code