keystone.server.flask.common.
APIBase
(blueprint_url_prefix='', api_url_prefix='', default_mediatype='application/json', decorators=None, errors=None)[source]¶Bases: object
api
¶blueprint
¶instantiate_and_register_to_app
(flask_app)[source]¶Build the API object and register to the passed in flask_app.
This is a simplistic loader that makes assumptions about how the
blueprint is loaded. Anything beyond defaults should be done
explicitly via normal instantiation where more values may be passed
via __init__()
.
Returns: | keystone.server.flask.common.APIBase |
---|
resource_mapping
¶An attr containing of an iterable of ResourceMap
.
Each ResourceMap
is a NamedTuple with the following elements:
resource: a
flask_restful.Resource
class or subclass
- url: a url route to match for the resource, standard flask
routing rules apply. Any url variables will be passed to the resource method as args. (str)
- alternate_urls: an iterable of url routes to match for the
resource, standard flask routing rules apply. These rules are in addition (for API compat) to the primary url. Any url variables will be passed to the resource method as args. (iterable)
- json_home_data:
JsonHomeData
populated with relevantinfo for populated JSON Home Documents or None.
- kwargs: a dict of optional value(s) that can further modify the
handling of the routing.
- endpoint: endpoint name (defaults to
Resource.__name__.lower()
Can be used to reference this route infields.Url
fields (str)
- resource_class_args: args to be forwarded to the
- constructor of the resource. (tuple)
- resource_class_kwargs: kwargs to be forwarded to the
- constructor of the resource. (dict)
Additional keyword arguments not specified above will be passed as-is to
flask.Flask.add_url_rule()
.
resources
¶keystone.server.flask.common.
JsonHomeData
¶alias of keystone.server.flask.common.json_home_data
keystone.server.flask.common.
ResourceBase
[source]¶Bases: flask_restful.Resource
api_prefix
= ''¶audit_initiator
¶A pyCADF initiator describing the current authenticated context.
As a property.
auth_context
¶build_driver_hints
(supported_filters)[source]¶Build list hints based on the context query string.
Parameters: | supported_filters – list of filters supported, so ignore any keys in query_dict that are not in this list. |
---|
collection_key
= None¶filter_by_attributes
(refs, hints)[source]¶Filter a list of references by filter values.
limit
(refs, hints)[source]¶Limit a list of entities.
The underlying driver layer may have already truncated the collection for us, but in case it was unable to handle truncation we check here.
Parameters: |
|
---|---|
Returns: | boolean indicating whether the list was truncated, as well as the list of (truncated if necessary) entities. |
member_key
= None¶method_decorators
= []¶oslo_context
¶wrap_collection
(refs, hints=None)[source]¶Wrap a collection, checking for filtering and pagination.
Returns the wrapped collection, which includes: - Executing any filtering not already carried out - Truncate to a set limit if necessary - Adds ‘self’ links in every member - Adds ‘next’, ‘self’ and ‘prev’ links for the whole collection.
Parameters: |
|
---|
keystone.server.flask.common.
ResourceMap
¶alias of keystone.server.flask.common.resource_map
keystone.server.flask.common.
build_audit_initiator
()[source]¶A pyCADF initiator describing the current authenticated context.
keystone.server.flask.common.
construct_json_home_data
(rel, status='stable', path_vars=None, resource_relation_func=<function build_v3_resource_relation>)[source]¶keystone.server.flask.common.
construct_resource_map
(resource, url, resource_kwargs, alternate_urls=None, rel=None, status='stable', path_vars=None, resource_relation_func=<function build_v3_resource_relation>)[source]¶Construct the ResourceMap Named Tuple.
Parameters: |
|
---|---|
Type: | any iterable or None |
Returns: |
keystone.server.flask.common.
unenforced_api
(f)[source]¶Decorate a resource method to mark is as an unenforced API.
Explicitly exempts an API from receiving the enforced API check, specifically for cases such as user self-service password changes (or other APIs that must work without already having a token).
This decorator may also be used if the API has extended enforcement logic/varying enforcement logic (such as some of the AUTH paths) where the full enforcement will be implemented directly within the methods.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.