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 {
603
603
})
604
604
605
605
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
+ })
607
610
r .Get ("/_catalog" , container .ReqContainerAccess , container .GetRepositoryList )
608
611
r .Group ("/{username}" , func () {
609
612
r .Group ("/{image}" , func () {
Original file line number Diff line number Diff line change @@ -156,6 +156,17 @@ func Authenticate(ctx *context.Context) {
156
156
})
157
157
}
158
158
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
+
159
170
// https://docs.docker.com/registry/spec/api/#listing-repositories
160
171
func GetRepositoryList (ctx * context.Context ) {
161
172
n := ctx .FormInt ("n" )
You can’t perform that action at this time.
0 commit comments