Contract changes

Change-Id: Idc44eebb9e3312e8dddb93efc9fecff9a540f138
This commit is contained in:
Ziad Sawalha 2011-08-16 16:31:20 -05:00
parent 4f1f3d422b
commit 6af517348e
29 changed files with 244 additions and 116 deletions

View File

@ -2,17 +2,4 @@
<extensions xmlns="http://docs.openstack.org/common/api/v2.0"
xmlns:atom="http://www.w3.org/2005/Atom">
<extension
name="Rackspace" namespace="http://docs.rackspace.com/identity/api/ext/rpe/v1.0" alias="RS-KV2"
updated="2011-08-14T13:25:27-06:00">
<description>
Rackspace extensions to Keystone v2.0 API
emailed when the password has been reset.
</description>
<atom:link rel="describedby" type="application/pdf"
href="http://docs.rackspacecloud.com/identity/api/ext/ identity-rpe-20111111.pdf"/>
<atom:link rel="describedby" type="application/vnd.sun.wadl+xml"
href="http://docs.rackspacecloud.com/identity/api/ext/ identity-rpe.wadl"/>
</extension>
</extensions>

View File

@ -317,7 +317,11 @@
<method name="POST" id="authenticate">
<request>
<representation mediaType="application/xml" element="identity:passwordCredentials"/>
<representation mediaType="application/xml" element="identity:passwordCredentials">
<param name="passwordCredentials" style="plain" required="true"
type="identity:PasswordCredentialsWithoutUsername"
path="/identity:passwordCredentials"/>
</representation>
<representation mediaType="application/json"/>
</request>
<response status="200 203">

View File

