mirror of
https://github.com/moby/moby.git
synced 2026-01-11 02:31:44 +00:00
api/types/registry: rename AuthenticateOKBody to AuthResponse
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -2073,6 +2073,23 @@ definitions:
|
||||
password: "xxxx"
|
||||
serveraddress: "https://index.docker.io/v1/"
|
||||
|
||||
AuthResponse:
|
||||
description: |
|
||||
An identity token was generated successfully.
|
||||
type: "object"
|
||||
required: [Status]
|
||||
properties:
|
||||
Status:
|
||||
description: "The status of the authentication"
|
||||
type: "string"
|
||||
example: "Login Succeeded"
|
||||
x-nullable: false
|
||||
IdentityToken:
|
||||
description: "An opaque token used to authenticate a user after a successful login"
|
||||
type: "string"
|
||||
example: "9cbaf023786cd7..."
|
||||
x-nullable: false
|
||||
|
||||
ProcessConfig:
|
||||
type: "object"
|
||||
properties:
|
||||
@@ -10023,22 +10040,7 @@ paths:
|
||||
200:
|
||||
description: "An identity token was generated successfully."
|
||||
schema:
|
||||
type: "object"
|
||||
title: "SystemAuthResponse"
|
||||
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"
|
||||
IdentityToken: "9cbaf023786cd7..."
|
||||
$ref: "#/definitions/AuthResponse"
|
||||
204:
|
||||
description: "No error"
|
||||
401:
|
||||
|
||||
@@ -2073,6 +2073,23 @@ definitions:
|
||||
password: "xxxx"
|
||||
serveraddress: "https://index.docker.io/v1/"
|
||||
|
||||
AuthResponse:
|
||||
description: |
|
||||
An identity token was generated successfully.
|
||||
type: "object"
|
||||
required: [Status]
|
||||
properties:
|
||||
Status:
|
||||
description: "The status of the authentication"
|
||||
type: "string"
|
||||
example: "Login Succeeded"
|
||||
x-nullable: false
|
||||
IdentityToken:
|
||||
description: "An opaque token used to authenticate a user after a successful login"
|
||||
type: "string"
|
||||
example: "9cbaf023786cd7..."
|
||||
x-nullable: false
|
||||
|
||||
ProcessConfig:
|
||||
type: "object"
|
||||
properties:
|
||||
@@ -10023,22 +10040,7 @@ paths:
|
||||
200:
|
||||
description: "An identity token was generated successfully."
|
||||
schema:
|
||||
type: "object"
|
||||
title: "SystemAuthResponse"
|
||||
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"
|
||||
IdentityToken: "9cbaf023786cd7..."
|
||||
$ref: "#/definitions/AuthResponse"
|
||||
204:
|
||||
description: "No error"
|
||||
401:
|
||||
|
||||
21
api/types/registry/auth_response.go
Normal file
21
api/types/registry/auth_response.go
Normal file
@@ -0,0 +1,21 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package registry
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
// AuthResponse An identity token was generated successfully.
|
||||
//
|
||||
// swagger:model AuthResponse
|
||||
type AuthResponse struct {
|
||||
|
||||
// An opaque token used to authenticate a user after a successful login
|
||||
// Example: 9cbaf023786cd7...
|
||||
IdentityToken string `json:"IdentityToken,omitempty"`
|
||||
|
||||
// The status of the authentication
|
||||
// Example: Login Succeeded
|
||||
// Required: true
|
||||
Status string `json:"Status"`
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package registry
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// DO NOT EDIT THIS FILE
|
||||
// This file was generated by `swagger generate operation`
|
||||
//
|
||||
// See hack/generate-swagger-api.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"`
|
||||
}
|
||||
@@ -18,7 +18,7 @@ type RegistryLoginOptions struct {
|
||||
|
||||
// RegistryLoginResult holds the result of a RegistryLogin query.
|
||||
type RegistryLoginResult struct {
|
||||
Auth registry.AuthenticateOKBody
|
||||
Auth registry.AuthResponse
|
||||
}
|
||||
|
||||
// RegistryLogin authenticates the docker server with a given docker registry.
|
||||
@@ -39,7 +39,7 @@ func (cli *Client) RegistryLogin(ctx context.Context, options RegistryLoginOptio
|
||||
return RegistryLoginResult{}, err
|
||||
}
|
||||
|
||||
var response registry.AuthenticateOKBody
|
||||
var response registry.AuthResponse
|
||||
err = json.NewDecoder(resp.Body).Decode(&response)
|
||||
return RegistryLoginResult{Auth: response}, err
|
||||
}
|
||||
|
||||
@@ -370,7 +370,7 @@ func (s *systemRouter) postAuth(ctx context.Context, w http.ResponseWriter, r *h
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return httputils.WriteJSON(w, http.StatusOK, ®istry.AuthenticateOKBody{
|
||||
return httputils.WriteJSON(w, http.StatusOK, ®istry.AuthResponse{
|
||||
Status: "Login Succeeded",
|
||||
IdentityToken: token,
|
||||
})
|
||||
|
||||
@@ -84,6 +84,10 @@ generate_model types/plugin <<- 'EOT'
|
||||
PluginMount
|
||||
EOT
|
||||
|
||||
generate_model types/registry <<- 'EOT'
|
||||
AuthResponse
|
||||
EOT
|
||||
|
||||
generate_model types/storage <<- 'EOT'
|
||||
DriverData
|
||||
RootFSStorage
|
||||
|
||||
21
vendor/github.com/moby/moby/api/types/registry/auth_response.go
generated
vendored
Normal file
21
vendor/github.com/moby/moby/api/types/registry/auth_response.go
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package registry
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
// AuthResponse An identity token was generated successfully.
|
||||
//
|
||||
// swagger:model AuthResponse
|
||||
type AuthResponse struct {
|
||||
|
||||
// An opaque token used to authenticate a user after a successful login
|
||||
// Example: 9cbaf023786cd7...
|
||||
IdentityToken string `json:"IdentityToken,omitempty"`
|
||||
|
||||
// The status of the authentication
|
||||
// Example: Login Succeeded
|
||||
// Required: true
|
||||
Status string `json:"Status"`
|
||||
}
|
||||
21
vendor/github.com/moby/moby/api/types/registry/authenticate.go
generated
vendored
21
vendor/github.com/moby/moby/api/types/registry/authenticate.go
generated
vendored
@@ -1,21 +0,0 @@
|
||||
package registry
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// DO NOT EDIT THIS FILE
|
||||
// This file was generated by `swagger generate operation`
|
||||
//
|
||||
// See hack/generate-swagger-api.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"`
|
||||
}
|
||||
4
vendor/github.com/moby/moby/client/login.go
generated
vendored
4
vendor/github.com/moby/moby/client/login.go
generated
vendored
@@ -18,7 +18,7 @@ type RegistryLoginOptions struct {
|
||||
|
||||
// RegistryLoginResult holds the result of a RegistryLogin query.
|
||||
type RegistryLoginResult struct {
|
||||
Auth registry.AuthenticateOKBody
|
||||
Auth registry.AuthResponse
|
||||
}
|
||||
|
||||
// RegistryLogin authenticates the docker server with a given docker registry.
|
||||
@@ -39,7 +39,7 @@ func (cli *Client) RegistryLogin(ctx context.Context, options RegistryLoginOptio
|
||||
return RegistryLoginResult{}, err
|
||||
}
|
||||
|
||||
var response registry.AuthenticateOKBody
|
||||
var response registry.AuthResponse
|
||||
err = json.NewDecoder(resp.Body).Decode(&response)
|
||||
return RegistryLoginResult{Auth: response}, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user