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.
gitea/services
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.
2 years ago
..
actions chore(actions): support cron schedule task (#26655) 2 years ago
agit Add context parameter to some database functions (#26055) 2 years ago
asymkey Add context cache as a request level cache (#22294) 2 years ago
attachment Preserve file size when creating attachments (#23406) 2 years ago
auth Use `object-fit: contain` for oauth2 custom icons (#26493) 2 years ago
automerge Improve queue and logger context (#24924) 2 years ago
context Replace `interface{}` with `any` (#25686) 2 years ago
convert add Upload URL to release API (#26663) 2 years ago
cron chore(actions): support cron schedule task (#26655) 2 years ago
externalaccount Replace `interface{}` with `any` (#25686) 2 years ago
forms Allow to archive labels (#26478) 2 years ago
gitdiff Fix stderr usages (#26477) 2 years ago
issue Add transaction when creating pull request created dirty data (#26259) 2 years ago
lfs Bump github.com/golang-jwt/jwt to v5 (#25975) 2 years ago
mailer Replace `interface{}` with `any` (#25686) 2 years ago
markup Make web context initialize correctly for different cases (#26726) 2 years ago
migrations Add context parameter to some database functions (#26055) 2 years ago
mirror Move `modules/mirror` to `services` (#26737) 2 years ago
org Refactor rename user and rename organization (#24052) 2 years ago
packages Add auth-required to config.json for Cargo http registry (#26729) 2 years ago
pull Fix bug for ctx usage (#26762) 2 years ago
release Less naked returns (#25713) 2 years ago
repository Add link to job details and tooltip to commit status in repo list in dashboard (#26326) 2 years ago
task Add `Retry` button when creating a mirror-repo fails (#26228) 2 years ago
user add unit test for user renaming (#26261) 2 years ago
webhook Modify the content format of the Feishu webhook (#25106) 2 years ago
wiki Introduce ctx.PathParamRaw to avoid incorrect unescaping (#26392) 2 years ago