diff options
author | troyready <troy@troyready.com> | 2021-03-02 18:12:29 -0800 |
---|---|---|
committer | troyready <troy@troyready.com> | 2021-03-12 10:39:15 -0800 |
commit | 9251b6c8cfaa5db738212c467c79f8c3aceb5b7d (patch) | |
tree | df80a61cdff011b14c987736833dbae96720ab44 /pkg/api/server | |
parent | fc02d16e728dfdd5a5f2e3bc622bbceb7f8c0d24 (diff) | |
download | podman-9251b6c8cfaa5db738212c467c79f8c3aceb5b7d.tar.gz podman-9251b6c8cfaa5db738212c467c79f8c3aceb5b7d.tar.bz2 podman-9251b6c8cfaa5db738212c467c79f8c3aceb5b7d.zip |
add /auth for docker compatibility
This endpoint just validates credentials:
https://github.com/moby/moby/blob/v20.10.4/api/swagger.yaml#L7936-L7977
Fixes: #9564
Signed-off-by: troyready <troy@troyready.com>
Diffstat (limited to 'pkg/api/server')
-rw-r--r-- | pkg/api/server/register_auth.go | 24 | ||||
-rw-r--r-- | pkg/api/server/swagger.go | 9 |
2 files changed, 31 insertions, 2 deletions
diff --git a/pkg/api/server/register_auth.go b/pkg/api/server/register_auth.go index 1e5474462..56e115e30 100644 --- a/pkg/api/server/register_auth.go +++ b/pkg/api/server/register_auth.go @@ -1,13 +1,33 @@ package server import ( + "net/http" + "github.com/containers/podman/v3/pkg/api/handlers/compat" "github.com/gorilla/mux" ) func (s *APIServer) registerAuthHandlers(r *mux.Router) error { - r.Handle(VersionedPath("/auth"), s.APIHandler(compat.UnsupportedHandler)) + // swagger:operation POST /auth compat auth + // --- + // summary: Check auth configuration + // tags: + // - system (compat) + // produces: + // - application/json + // parameters: + // - in: body + // name: authConfig + // description: Authentication to check + // schema: + // $ref: "#/definitions/AuthConfig" + // responses: + // 200: + // $ref: "#/responses/SystemAuthResponse" + // 500: + // $ref: "#/responses/InternalError" + r.Handle(VersionedPath("/auth"), s.APIHandler(compat.Auth)).Methods(http.MethodPost) // Added non version path to URI to support docker non versioned paths - r.Handle("/auth", s.APIHandler(compat.UnsupportedHandler)) + r.Handle("/auth", s.APIHandler(compat.Auth)).Methods(http.MethodPost) return nil } diff --git a/pkg/api/server/swagger.go b/pkg/api/server/swagger.go index 92efb8ef3..12fd083bb 100644 --- a/pkg/api/server/swagger.go +++ b/pkg/api/server/swagger.go @@ -226,3 +226,12 @@ type swagSystemPruneReport struct { entities.SystemPruneReport } } + +// Auth response +// swagger:response SystemAuthResponse +type swagSystemAuthResponse struct { + // in:body + Body struct { + entities.AuthReport + } +} |