Merge pull request #51334 from thaJeztah/rename_auth

api/types/registry: rename AuthenticateOKBody to AuthResponse
This commit is contained in:
Paweł Gronowski
2025-10-29 23:51:39 +01:00
committed by GitHub
10 changed files with 87 additions and 79 deletions

View File

@@ -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:

View File

@@ -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:

View 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"`
}

View File

@@ -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"`
}

View File

@@ -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
}

View File

@@ -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, &registry.AuthenticateOKBody{
return httputils.WriteJSON(w, http.StatusOK, &registry.AuthResponse{
Status: "Login Succeeded",
IdentityToken: token,
})

View File

@@ -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

View 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"`
}

View File

@@ -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"`
}

View File

@@ -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
}