Repository navigation
Feat/provider token auth - #56
Open
cedric-appdirect wants to merge 7 commits into
Open
cedric-appdirect wants to merge 7 commits into
cedric-appdirect wants to merge 7 commits into
Conversation
Model client auth as an `Auth` value outside server.rs, so additional client-auth modes can live beside the shared-secret one. Assisted-by: Cursor:glm-5.3
Auth then checks exactly the repo that is served. Pushes and dumb-http info/refs are now refused before auth, so they get 403 or 400, not 401. Assisted-by: Cursor:glm-5.3
A shared serve token exposes every repo the upstream credential can read. The github and gitlab providers check each request's own credential for its repo through upstream's info/refs, which only answers a credential that can clone. LFS object GETs are refused in these modes for now. Assisted-by: Cursor:glm-5.3
Provider modes check the batch request against upstream, then hand out an HMAC grant bound to repo, oid, and size, so object GETs stay local and cannot reach another repo's objects in the shared cache. Assisted-by: Cursor:glm-5.3
For upstreams whose git endpoint cannot answer the check, `custom` asks any HTTP endpoint, with the token header and repo encoding it wants. Assisted-by: Cursor:glm-5.3
Assisted-by: Cursor:glm-5.3
Assisted-by: Cursor:glm-5.3
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #56 +/- ##
==========================================
+ Coverage 96.97% 97.76% +0.78%
==========================================
Files 6 9 +3
Lines 2218 3129 +911
==========================================
+ Hits 2151 3059 +908
- Misses 67 70 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
What kind of change does this PR introduce?
Summary
This add support for checking access against github/gitlab/... for each git request. This is implementing the feature request from #40 .
Tests
Checklist
cargo fmt --all --check,cargo clippy --all-targets --all-features --locked -- -D warnings,cargo test --all-featuresAssisted-by:trailer (see CONTRIBUTING.md / AGENTS.md)Breaking change?
This should not be introducing any breaking change and it is an opt-in feature.