From 7b3e5c8639c1328c78a47f9730eda26e4f8c508a Mon Sep 17 00:00:00 2001 From: Derek McGowan Date: Tue, 23 Feb 2016 15:50:09 -0800 Subject: [PATCH] Add support for getting token from login The auth response will return an identity token from a login when long lived token authentication is supported. The identity token can be used in the auth config in place of basic authentication to get registry access tokens. Signed-off-by: Derek McGowan (github: dmcgowan) --- types/auth.go | 6 ++++++ types/types.go | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/types/auth.go b/types/auth.go index 3a899d2a..f6bd4a83 100644 --- a/types/auth.go +++ b/types/auth.go @@ -7,5 +7,11 @@ type AuthConfig struct { Auth string `json:"auth,omitempty"` Email string `json:"email"` ServerAddress string `json:"serveraddress,omitempty"` + + // IdentityToken is used to authenticate the user and get + // an access token for the registry. + IdentityToken string `json:"identitytoken,omitempty"` + + // RegistryToken is a bearer token to be sent to a registry RegistryToken string `json:"registrytoken,omitempty"` } diff --git a/types/types.go b/types/types.go index 8f0e0b47..d5baf9ab 100644 --- a/types/types.go +++ b/types/types.go @@ -39,6 +39,10 @@ type ContainerUpdateResponse struct { 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: