diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-03-16 11:26:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-16 11:26:32 +0100 |
commit | d9f84692c13406f7e4e22d4bb16db4e8a7d086ab (patch) | |
tree | da6d920ab48dd4ca5a8da8302d13ec33b6cb5ecc /pkg/api/server | |
parent | 72ddf2fb96332ea70cb7fa126410ab6b6ed44941 (diff) | |
parent | 955aaccc55218cd0022a1180df4c15bb27674a8f (diff) | |
download | podman-d9f84692c13406f7e4e22d4bb16db4e8a7d086ab.tar.gz podman-d9f84692c13406f7e4e22d4bb16db4e8a7d086ab.tar.bz2 podman-d9f84692c13406f7e4e22d4bb16db4e8a7d086ab.zip |
Merge pull request #9589 from troyready/add_compat_auth_endpoint
add /auth for docker compatibility
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 + } +} |