diff --git a/keystone/content/common.ent b/keystone/content/common.ent new file mode 100644 index 0000000000..0dc6ddbee5 --- /dev/null +++ b/keystone/content/common.ent @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + '> + + + + + + '> + + + + + + '> diff --git a/keystone/content/identity-admin.wadl b/keystone/content/identity-admin.wadl new file mode 100644 index 0000000000..fe96f78e61 --- /dev/null +++ b/keystone/content/identity-admin.wadl @@ -0,0 +1,1448 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + You need an admin token to execute this operation. The token must be valid... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ A list of supported extensions. +

+
+ +
+ + + + + + + + + + +

+ Returns detailed information about this specific + version of the API. +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +

+ List all available extensions. +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +

+ Get details about a specific extension. +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/keystone/content/identity.wadl b/keystone/content/identity.wadl index ce7216c392..c38a7435ce 100644 --- a/keystone/content/identity.wadl +++ b/keystone/content/identity.wadl @@ -1,5 +1,5 @@ - + + + + + + - - - - - + + + - - - - - You need an admin token to execute this operation. The token must be valid... - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + + + + + + + + + + +

+ A list of supported extensions. +

+
+ +
+ + + + + + + + + + +

+ Returns detailed information about this specific + version of the API. +

+
- + + + + + - - - - + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +

+ List all available extensions. +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

+ Get details about a specific extension. +

