Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions types/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I'm late to this party, but I do feel that @calavera comment in moby/moby#20970 (comment) does seem to make sense. Do we need a new field if IdentityToken and Password are mutually exclusive? I wouldn't fight for it much if there's a nice benefit in doing it this way. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are mutually exclusive but either way a field would be required in order to differentiate the secret type. For storage of the auth config I think it is fine to combine the "secret" information into a single field which could be the focus of protection, but at this point in the code having a fully enumerated structure is in my opinion the better design.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aaronlehmann for clarifying for me: Password is sent with basic auth, but IdentityToken goes over Authorization: Bearer ..., so the client does need to know which one it is dealing with.


// RegistryToken is a bearer token to be sent to a registry
RegistryToken string `json:"registrytoken,omitempty"`
}
4 changes: 4 additions & 0 deletions types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down