mirror of
https://github.com/docker/cli.git
synced 2026-09-24 07:25:07 -05:00
generate AuthResponse type from swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com> Upstream-commit: 2732b8a9bb3edb92121d0b0dcc144e5f557e2fbf Component: engine
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/events"
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
"github.com/docker/docker/api/types/registry"
|
||||
timetypes "github.com/docker/docker/api/types/time"
|
||||
"github.com/docker/docker/api/types/versions"
|
||||
"github.com/docker/docker/pkg/ioutils"
|
||||
@@ -154,7 +155,7 @@ func (s *systemRouter) postAuth(ctx context.Context, w http.ResponseWriter, r *h
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return httputils.WriteJSON(w, http.StatusOK, &types.AuthResponse{
|
||||
return httputils.WriteJSON(w, http.StatusOK, ®istry.AuthenticateOKBody{
|
||||
Status: status,
|
||||
IdentityToken: token,
|
||||
})
|
||||
|
||||
@@ -4612,23 +4612,24 @@ paths:
|
||||
post:
|
||||
summary: "Check auth configuration"
|
||||
description: "Validate credentials for a registry and, if available, get an identity token for accessing the registry without password."
|
||||
operationId: "checkAuthentication"
|
||||
consumes:
|
||||
- "application/json"
|
||||
produces:
|
||||
- "application/json"
|
||||
operationId: "Authenticate"
|
||||
consumes: ["application/json"]
|
||||
produces: ["application/json"]
|
||||
responses:
|
||||
200:
|
||||
description: "No error"
|
||||
description: "An identity token was generated successfully."
|
||||
schema:
|
||||
type: "object"
|
||||
required: [Status]
|
||||
properties:
|
||||
Status:
|
||||
description: "The status of the authentication"
|
||||
type: "string"
|
||||
x-nullable: false
|
||||
IdentityToken:
|
||||
description: "An opaque token used to authenticate a user after a successful login"
|
||||
type: "string"
|
||||
x-nullable: false
|
||||
examples:
|
||||
application/json:
|
||||
Status: "Login Succeeded"
|
||||
@@ -4645,8 +4646,7 @@ paths:
|
||||
description: "Authentication to check"
|
||||
schema:
|
||||
$ref: "#/definitions/AuthConfig"
|
||||
tags:
|
||||
- "Misc"
|
||||
tags: ["Registry"]
|
||||
/info:
|
||||
get:
|
||||
summary: "Get system information"
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package registry
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// DO NOT EDIT THIS FILE
|
||||
// This file was generated by `swagger generate operation`
|
||||
//
|
||||
// See hack/swagger-gen.sh
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// AuthenticateOKBody authenticate o k body
|
||||
// swagger:model AuthenticateOKBody
|
||||
type AuthenticateOKBody struct {
|
||||
|
||||
// An opaque token used to authenticate a user after a successful login
|
||||
// Required: true
|
||||
IdentityToken string `json:"IdentityToken"`
|
||||
|
||||
// The status of the authentication
|
||||
// Required: true
|
||||
Status string `json:"Status"`
|
||||
}
|
||||
@@ -13,17 +13,6 @@ import (
|
||||
"github.com/docker/go-connections/nat"
|
||||
)
|
||||
|
||||
// AuthResponse contains response of Remote API:
|
||||
// POST "/auth"
|
||||
type AuthResponse struct {
|
||||
// Status is the authentication status
|
||||
Status string `json:"Status"`
|
||||
|
||||
// IdentityToken is an opaque token used for authenticating
|
||||
// a user after a successful login.
|
||||
IdentityToken string `json:"IdentityToken,omitempty"`
|
||||
}
|
||||
|
||||
// ContainerWaitResponse contains response of Remote API:
|
||||
// POST "/containers/"+containerID+"/wait"
|
||||
type ContainerWaitResponse struct {
|
||||
|
||||
Reference in New Issue
Block a user