File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -603,7 +603,10 @@ func ContainerRoutes() *web.Route {
603603 })
604604
605605 r .Get ("" , container .ReqContainerAccess , container .DetermineSupport )
606- r .Get ("/token" , container .Authenticate )
606+ r .Group ("/token" , func () {
607+ r .Get ("" , container .Authenticate )
608+ r .Post ("" , container .AuthenticateNotImplemented )
609+ })
607610 r .Get ("/_catalog" , container .ReqContainerAccess , container .GetRepositoryList )
608611 r .Group ("/{username}" , func () {
609612 r .Group ("/{image}" , func () {
Original file line number Diff line number Diff line change @@ -156,6 +156,17 @@ func Authenticate(ctx *context.Context) {
156156 })
157157}
158158
159+ // https://distribution.github.io/distribution/spec/auth/oauth/
160+ func AuthenticateNotImplemented (ctx * context.Context ) {
161+ // This optional endpoint can be used to authenticate a client.
162+ // It must implement the specification described in:
163+ // https://datatracker.ietf.org/doc/html/rfc6749
164+ // https://distribution.github.io/distribution/spec/auth/oauth/
165+ // Purpose of this stub is to respond with 404 Not Found instead of 405 Method Not Allowed.
166+
167+ ctx .Status (http .StatusNotFound )
168+ }
169+
159170// https://docs.docker.com/registry/spec/api/#listing-repositories
160171func GetRepositoryList (ctx * context.Context ) {
161172 n := ctx .FormInt ("n" )
You can’t perform that action at this time.
0 commit comments