identity: clarify blob format for v3/credentials

The current request/response examples show the credential blob as
a dict for type==ec2, which in incorrect, keystone expects it to
be a json serialized dict, also the description is incorrect, saying
"access_key" when it should be just "access".

These examples align the API docs with what the code actually does,
and also with these docs which say the blob is JSON serialized:
https://github.com/openstack/identity-api/blob/master/\
openstack-identity-api/v3/src/markdown/\
identity-api-v3.md#create-credential-post-credentials

Change-Id: Ieb7b7168f6c041b67a4f43742cb6a540971ff80e
Related-Bug: #1269637
This commit is contained in:
Steven Hardy
2014-01-16 16:16:58 +00:00
parent 9a433c6efe
commit 6520b7fb68
6 changed files with 25 additions and 34 deletions

View File

@@ -1,9 +1,7 @@
{
"blob": {
"access": "...",
"secret": "..."
},
"blob": '{"access": "--access-key--",
"secret": "--secret-key--"}',
"project_id": "--project-id--",
"type": "ec2",
"user_id": "--user--id--"
}
}

View File

@@ -1,8 +1,6 @@
{
"blob": {
"access": "...",
"secret": "..."
},
"blob": '{"access": "--access-key--",
"secret": "--secret-key--"}',
"id": "--credential-id--",
"links": {
"self": "http://identity:35357/v3/credentials/--credential-id--"
@@ -10,4 +8,4 @@
"project_id": "--project-id--",
"type": "ec2",
"user_id": "--user--id--"
}
}

View File

@@ -1,8 +1,6 @@
{
"blob": {
"access": "...",
"secret": "..."
},
"blob": '{"access": "--access-key--",
"secret": "--secret-key--"}',
"id": "--credential-id--",
"links": {
"self": "http://identity:35357/v3/credentials/--credential-id--"
@@ -10,4 +8,4 @@
"project_id": "--project-id--",
"type": "ec2",
"user_id": "--user--id--"
}
}

View File

@@ -1,8 +1,6 @@
{
"blob": {
"access": "...",
"secret": "..."
},
"blob": '{"access": "--access-key--",
"secret": "--secret-key--"}',
"id": "--credential-id--",
"links": {
"self": "http://identity:35357/v3/credentials/--credential-id--"
@@ -10,4 +8,4 @@
"project_id": "--project-id--",
"type": "ec2",
"user_id": "--user--id--"
}
}

View File

@@ -1,9 +1,8 @@
[
{
"blob": {
"access": "...",
"secret": "..."
},
"blob": '{"access": "--access-key--",
"secret": "--secret-key--"}',
"id": "--credential-id--",
"links": {
"self": "http://identity:35357/v3/credentials/--credential-id--"
@@ -13,10 +12,8 @@
"user_id": "--user--id--"
},
{
"blob": {
"access": "...",
"secret": "..."
},
"blob": '{"access": "--access-key--",
"secret": "--secret-key--"}',
"id": "--credential-id--",
"links": {
"self": "http://identity:35357/v3/credentials/--credential-id--"
@@ -25,4 +22,4 @@
"type": "ec2",
"user_id": "--user--id--"
}
]
]

View File

@@ -1643,11 +1643,13 @@
<wadl:doc xml:lang="EN" xmlns="http://docbook.org/ns/docbook"
title="Add Credential">
<para role="shortdesc">Adds a credential.</para>
<para>The following example shows creating an EC2 style
credential where the credentials are a combination of
access_key and secret. Other credentials, such as
access_key, can be supported simply by changing the
content of the key data.</para>
<para>The following example shows how to create an EC2-style
credential where the credential blob is a JSON-serialized
dictionary that contains <code>access</code> and
<code>secret</code>. This format is required when you specify
the <code>ec2</code> type. To specify other credentials, such
as <code>access_key</code>, simply change the type and
contents of the data blob.</para>
</wadl:doc>
<request>
<representation mediaType="application/json">