@ -12,8 +12,8 @@
"internalURL": "https://compute.north.host/v1/blah-blah",
"region": "North",
"versionId": "1.0",
"versionInfo": "uri",
"versionList": "uri"
"versionInfo": "https://compute.north.host/v1.0/",
"versionList": "https://compute.north.host/"
}, {
"publicURL": "https://compute.north.host/v1.1/blah-blah",
"internalURL": "https://compute.north.host/v1.1/blah-blah",

View File

@ -0,0 +1,8 @@
{
"OS-EC2-ec2Credentials":{
"username":"test_user",
"secret": "aaaaa",
"signature": "bbb",
"tenantId":"77654"
}
}

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ec2Credentials
xmlns="http://docs.openstack.org/identity/api/ext/OS-EC2/v1.0"
username="testuser"
key="aaaaa"
signature="bbbbb"
tenantId="77654"/>

View File

@ -0,0 +1,7 @@
{
"RAX-KEY:apikeyCredentials":{
"username":"test_user",
"apikey": "aaaaa-bbbbb-ccccc-12345678",
"tenantId":"77654"
}
}

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<apikeyCredentials
xmlns="http://docs.rackspace.com/identity/api/ext/RAX-KEY/v1.0"
username="testuser"
apikey="aaaaa-bbbbb-ccccc-12345678"
tenantId="77654"/>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<passwordCredentials
xmlns="http://docs.openstack.org/identity/api/v2.0"
password="P@ssword1" username="testuser"
tenantId="77654"/>
username="testuser"
password="P@ssword1"
tenantId="77654"/>

View File

@ -1,6 +1,6 @@
{
"endpoint":{
"id":3,
"href":"https://auth.keystone.com/v2.0/baseURLs/1"
"href":"https://auth.keystone.com/v2.0/endpoints/3"
}
}

View File

@ -1,4 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<endpoint xmlns="http://docs.openstack.org/identity/api/v2.0"
id="3" />
id="3"
href="https://auth.keystone.com/v2.0/endpoints/3"
/>

View File

@ -1,11 +1,14 @@
{
"endpointTemplate":{
"id":1,
"region":"DFW",
"region":"North",
"global":true,
"serviceName":"service1",
"publicURL":"https://service-public.com/v1",
"internalURL":"https://service-internal.com/v1",
"type":"compute",
"publicURL":"https://compute.north.public.com/v1",
"internalURL":"https://compute.north.internal.com/v1",
"versionId": "1",
"versionInfo": "https://compute.north.public.com/v1/",
"versionList": "https://compute.north.public.com/"
"enabled":true
}
}

View File

@ -3,10 +3,15 @@
<endpointTemplate
xmlns="http://docs.openstack.org/identity/api/v2.0"
id="1"
region="DFW"
region="North"
global="true"
serviceName="service1"
type="compute"
publicURL="https://service-public.com/v1"
internalURL="https://service-internal.com/v1"
enabled="true"
/>
enabled="true">
<version
ID="1"
Info="https://compute.north.public.com/v1/"
List="https://compute.north.public.com/"
/>
</endpointTemplate>

View File

@ -2,41 +2,56 @@
"endpointsTemplates":[
{
"id":1,
"region":"DFW",
"region":"North",
"global":true,
"serviceName":"service1",
"publicURL":"https://service1.public.com/v1",
"internalURL":"https://service1.internal.com/v1",
"type":"compute",
"publicURL":"https://compute.north.public.com/v1",
"internalURL":"https://compute.north.internal.com/v1",
"versionId": "1",
"versionInfo": "https://compute.north.public.com/v1/",
"versionList": "https://compute.north.public.com/"
"enabled":true
},
{
"id":2,
"region":"ORD",
"serviceName":"service2",
"publicURL":"https://service2.public.com/v1",
"internalURL":"https://service2.internal.com/v1",
"region":"South",
"serviceName":"compute",
"publicURL":"https://compute.south.public.com/v1",
"internalURL":"https://compute.south.internal.com/v1",
"versionId": "1",
"versionInfo": "https://compute.south.public.com/v1/",
"versionList": "https://compute.south.public.com/"
"enabled":false
},
{
"id":3,
"region":"DFW",
"region":"North",
"global":true,
"serviceName":"service1",
"publicURL":"https://service.public.com/v1.0",
"serviceName":"object-store",
"publicURL":"https://object-store.north.public.com/v1.0",
"versionId": "1.0",
"versionInfo": "https://object-store.north.public.com/v1.0/",
"versionList": "https://object-store.north.public.com/"
"enabled":true
},
{
"id":4,
"region":"ORD",
"serviceName":"service2",
"publicURL":"https://service2.public.com/v2",
"region":"South",
"serviceName":"object-store",
"publicURL":"https://object-store.south.public.com/v2",
"versionId": "2",
"versionInfo": "https://object-store.south.public.com/v2/",
"versionList": "https://object-store.south.public.com/"
"enabled":true
},
{
"id":5,
"global":true,
"serviceName":"service3",
"publicURL":"https://service3.public.com/v3.2",
"serviceName":"OS-DNS:DNS",
"publicURL":"https://dns.public.com/v3.2",
"versionId": "1.0",
"versionInfo": "https://dns.public.com/v1.0/",
"versionList": "https://dns.public.com/"
"enabled":true
}
]

View File

@ -2,41 +2,61 @@
<endpointTemplates xmlns="http://docs.openstack.org/identity/api/v2.0">
<endpointTemplate
id="1"
region="DFW"
id="1"
region="North"
global="true"
serviceName="service1"
publicURL="https://service1.public.com/v1"
internalURL="https://service1.internal.clouddrive.com/v1"
enabled="true"
/>
serviceType="compute"
publicURL="https://compute.north.public.com/v1"
internalURL="https://compute.north.internal.com/v1"
enabled="true">
<version
ID="1"
List="https://compute.north.public.com/"
Info="https://compute.north.public.com/v1"/>
</endpointTemplate>
<endpointTemplate
id="2"
region="ORD"
serviceName="service2"
region="south"
serviceType="service2"
publicURL="https://service2.public.com/v1"
internalURL="https://service2.internal.public.com/v1"
enabled="false"
/>
enabled="false">
<version
ID="1"
List="https://service1.public.com/"
Info="https://service1.public.com/v1"/>
</endpointTemplate>
<endpointTemplate
id="3"
region="DFW"
global="true"
serviceName="service1"
serviceType="service1"
publicURL="https://service1.public.com/v1"
enabled="true"
/>
enabled="true">
<version
ID="1"
List="https://service1.public.com/"
Info="https://service1.public.com/v1"/>
</endpointTemplate>
<endpointTemplate
id="4"
region="ORD"
serviceName="service2"
serviceType="service2"
publicURL="https://service2.public.com/v1"
enabled="true"
/>
enabled="true">
<version
ID="1"
List="https://service1.public.com/"
Info="https://service1.public.com/v1"/>
</endpointTemplate>
<endpointTemplate
id="5"
global="true"
serviceName="service3"
publicURL="https://service3.public.com/v1"
/>
serviceType="service3"
publicURL="https://service3.public.com/v1">
<version
ID="1"
List="https://service1.public.com/"
Info="https://service1.public.com/v1"/>
</endpointTemplate>
</endpointTemplates>

View File

@ -2,23 +2,23 @@
"endpoints":[
{
"id":1,
"href":"https://auth.keystone.com/v2.0/baseURLs/1"
"href":"https://auth.keystone.com/v2.0/endpoints/1"
},
{
"id":2,
"href":"https://auth.keystone.com/v2.0/baseURLs/2"
"href":"https://auth.keystone.com/v2.0/endpoints/2"
},
{
"id":3,
"href":"https://auth.keystone.com/v2.0/baseURLs/3"
"href":"https://auth.keystone.com/v2.0/endpoints/3"
},
{
"id":4,
"href":"https://auth.keystone.com/v2.0/baseURLs/4"
"href":"https://auth.keystone.com/v2.0/endpoints/4"
},
{
"id":5,
"href":"https://auth.keystone.com/v2.0/baseURLs/5"
"href":"https://auth.keystone.com/v2.0/endpoints/5"
}
]
}

