Hide Forgot
Cloned from launchpad blueprint https://blueprints.launchpad.net/ceilometer/+spec/optional-send-api-request-headers-to-storage-layer. Description: In the case of role based authorization control it can be useful to have the http request information in the storage layer. For example, if fine-grained tenant grouping information is stored in the database, being able to retrieve metadata based on the user's role(s) would be necessary. Propose that methods like MeterController.get_all check the storage layer's signature (already obtained from _query_to_kwargs) for presence of an optional parameter (like "request_headers"), and if it's present pass the request headers. It might look like this: if 'request_headers' in kwargs: return [Sample.from_db_model(e) for e in pecan.request.storage_conn.get_samples( f, request_headers=pecan.request.headers, limit=limit)] else: return [Sample.from_db_model(e) for e in pecan.request.storage_conn.get_samples( f, limit=limit)] Since this is optional for every storage class, it would require no changes to any storage implementation classes. It would enable the flexibility to write storage drivers which use the request header information, or to extend existing drivers to do so. Specification URL (additional information): None