You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
forgejo/routers
merlleu a587d25261
Add auth-required to config.json for Cargo http registry (#26729)
Cargo registry-auth feature requires config.json to have a property
auth-required set to true in order to send token to all registry
requests.
This is ok for git index because you can manually edit the config.json
file to add the auth-required, but when using sparse
(setting index url to
"sparse+https://git.example.com/api/packages/{owner}/cargo/"), the
config.json is dynamically rendered, and does not reflect changes to the
config.json file in the repo.

I see two approaches:
- Serve the real config.json file when fetching the config.json on the
cargo service.
- Automatically detect if the registry requires authorization. (This is
what I implemented in this PR).

What the PR does:
- When a cargo index repository is created, on the config.json, set
auth-required to wether or not the repository is private.
- When the cargo/config.json endpoint is called, set auth-required to
wether or not the request was authorized using an API token.
10 months ago
..
api Add auth-required to config.json for Cargo http registry (#26729) 10 months ago
common Start using template context function (#26254) 11 months ago
install Use docs.gitea.com instead of docs.gitea.io (#26739) 10 months ago
private Add context parameter to some database functions (#26055) 12 months ago
utils Implement FSFE REUSE for golang files (#21840) 2 years ago
web Use docs.gitea.com instead of docs.gitea.io (#26739) 10 months ago
init.go Pre-register OAuth2 applications for git credential helpers (#26291) 11 months ago