View File

@ -3,18 +3,18 @@
<endpoints
xmlns="http://docs.openstack.org/identity/api/v2.0">
<endpoint
href="https://auth.keystone.com/v2.0/baseURLs/1"
href="https://auth.keystone.com/v2.0/endpoints/1"
id="1" />
<endpoint
href="https://auth.keystone.com/v2.0/baseURLs/2"
href="https://auth.keystone.com/v2.0/endpoints/2"
id="2" />
<endpoint
href="https://auth.keystone.com/v2.0/baseURLs/3"
href="https://auth.keystone.com/v2.0/endpoints/3"
id="3" />
<endpoint
href="https://auth.keystone.com/v2.0/baseURLs/4"
href="https://auth.keystone.com/v2.0/endpoints/4"
id="4" />
<endpoint
href="https://auth.keystone.com/v2.0/baseURLs/5"
href="https://auth.keystone.com/v2.0/endpoints/5"
id="5" />
</endpoints>

View File

@ -13,6 +13,7 @@
<application xmlns="http://wadl.dev.java.net/2009/02"
xmlns:identity="http://docs.openstack.org/identity/api/v2.0"
xmlns:RAX-KEY="http://docs.rackspace.com/identity/api/ext/RAX-KEY/v1.0"
xmlns:capi="http://docs.openstack.org/common/api/v2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
@ -24,7 +25,7 @@
<grammars>
<include href="xsd/api.xsd"/>
<include href="xsd/api-common.xsd"/>
<include href="xsd/RS-KEY-credentials.xsd"/>
<include href="xsd/RAX-KEY-credentials.xsd"/>
</grammars>
@ -38,6 +39,11 @@
<resource id="tokens" path="tokens">
<method href="#authenticate"/>
</resource>
<resource id="extensions" type="#ExtensionList" path="extensions">
<resource id="extension" path="RAX-KEY">
<method href="#getExtension"/>
</resource>
</resource>
</resource>
</resources>
@ -49,7 +55,7 @@
<!-- Token Operations -->
<method name="POST" id="authenticate">
<request>
<representation mediaType="application/xml" element="identity:RS-KEY-apikeyCredentials"/>
<representation mediaType="application/xml" element="RAX-KEY:apikeyCredentials"/>
<representation mediaType="application/json"/>
</request>
<response status="200 203">
@ -63,5 +69,18 @@
&commonFaults;
&getFaults;
</method>
<method name="GET" id="getExtension">
<doc xml:lang="EN" title="Get Extension Details">
<p xmlns="http://www.w3.org/1999/xhtml">
Get details about the RAX-KEY extension.
</p>
</doc>
<response status="200 203">
<representation mediaType="application/xml" element="capi:extension"/>
<representation mediaType="application/json"/>
</response>
&commonFaults;
&getFaults;
</method>
</application>

