~ubuntu-branches/ubuntu/precise/keystone/precise-security

« back to all changes in this revision

Viewing changes to doc/source/old/extensions.rst

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-03-09 12:26:12 UTC
  • mto: (25.1.1 precise-proposed)
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: package-import@ubuntu.com-20120309122612-t4zqpaytkiptezsa
Tags: upstream-2012.1~rc1~20120308.2103
ImportĀ upstreamĀ versionĀ 2012.1~rc1~20120308.2103

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
..
 
2
      Copyright 2011-2012 OpenStack, LLC
 
3
      All Rights Reserved.
 
4
 
 
5
      Licensed under the Apache License, Version 2.0 (the "License"); you may
 
6
      not use this file except in compliance with the License. You may obtain
 
7
      a copy of the License at
 
8
 
 
9
          http://www.apache.org/licenses/LICENSE-2.0
 
10
 
 
11
      Unless required by applicable law or agreed to in writing, software
 
12
      distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 
13
      WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 
14
      License for the specific language governing permissions and limitations
 
15
      under the License.
 
16
 
 
17
==========
 
18
Extensions
 
19
==========
 
20
 
 
21
Extensions support adding features and functions to OpenStack APIs at any time, without prior
 
22
approval or waiting for a new API and release cycles.
 
23
 
 
24
The extension framework is in development and documented in extensions_ and extensionspresentation_.
 
25
 
 
26
This document describes the extensions included with Keystone, how to enable and disable them,
 
27
and briefly touches on how to write your own extensions.
 
28
 
 
29
.. _extensions: http://docs.openstack.org/trunk/openstack-compute/developer/openstack-api-extensions/content/ch02s01.html
 
30
.. _extensionspresentation: http://www.slideshare.net/RackerWilliams/openstack-extensions
 
31
 
 
32
Built-in Extensions
 
33
-------------------
 
34
 
 
35
Keystone ships with a number of extensions found under the
 
36
``keystone/contib/extensions`` folder.
 
37
 
 
38
The following built-in extensions are included:
 
39
 
 
40
OS-KSADM
 
41
 
 
42
    This is an extensions that supports managing users, tenants, and roles
 
43
    through the API. Without this extensions, the ony way to manage those
 
44
    objects is through keystone-manage or directly in the underlying database.
 
45
 
 
46
    This is an Admin API extension only.
 
47
 
 
48
OS-KSCATALOG
 
49
 
 
50
    This extensions supports managing Endpoints and prrovides the Endpoint
 
51
    Template mechanism for managing bulk endpoints.
 
52
 
 
53
    This is an Admin API extension only.
 
54
 
 
55
OS-EC2
 
56
 
 
57
    This extension adds support for EC2 credentials.
 
58
 
 
59
    This is an Admin and Service API extension.
 
60
 
 
61
RAX-GRP
 
62
 
 
63
    This extension adds functionality the enables groups.
 
64
 
 
65
    This is an Admin and Service API extension.
 
66
 
 
67
RAX-KEY
 
68
 
 
69
    This extensions adds support for authentication with an API Key (the core
 
70
    Keystone API only supports username/password credentials)
 
71
 
 
72
    This is an Admin and Service API extension.
 
73
 
 
74
HP-IDM
 
75
 
 
76
    This extension adds capability to filter roles with optional service IDs
 
77
    for token validation to mitigate security risks with role name conflicts.
 
78
    See https://bugs.launchpad.net/keystone/+bug/890411 for more details.
 
79
 
 
80
    This is an Admin API extension. Applicable to validate token (GET)
 
81
    and check token (HEAD) APIs only.
 
82
 
 
83
OS-KSVALIDATE
 
84
 
 
85
    This extensions supports admin calls to /tokens without having to specify
 
86
    the token ID in the URL. Instead, the ID is supplied in a header called
 
87
    X-Subject-Token. This is provided as an alternative to address any security
 
88
    concerns that arise when token IDs are passed as part of the URL which is
 
