aboutsummaryrefslogtreecommitdiffstats
path: root/templates/projects/view.tmpl
diff options
context:
space:
mode:
authormerlleu <r.langdorph@gmail.com>2023-08-28 09:05:39 +0200
committerGitHub <noreply@github.com>2023-08-28 07:05:39 +0000
commita587d2526163153a4d992527fe6040d578beaa83 (patch)
tree85caf0651c47a7d32bb4ff5d37889aaf44f0df76 /templates/projects/view.tmpl
parent8cd46024fdcdaf04cd09be2c25db673e99b0a024 (diff)
downloadgitea-a587d2526163153a4d992527fe6040d578beaa83.tar.gz
gitea-a587d2526163153a4d992527fe6040d578beaa83.zip
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.
Diffstat (limited to 'templates/projects/view.tmpl')
0 files changed, 0 insertions, 0 deletions