View File

@ -12,14 +12,15 @@
]>
<application xmlns="http://wadl.dev.java.net/2009/02"
xmlns:identity="http://docs.openstack.org/identity/api/v2.0"
xmlns:capi="http://docs.openstack.org/common/api/v2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xsi:schemaLocation="http://docs.openstack.org/identity/api/v2.0 xsd/api.xsd
http://docs.openstack.org/common/api/v1.0 xsd/api-common.xsd
http://wadl.dev.java.net/2009/02 http://www.w3.org/Submission/wadl/wadl.xsd
">
xmlns:identity="http://docs.openstack.org/identity/api/v2.0"
xmlns:capi="http://docs.openstack.org/common/api/v2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:html="http://www.w3.org/1999/xhtml"
xsi:schemaLocation="http://docs.openstack.org/identity/api/v2.0 xsd/api.xsd
http://docs.openstack.org/common/api/v1.0 xsd/api-common.xsd
http://wadl.dev.java.net/2009/02 http://www.w3.org/Submission/wadl/wadl.xsd
">
<grammars>
<include href="xsd/api.xsd"/>
@ -121,6 +122,25 @@
<!-- Token Operations -->
<method name="POST" id="authenticate">
<doc>
Client authentication is provided via a ReST interface using the POST method,
with v2.0/tokens supplied as the path.
Additionally, a payload of credentials must be included in the body.
See <html:a href="xsd/credentials.xsd">supported credentials</html:a>
Each ReST request against the Keystone system requires the inclusion of a
specific authorization token HTTP x-header, defined as X-Auth-Token. Clients obtain
this token, along with the URL to other service APIs, by first authenticating against the
Keystone Service and supplying valid credentials.
The Keystone Service is a ReSTful web service. It is the entry point to all service APIs.
To access the Keystone Service, you must know URL of the Keystone service.
TenantID is optional and may be used to specify that a token should be returned that
has access to the resources of that particular tenant.
</doc>
<request>
<representation mediaType="application/xml" element="identity:passwordCredentials"/>
<representation mediaType="application/json"/>

View File

@ -6,21 +6,22 @@
attributeFormDefault="unqualified"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:identity="http://docs.openstack.org/identity/api/v2.0"
xmlns:RAX-GRP="http://docs.rackspace.com/identity/api/ext/RAX-GRP/v1.0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
xmlns:xsdxt="http://docs.rackspacecloud.com/xsd-ext/v1.0"
xmlns:atom="http://www.w3.org/2005/Atom"
targetNamespace="http://docs.openstack.org/identity/api/v2.0"
targetNamespace="http://docs.rackspace.com/identity/api/ext/RAX-GRP/v1.0"
>
<!--Include schema we are extending -->
<include schemaLocation="user.xsd"/>
<include schemaLocation="roles.xsd"/>
<include schemaLocation="token.xsd"/>
<import schemaLocation="user.xsd" namespace="http://docs.openstack.org/identity/api/v2.0"/>
<import schemaLocation="roles.xsd" namespace="http://docs.openstack.org/identity/api/v2.0"/>
<import schemaLocation="token.xsd" namespace="http://docs.openstack.org/identity/api/v2.0"/>
<!-- Elements -->
<!-- Complex Types -->
<complexType name="RAX-UserForAuthData">
<complexType name="UserForAuthData">
<complexContent>
<extension base="identity:UserForAuthenticateResponse">
<sequence>
@ -32,7 +33,7 @@
<complexType name="Groups">
<sequence>
<element name="group" type="identity:Group" maxOccurs="100"/>
<element name="group" type="RAX-GRP:Group" maxOccurs="100"/>
<any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
</sequence>
<anyAttribute namespace="##other" processContents="lax"/>