+
- - - - - - - + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- - - - - - - - - - - - - - - - - - - @@ -221,102 +242,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -344,1012 +275,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
diff --git a/keystone/content/identityadminguide.pdf b/keystone/content/identityadminguide.pdf new file mode 100644 index 0000000000..f2ab9251e4 Binary files /dev/null and b/keystone/content/identityadminguide.pdf differ diff --git a/keystone/content/samples/auth.json b/keystone/content/samples/auth.json index c74dcb2b4f..7dae26da3b 100644 --- a/keystone/content/samples/auth.json +++ b/keystone/content/samples/auth.json @@ -4,34 +4,44 @@ "id":"asdasdasd-adsasdads-asdasdasd-adsadsasd", "expires":"2010-11-01T03:32:15-05:00" }, - "serviceCatalog":{ - "service1":[ - { - "region":"DFW", - "publicURL":"https://service1-public/v1/blah-blah", - "internalURL":"https://service1-internal/v1/blah-blah" - }, - { - "region":"ORD", - "publicURL":"https://service1-public-ord/v1/blah-blah", - "internalURL":"https://service1-internal-ord/v1/blah-blah" - } - ], - "service2":[ - { - "region":"DFW", - "publicURL":"https://service2-public-dfw/v1/blah-blah" - }, - { - "region":"ORD", - "publicURL":"https://service2-public-orf/v1/blah-blah" - } - ], - "service3":[ - { - "publicURL":"https://service3-public/v1/blah-blah" - } - ] + "serviceCatalog": [{ + "name": "Cloud Servers", + "type": "compute", + "endpoints": [{ + "publicURL": "https://compute.north.host/v1/blah-blah", + "internalURL": "https://compute.north.host/v1/blah-blah", + "region": "North", + "versionId": "1.0", + "versionInfo": "uri", + "versionList": "uri" + }, { + "publicURL": "https://compute.north.host/v1.1/blah-blah", + "internalURL": "https://compute.north.host/v1.1/blah-blah", + "region": "North", + "versionId": "1.1", + "versionInfo": "https://compute.north.host/v1.1/", + "versionList": "https://compute.north.host/" + }] + }, { + "name": "Cloud Files", + "type": "object store", + "endpoints": [{ + "publicURL": "https://compute.north.host/v1/blah-blah", + "internalURL": "https://compute.north.host/v1/blah-blah", + "region": "South", + "versionId": "1.0", + "versionInfo": "uri", + "versionList": "uri" + }, { + "publicURL": "https://compute.north.host/v1.1/blah-blah", + "internalURL": "https://compute.north.host/v1.1/blah-blah", + "region": "South", + "versionId": "1.1", + "versionInfo": "https://compute.north.host/v1.1/", + "versionList": "https://compute.north.host/" + }], + "endpoint_links": [{"rel": "next", "href": "https://identity.north.host/v2.0/endpoints?marker=2"}] + }], + "serviceCatalog_links": [{"rel": "next", "href": "uri"}] } } -} diff --git a/keystone/content/samples/auth.xml b/keystone/content/samples/auth.xml index 6d90c0642f..728d33cff4 100644 --- a/keystone/content/samples/auth.xml +++ b/keystone/content/samples/auth.xml @@ -3,27 +3,54 @@ - + + region="North" + publicURL="https://north.compute.public.com/v2.0/account1" + internalURL="https://north.compute.internal.com/v2.0/account1"> + + + region="South" + publicURL="https://south.compute.public.com/v2.0/account1" + internalURL="https://south.compute.internal.com/v2.0/account1"> + + - + + region="North" + publicURL="https://north.object-store.public.com/v1/account1" + internalURL="https://north.object-store.internal.com/v1/account1"> + + + region="South" + publicURL="https://south.object-store.public.com/v2.0/account1" + internalURL="https://south.object-store.internal.com/v2.0/account1"> + + - + + publicURL="https://dns.public.com/v2.0/blah-blah"> + + diff --git a/keystone/content/version-admin.json.tpl b/keystone/content/version-admin.json.tpl new file mode 100644 index 0000000000..651e3dd8d2 --- /dev/null +++ b/keystone/content/version-admin.json.tpl @@ -0,0 +1,33 @@ +{ + "version" : { + "id" : "v2.0", + "status" : "{{VERSION_STATUS}}", + "updated" : "{{VERSION_DATE}}", + "links": [ + { + "rel" : "self", + "href" : "http://{{HOST}}:{{PORT}}/v2.0/" + }, + { + "rel" : "describedby", + "type" : "application/pdf", + "href" : "http://{{HOST}}:{{PORT}}/v2.0/identityadminguide.pdf" + }, + { + "rel" : "describedby", + "type" : "application/vnd.sun.wadl+xml", + "href" : "http://{{HOST}}:{{PORT}}/v2.0/identity-admin.wadl" + } + ], + "media-types": [ + { + "base" : "application/xml", + "type" : "application/vnd.openstack.identity-v2.0+xml" + }, + { + "base" : "application/json", + "type" : "application/vnd.openstack.identity-v2.0+json" + } + ] + } +} diff --git a/keystone/content/version-admin.xml.tpl b/keystone/content/version-admin.xml.tpl new file mode 100644 index 0000000000..4098a232af --- /dev/null +++ b/keystone/content/version-admin.xml.tpl @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + diff --git a/keystone/content/xsd/services.xsd b/keystone/content/xsd/services.xsd index 3c1f254c43..ec0192d45f 100644 --- a/keystone/content/xsd/services.xsd +++ b/keystone/content/xsd/services.xsd @@ -18,25 +18,25 @@ -

A list of services.

-
+
-

A service.

-
+
diff --git a/keystone/content/xsd/tenant.xsd b/keystone/content/xsd/tenant.xsd index 4acd1a8d9b..ec88c22ece 100644 --- a/keystone/content/xsd/tenant.xsd +++ b/keystone/content/xsd/tenant.xsd @@ -7,6 +7,7 @@ xmlns:identity="http://docs.openstack.org/identity/api/v2.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" > @@ -17,13 +18,13 @@ - +

A container used to group or isolate resources and/or identity objects. Depending on the service operator, a tenant may map to a customer, account, organization, or project.

