refactor(server): migrated all routes to new auth system

This commit is contained in:
Jef Roosens 2022-09-04 19:36:08 +02:00
parent 4887af26d3
commit 272f14b264
Signed by untrusted user: Jef Roosens
GPG key ID: B75D4F293C7052DB
6 changed files with 13 additions and 78 deletions

View file

@ -49,12 +49,8 @@ fn (mut app App) get_repo_file(repo string, arch string, filename string) web.Re
}
// put_package handles publishing a package to a repository.
['/:repo/publish'; post]
['/:repo/publish'; auth; post]
fn (mut app App) put_package(repo string) web.Result {
if !app.is_authorized() {
return app.json(http.Status.unauthorized, new_response('Unauthorized.'))
}
mut pkg_path := ''
if length := app.req.header.get(.content_length) {