View File

@ -6,20 +6,22 @@
attributeFormDefault="unqualified"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:identity="http://docs.openstack.org/identity/api/v2.0"
xmlns:RAX-KEY="http://docs.rackspace.com/identity/api/ext/RAX-KEY/v1.0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
xmlns:xsdxt="http://docs.rackspacecloud.com/xsd-ext/v1.0"
xmlns:atom="http://www.w3.org/2005/Atom"
targetNamespace="http://docs.openstack.org/identity/api/v2.0"
targetNamespace="http://docs.rackspace.com/identity/api/ext/RAX-KEY/v1.0"
>
<!--Include schema we are extending -->
<include schemaLocation="credentials.xsd"/>
<!--Import schema we are extending -->
<import namespace="http://docs.openstack.org/identity/api/v2.0"
schemaLocation="credentials.xsd"/>
<!-- Elements -->
<element name="apikeyCredentials" type="identity:RS-KEY-apikeyCredentials"/>
<element name="apikeyCredentials" type="RAX-KEY:apikeyCredentials"/>
<!-- Complex Types -->
<complexType name="RS-KEY-apikeyCredentials">
<complexType name="apikeyCredentials">
<complexContent>
<extension base="identity:CredentialType">
<attribute name="APIKey" type="xsd:string" use="required" ></attribute>

View File

@ -20,7 +20,7 @@
schemaLocation="atom/atom.xsd" />
<!-- Elements -->
<element name="passwordCredentials" type="identity:PasswordCredentials"/>
<element name="passwordCredentials" type="identity:PasswordCredentialsBase"/>
<element name="credentials" type="identity:CredentialList" >
<annotation>
@ -43,20 +43,34 @@
<anyAttribute namespace="##other" processContents="lax"/>
</complexType>
<complexType name="PasswordCredentials">
<complexType name="PasswordCredentialsBase">
<complexContent>
<extension base="identity:CredentialType">
<sequence>
<any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
</sequence>
<attribute name="password" type="xsd:string" use="required" />
<attribute name="username" type="xsd:string" use="optional" />
<attribute name="password" type="xsd:string" use="required" />
<attribute name="tenantId" type="xsd:string" use="optional" />
<anyAttribute namespace="##other" processContents="lax"/>
</extension>
</complexContent>
</complexType>
<complexType name="PasswordCredentialsWithoutUsernameAndTenant">
<complexContent>
<restriction base="identity:PasswordCredentialsBase">
<attribute name="username" type="xsd:string" use="prohibited" />
<attribute name="password" type="xsd:string" use="required" />
<attribute name="tenantId" type="xsd:string" use="prohibited" />
</restriction>
</complexContent>
</complexType>
<complexType name="PasswordCredentialsRequiredUsername">
<complexContent>
<restriction base="identity:PasswordCredentialsBase">
<attribute name="username" type="xsd:string" use="required" />
</restriction>
</complexContent>
</complexType>
<complexType name="CredentialList">
<sequence>
<element name="credential" type="identity:Credential" minOccurs="0" maxOccurs="unbounded"/>

View File

@ -46,6 +46,7 @@
<!-- Complex Types -->
<complexType name="Service">
<attribute name="id" type="xsd:string" use="required"/>
<attribute name="type" type="identity:ExtensibleServiceType" use="required"/>
<attribute name="description" type="xsd:string" use="optional"/>
<anyAttribute namespace="##other" processContents="lax"/>
</complexType>

View File

