Repository navigation
docs: clarify admin-only access and update repo browser tests - #3240
Closed
dosubot[bot] wants to merge 2 commits into
Closed
dosubot[bot] wants to merge 2 commits into
dosubot[bot] wants to merge 2 commits into
Conversation
Contributor
🧯 Dangerous deletes guard reportPolicy: see .cursorrules — dangerous deletions are blocked unless wrapped safely. Summary:
Flagged findings (file:line:snippet): Excluded matches (by path pattern) |
Contributor
Reviewer's GuideThis PR clarifies that the multi-repo browser is admin-only, updates the multi-repo implementation guide and pytest examples accordingly, and adds/adjusts tests and security documentation around admin gating and 403/admin_only behavior for /repo/* routes. Sequence diagram for admin-only gating of /repo/api/select-reposequenceDiagram
actor User
participant repo_bp
participant _require_admin_for_repo_browser
participant is_admin
participant RepoApi
User->>repo_bp: POST /repo/api/select-repo
repo_bp->>_require_admin_for_repo_browser: before_request
_require_admin_for_repo_browser->>is_admin: is_admin(user_id from session)
alt [user is admin]
_require_admin_for_repo_browser-->>repo_bp: allow
repo_bp->>RepoApi: POST /repo/api/select-repo
RepoApi-->>User: 200 JSON success
else [user is not admin]
_require_admin_for_repo_browser-->>User: 403 JSON {success:false, error: admin_only}
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
⏱️ Performance report(No performance test durations collected. Mark tests with |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Update documentation for #3239
The guide now explicitly notes that all manual and automated checks for the multi-repo browser require an admin session, since non-admins are blocked. It updates the pytest setup to set
session['user_id']toADMIN_USER_ID, adjusts test expectations to admin-only behavior, and adds a new test verifying non-admin users receive a 403 withadmin_onlyfor/repo/api/select-repo. The security section is expanded to document how/repo/*routes are protected via the blueprintbefore_requestand_require_admin_for_repo_browser(), including the specific JSON/abort responses and the PR #3239 metadata exposure fix for/repo/api/repos.Generated by Dosu
Summary by Sourcery
Document and validate administrator-only access across the multi-repository code browser.
Enhancements:
Documentation:
Tests: