Skip to content

Commit 7a97e1c

Browse files
authored
Merge pull request moby#51334 from thaJeztah/rename_auth
api/types/registry: rename AuthenticateOKBody to AuthResponse
2 parents fc889b1 + 0eba298 commit 7a97e1c

File tree

10 files changed

+87
-79
lines changed

10 files changed

+87
-79
lines changed

api/docs/v1.52.yaml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2073,6 +2073,23 @@ definitions:
20732073
password: "xxxx"
20742074
serveraddress: "https://index.docker.io/v1/"
20752075

2076+
AuthResponse:
2077+
description: |
2078+
An identity token was generated successfully.
2079+
type: "object"
2080+
required: [Status]
2081+
properties:
2082+
Status:
2083+
description: "The status of the authentication"
2084+
type: "string"
2085+
example: "Login Succeeded"
2086+
x-nullable: false
2087+
IdentityToken:
2088+
description: "An opaque token used to authenticate a user after a successful login"
2089+
type: "string"
2090+
example: "9cbaf023786cd7..."
2091+
x-nullable: false
2092+
20762093
ProcessConfig:
20772094
type: "object"
20782095
properties:
@@ -10023,22 +10040,7 @@ paths:
1002310040
200:
1002410041
description: "An identity token was generated successfully."
1002510042
schema:
10026-
type: "object"
10027-
title: "SystemAuthResponse"
10028-
required: [Status]
10029-
properties:
10030-
Status:
10031-
description: "The status of the authentication"
10032-
type: "string"
10033-
x-nullable: false
10034-
IdentityToken:
10035-
description: "An opaque token used to authenticate a user after a successful login"
10036-
type: "string"
10037-
x-nullable: false
10038-
examples:
10039-
application/json:
10040-
Status: "Login Succeeded"
10041-
IdentityToken: "9cbaf023786cd7..."
10043+
$ref: "#/definitions/AuthResponse"
1004210044
204:
1004310045
description: "No error"
1004410046
401:

api/swagger.yaml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2073,6 +2073,23 @@ definitions:
20732073
password: "xxxx"
20742074
serveraddress: "https://index.docker.io/v1/"
20752075

2076+
AuthResponse:
2077+
description: |
2078+
An identity token was generated successfully.
2079+
type: "object"
2080+
required: [Status]
2081+
properties:
2082+
Status:
2083+
description: "The status of the authentication"
2084+
type: "string"
2085+
example: "Login Succeeded"
2086+
x-nullable: false
2087+
IdentityToken:
2088+
description: "An opaque token used to authenticate a user after a successful login"
2089+
type: "string"
2090+
example: "9cbaf023786cd7..."
2091+
x-nullable: false
2092+
20762093
ProcessConfig:
20772094
type: "object"
20782095
properties:
@@ -10023,22 +10040,7 @@ paths:
1002310040
200:
1002410041
description: "An identity token was generated successfully."
1002510042
schema:
10026-
type: "object"
10027-
title: "SystemAuthResponse"
10028-
required: [Status]
10029-
properties:
10030-
Status:
10031-
description: "The status of the authentication"
10032-
type: "string"
10033-
x-nullable: false
10034-
IdentityToken:
10035-
description: "An opaque token used to authenticate a user after a successful login"
10036-
type: "string"
10037-
x-nullable: false
10038-
examples:
10039-
application/json:
10040-
Status: "Login Succeeded"
10041-
IdentityToken: "9cbaf023786cd7..."
10043+
$ref: "#/definitions/AuthResponse"
1004210044
204:
1004310045
description: "No error"
1004410046
401:

api/types/registry/auth_response.go

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/types/registry/authenticate.go

Lines changed: 0 additions & 21 deletions
This file was deleted.

client/login.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type RegistryLoginOptions struct {
1818

1919
// RegistryLoginResult holds the result of a RegistryLogin query.
2020
type RegistryLoginResult struct {
21-
Auth registry.AuthenticateOKBody
21+
Auth registry.AuthResponse
2222
}
2323

2424
// RegistryLogin authenticates the docker server with a given docker registry.
@@ -39,7 +39,7 @@ func (cli *Client) RegistryLogin(ctx context.Context, options RegistryLoginOptio
3939
return RegistryLoginResult{}, err
4040
}
4141

42-
var response registry.AuthenticateOKBody
42+
var response registry.AuthResponse
4343
err = json.NewDecoder(resp.Body).Decode(&response)
4444
return RegistryLoginResult{Auth: response}, err
4545
}

daemon/server/router/system/system_routes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ func (s *systemRouter) postAuth(ctx context.Context, w http.ResponseWriter, r *h
370370
if err != nil {
371371
return err
372372
}
373-
return httputils.WriteJSON(w, http.StatusOK, &registry.AuthenticateOKBody{
373+
return httputils.WriteJSON(w, http.StatusOK, &registry.AuthResponse{
374374
Status: "Login Succeeded",
375375
IdentityToken: token,
376376
})

hack/generate-swagger-api.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ generate_model types/plugin <<- 'EOT'
8484
PluginMount
8585
EOT
8686

87+
generate_model types/registry <<- 'EOT'
88+
AuthResponse
89+
EOT
90+
8791
generate_model types/storage <<- 'EOT'
8892
DriverData
8993
RootFSStorage

vendor/github.com/moby/moby/api/types/registry/auth_response.go

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/moby/moby/api/types/registry/authenticate.go

Lines changed: 0 additions & 21 deletions
This file was deleted.

vendor/github.com/moby/moby/client/login.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)