-
+           @@ -51,7 +52,7 @@ - + diff --git a/keystone/controllers/staticfiles.py b/keystone/controllers/staticfiles.py index 4057956c4f..a663119976 100644 --- a/keystone/controllers/staticfiles.py +++ b/keystone/controllers/staticfiles.py @@ -28,15 +28,15 @@ class StaticFilesController(wsgi.Controller): self.options = options @utils.wrap_error - def get_pdf_contract(self, req): + def get_pdf_contract(self, req, pdf): resp = Response() - return template.static_file(resp, req, "content/identitydevguide.pdf", + return template.static_file(resp, req, "content/" + pdf, root=utils.get_app_root(), mimetype="application/pdf") @utils.wrap_error - def get_wadl_contract(self, req): + def get_wadl_contract(self, req, wadl): resp = Response() - return template.static_file(resp, req, "content/identity.wadl", + return template.static_file(resp, req, "content/" + wadl, root=utils.get_app_root(), mimetype="application/vnd.sun.wadl+xml") @utils.wrap_error diff --git a/keystone/controllers/version.py b/keystone/controllers/version.py index da3bbde628..d969a1ab7f 100644 --- a/keystone/controllers/version.py +++ b/keystone/controllers/version.py @@ -20,17 +20,16 @@ class VersionController(wsgi.Controller): self.options = options @utils.wrap_error - def get_version_info(self, req): - + def get_version_info(self, req, file="version"): resp = Response() resp.charset = 'UTF-8' if utils.is_xml_response(req): resp_file = os.path.join(possible_topdir, - "keystone/content/version.xml.tpl") + "keystone/content/%s.xml.tpl" % file) resp.content_type = "application/xml" else: resp_file = os.path.join(possible_topdir, - "keystone/content/version.json.tpl") + "keystone/content/%s.json.tpl" % file) resp.content_type = "application/json" hostname = req.environ.get("SERVER_NAME") diff --git a/keystone/routers/admin.py b/keystone/routers/admin.py index c1a02455f9..f707eba396 100755 --- a/keystone/routers/admin.py +++ b/keystone/routers/admin.py @@ -159,18 +159,22 @@ class AdminApi(wsgi.Router): # Miscellaneous Operations version_controller = VersionController(options) mapper.connect("/", controller=version_controller, - action="get_version_info", + action="get_version_info", file="version-admin", conditions=dict(method=["GET"])) # Static Files Controller static_files_controller = StaticFilesController(options) - mapper.connect("/identitydevguide.pdf", + mapper.connect("/identityadminguide.pdf", controller=static_files_controller, - action="get_pdf_contract", + action="get_pdf_contract", pdf="identityadminguide.pdf", conditions=dict(method=["GET"])) - mapper.connect("/identity.wadl", + mapper.connect("/identity-admin.wadl", controller=static_files_controller, - action="get_wadl_contract", + action="get_wadl_contract", wadl="identity-admin.wadl", + conditions=dict(method=["GET"])) + mapper.connect("/common.ent", + controller=static_files_controller, + action="get_wadl_contract", wadl="common.ent", conditions=dict(method=["GET"])) mapper.connect("/xsd/{xsd}", controller=static_files_controller, @@ -183,15 +187,20 @@ class AdminApi(wsgi.Router): # Services Controller services_controller = ServicesController(options) - mapper.connect("/services", controller=services_controller, - action="get_services", conditions=dict(method=["GET"])) - mapper.connect("/services", controller=services_controller, - action="create_service", conditions=dict(method=["POST"])) - mapper.connect("/services/{service_id}", \ - controller=services_controller, - action="delete_service", conditions=dict(method=["DELETE"])) + mapper.connect("/services", + controller=services_controller, + action="get_services", + conditions=dict(method=["GET"])) + mapper.connect("/services", + controller=services_controller, + action="create_service", + conditions=dict(method=["POST"])) mapper.connect("/services/{service_id}", - controller=services_controller, - action="get_service", - conditions=dict(method=["GET"])) + controller=services_controller, + action="delete_service", + conditions=dict(method=["DELETE"])) + mapper.connect("/services/{service_id}", + controller=services_controller, + action="get_service", + conditions=dict(method=["GET"])) super(AdminApi, self).__init__(mapper) diff --git a/keystone/routers/service.py b/keystone/routers/service.py index 2683581fd2..e851cc0ef1 100644 --- a/keystone/routers/service.py +++ b/keystone/routers/service.py @@ -42,35 +42,40 @@ class ServiceApi(wsgi.Router): mapper.connect("/ec2tokens", controller=auth_controller, action="authenticate_ec2", conditions=dict(method=["POST"])) - - # Tenant Operations tenant_controller = TenantController(options) - mapper.connect("/tenants", controller=tenant_controller, - action="get_tenants", conditions=dict(method=["GET"])) + mapper.connect("/tenants", + controller=tenant_controller, + action="get_tenants", + conditions=dict(method=["GET"])) # Miscellaneous Operations version_controller = VersionController(options) - mapper.connect("/", controller=version_controller, - action="get_version_info", - conditions=dict(method=["GET"])) + mapper.connect("/", + controller=version_controller, + action="get_version_info", + conditions=dict(method=["GET"])) # Static Files Controller static_files_controller = StaticFilesController(options) mapper.connect("/identitydevguide.pdf", - controller=static_files_controller, - action="get_pdf_contract", - conditions=dict(method=["GET"])) + controller=static_files_controller, + action="get_pdf_contract", pdf="identitydevguide.pdf", + conditions=dict(method=["GET"])) mapper.connect("/identity.wadl", + controller=static_files_controller, + action="get_wadl_contract", wadl="identity.wadl", + conditions=dict(method=["GET"])) + mapper.connect("/common.ent", controller=static_files_controller, - action="get_wadl_contract", + action="get_wadl_contract", wadl="common.ent", conditions=dict(method=["GET"])) mapper.connect("/xsd/{xsd}", - controller=static_files_controller, - action="get_xsd_contract", - conditions=dict(method=["GET"])) + controller=static_files_controller, + action="get_xsd_contract", + conditions=dict(method=["GET"])) mapper.connect("/xsd/atom/{xsd}", - controller=static_files_controller, - action="get_xsd_atom_contract", - conditions=dict(method=["GET"])) + controller=static_files_controller, + action="get_xsd_atom_contract", + conditions=dict(method=["GET"])) super(ServiceApi, self).__init__(mapper) diff --git a/keystone/test/functional/test_static_files.py b/keystone/test/functional/test_static_files.py index 092fd85a1b..bc4fedc7cd 100644 --- a/keystone/test/functional/test_static_files.py +++ b/keystone/test/functional/test_static_files.py @@ -4,11 +4,29 @@ from common import KeystoneTestCase class TestStaticFiles(KeystoneTestCase): def test_pdf_contract(self): - r = self.admin_request(path='/identitydevguide.pdf') + r = self.service_request(path='/identitydevguide.pdf') self.assertTrue('pdf' in r.getheader('Content-Type')) def test_wadl_contract(self): - r = self.admin_request(path='/identity.wadl') + r = self.service_request(path='/identity.wadl') + self.assertTrue('xml' in r.getheader('Content-Type')) + + def test_xsd_contract(self): + r = self.service_request(path='/xsd/api.xsd') + self.assertTrue('xml' in r.getheader('Content-Type')) + + def test_xsd_atom_contract(self): + r = self.service_request(path='/xsd/atom/atom.xsd') + self.assertTrue('xml' in r.getheader('Content-Type')) + + +class TestAdminStaticFiles(KeystoneTestCase): + def test_pdf_contract(self): + r = self.admin_request(path='/identityadminguide.pdf') + self.assertTrue('pdf' in r.getheader('Content-Type')) + + def test_wadl_contract(self): + r = self.admin_request(path='/identity-admin.wadl') self.assertTrue('xml' in r.getheader('Content-Type')) def test_xsd_contract(self): @@ -19,6 +37,5 @@ class TestStaticFiles(KeystoneTestCase): r = self.admin_request(path='/xsd/atom/atom.xsd') self.assertTrue('xml' in r.getheader('Content-Type')) - if __name__ == '__main__': unittest.main()