89
    often (and by default) logged to insecure media.
 
90
 
 
91
    This is an Admin API extension only.
 
92
 
 
93
.. note::
 
94
 
 
95
    The included extensions are in the process of being rewritten. Currently
 
96
    osksadm, oskscatalog, hpidm, and osksvalidate work with this new
 
97
    extensions design.
 
98
 
 
99
 
 
100
Enabling & Disabling Extensions
 
101
-------------------------------
 
102
 
 
103
The Keystone conf file has a property called extensions. This property holds
 
104
the list of supported extensions that you want enabled. If you want to
 
105
add/remove an extension from being supported, add/remove the extension key
 
106
from this property. The key is the name of the folder of the extension
 
107
under the keystone/contrib/extensions folder.
 
108
 
 
109
.. note::
 
110
 
 
111
    If you want to load different extensions in the service API than the Admin API
 
112
    you need to use different config files.
 
113
 
 
114
Creating New Extensions
 
115
-----------------------
 
116
 
 
117
#. **Adopt a unique organization abbreviation.**
 
118
 
 
119
   This prefix should uniquely identify your organization within the community.
 
120
   The goal is to avoid schema and resource collisions with similiar extensions.
 
121
   (e.g. ``OS`` for OpenStack, ``RAX`` for Rackspace, or ``HP`` for Hewlett-Packard)
 
122
 
 
123
#. **Adopt a unique extension abbreviation.**
 
124
 
 
125
   Select an abbreviation to identify your extension, and append to
 
126
   your organization prefix using a hyphen (``-``), by convention
 
127
   (e.g. ``OS-KSADM`` (for OpenStack's Keystone Administration extension).
 
128
 
 
129
   This combination is referred to as your extension's prefix.
 
130
 
 
131
#. **Determine the scope of your extension.**
 
132
 
 
133
   Extensions can enhance the Admin API, Service API or both.
 
134
 
 
135
#. **Create a new module.**
 
136
 
 
137
   Create a module to isolate your namespace based on the extension prefix
 
138
   you selected::
 
139
 
 
140
       keystone/contrib/extensions/admin
 
141
 
 
142
   ... and/or::
 
143
 
 
144
       keystone/contrib/extensions/service/
 
145
 
 
146
   ... based on which API you are enhancing.
 
147
 
 
148
   .. note::
 
149
 
 
150
       In the future, we will support loading external extensions.
 
151
 
 
152
#. Add static extension files for JSON (``*.json``) and XML
 
153
   (``*.xml``) to the new extension module.
 
154
 
 
155
   Refer to `Service Guide <https://github.com/openstack/keystone/blob/master/keystone/content/admin/identityadminguide.pdf?raw=true>`_
 
156
   `Sample extension XML <https://github.com/openstack/keystone/blob/master/keystone/content/common/samples/extension.json>`_
 
157
   `Sample extension JSON <https://github.com/openstack/keystone/blob/master/keystone/content/common/samples/extension.xml>`_ for the the content and structure.
 
158
 
 
159
#. If your extension is adding additional methods override the base class
 
160
   ``BaseExtensionHandler``, name it ``ExtensionHandler``, and add your methods.
 
161
 
 
162
#. **Document your work.**
 
163
 
 
164
   Provide documentation to support your extension.
 
165
 
 
166
   Extensions documentation, WADL, and XSD files can be stored in the
 
167
   ``keystone/content`` folder.
 
168
 
 
169
#. Add your extension name to the list of supported extensions in The
 
170
   ``keystone.conf`` file.
 
171
 
 
172
Which extensions are enabled?
 
173
-----------------------------
 
174
 
 
175
Discover which extensions are available (service API)::
 
176
 
 
177
    curl http://localhost:5000/v2.0/extensions
 
178
 
 
179
... or (admin API)::
 
180
 
 
181
    curl http://localhost:35357/v2.0/extensions
 
182
 
 
183
The response will list the extensions available.