@ -1,7 +1,7 @@
{
"name": "Rackspace API Key Authentication",
"namespace": "http://docs.rackspacecloud.com/identity/api/ext/key/v1.0",
"alias": "RS-KEY",
"alias": "RAX-KEY",
"updated": "2011-08-14T13:25:27-06:00",
"description": "Rackspace extensions to Keystone v2.0 API enabling API Key authentication.",
"links": [{

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<extension xmlns="http://docs.openstack.org/common/api/v2.0"
xmlns:atom="http://www.w3.org/2005/Atom"
name="Rackspace" namespace="http://docs.rackspace.com/identity/api/ext/rpe/v1.0" alias="RS-KEY"
name="Rackspace" namespace="http://docs.rackspace.com/identity/api/ext/RAX-KEY/v1.0" alias="RAX-KEY"
updated="2011-08-14T13:25:27-06:00">
<description>
Rackspace extensions to Keystone v2.0 API

View File

@ -16,6 +16,7 @@
# under the License.
from webob import Response
import os
from keystone import utils
from keystone.common import template, wsgi
@ -62,10 +63,14 @@ class StaticFilesController(wsgi.Controller):
elif utils.is_json_response(req):
mimetype = "application/json"
if mimetype == "application/xml":
resp_file = "%s%s%s.xml" % (root, path, file)
elif mimetype == "application/json":
resp_file = "%s%s%s.json" % (root, path, file)
basename, extension = os.path.splitext(file)
if extension == None or extension == '':
if mimetype == "application/xml":
resp_file = "%s%s%s.xml" % (root, path, file)
elif mimetype == "application/json":
resp_file = "%s%s%s.json" % (root, path, file)
else:
resp_file = root + path + file
else:
resp_file = root + path + file

View File

@ -201,7 +201,7 @@ class AdminApi(wsgi.Router):
controller=static_files_controller,
action="get_static_file",
root="content/common/", path="xslt/",
mimetype="application/xslt",
mimetype="application/xml",
conditions=dict(method=["GET"]))
mapper.connect("/js/{file:.*}",
controller=static_files_controller,

View File

@ -83,7 +83,7 @@ class ServiceApi(wsgi.Router):
mapper.connect("/xslt/{file:.*}",
controller=static_files_controller,
action="get_static_file", path="common/xslt/",
mimetype="application/xslt",
mimetype="application/xml",
conditions=dict(method=["GET"]))
mapper.connect("/style/{file:.*}",
controller=static_files_controller,

View File

@ -1,4 +1,4 @@
import unittest
import unittest2 as unittest
from common import KeystoneTestCase
@ -12,7 +12,7 @@ class TestExtensions(KeystoneTestCase):
self.assertIsNotNone(content['extensions']['values'])
found = False
for value in content['extensions']['values']:
if value['alias'] == 'RS-KEY':
if value['alias'] == 'RAX-KEY':
found = True
break
self.assertTrue(found)
@ -21,7 +21,7 @@ class TestExtensions(KeystoneTestCase):
r = self.service_request(path='/extensions.xml')
self.assertTrue('xml' in r.getheader('Content-Type'))
content = r.xml
extension = content.find("*[@alias='RS-KEY']")
extension = content.find("*[@alias='RAX-KEY']")
self.assertIsNotNone(extension)

View File

@ -25,7 +25,7 @@ class TestStaticFiles(KeystoneTestCase):
def test_xslt(self):
r = self.service_request(path='/xslt/schema.xslt')
self.assertTrue('xslt' in r.getheader('Content-Type'))
self.assertTrue('xml' in r.getheader('Content-Type'))
def test_js(self):
r = self.service_request(path='/js/shjs/sh_java.js')
@ -63,7 +63,7 @@ class TestAdminStaticFiles(KeystoneTestCase):
def test_xslt(self):
r = self.admin_request(path='/xslt/schema.xslt')
self.assertTrue('xslt' in r.getheader('Content-Type'))
self.assertTrue('xml' in r.getheader('Content-Type'))
def test_js(self):
r = self.admin_request(path='/js/shjs/sh_java.js')