Add support for identity tokens in client credentials store

Update unit test and documentation to handle the new case where Username
is set to <token> to indicate an identity token is involved.

Change the "Password" field in communications with the credential helper
to "Secret" to make clear it has a more generic purpose.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
This commit is contained in:
Aaron Lehmann 2016-03-04 12:00:18 -08:00 committed by Tibor Vass
parent 2168c53ee9
commit b2b5bc9937
1 changed files with 7 additions and 4 deletions

View File

@ -78,17 +78,20 @@ The helpers always use the first argument in the command to identify the action.
There are only three possible values for that argument: `store`, `get`, and `erase`. There are only three possible values for that argument: `store`, `get`, and `erase`.
The `store` command takes a JSON payload from the standard input. That payload carries The `store` command takes a JSON payload from the standard input. That payload carries
the server address, to identify the credential, the user name and the password. the server address, to identify the credential, the user name, and either a password
This is an example of that payload: or an identity token.
```json ```json
{ {
"ServerURL": "https://index.docker.io/v1", "ServerURL": "https://index.docker.io/v1",
"Username": "david", "Username": "david",
"Password": "passw0rd1" "Secret": "passw0rd1"
} }
``` ```
If the secret being stored is an identity token, the Username should be set to
`<token>`.
The `store` command can write error messages to `STDOUT` that the docker engine The `store` command can write error messages to `STDOUT` that the docker engine
will show if there was an issue. will show if there was an issue.
@ -102,7 +105,7 @@ and password from this payload:
```json ```json
{ {
"Username": "david", "Username": "david",
"Password": "passw0rd1" "Secret": "passw0rd1"
} }
``` ```