harbor/src/server
Daniel Jiang 08f9ffa000 Reenable token auth for cli
Docker CLI fails if it's not logged in upon seeing "basic" realm challenging while pinging the "/v2" endpoint. (#11266)
Some CLI will send HEAD to artifact endpoint before pushing (#11188)(#11271)

To fix such problems, this commit re-introduce the token auth flow to the CLIs.

For a HEAD request to "/v2/xxx" with no "Authoirzation" header, the v2_auth middleware populates the
"Www-Authenticate" header to redirect it to token endpoint with proper
requested scope.

It also adds security context to based on the content of the JWT which has the claims of the registry.
So a request from CLI carrying a token signed by the "/service/token" will have proper permissions.

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2020-04-04 00:05:58 +08:00
..
error move logger from common to lib 2020-04-02 14:09:03 +08:00
middleware Reenable token auth for cli 2020-04-04 00:05:58 +08:00
registry move logger from common to lib 2020-04-02 14:09:03 +08:00
router fix Conformance testing failure 2020-03-09 10:29:10 +08:00
v2.0 move logger from common to lib 2020-04-02 14:09:03 +08:00
route.go Rever chart version to original 2020-04-01 11:55:22 +08:00
server.go Bump up the version of legacy APIs to v2.0 2020-02-14 13:16:30 +08:00