[openstack-dev] [keystone] Accessing current Context from inside an Identity driver ?

Stef Telford stelford at internap.com
Wed Aug 1 17:19:48 UTC 2012


Hey Everyone,
    Recently, I have been digging in and around keystone, and there is a
need for the current context to be made available to the identity driver
rather than merely the manager. This is mostly so the identity driver can
have the current roles for authee/user. I noticed in
keystone/common/manager.py (where it ties everything together) that there
is a note which says;

    def __getattr__(self, name):
        """Forward calls to the underlying driver."""
        # NOTE(termie): context is the first argument, we're going to strip
        #               that for now, in the future we'll probably do some
        #               logging and whatnot in this class

   My question is, what's the "approved" solution to passing over the
context ? I could always stuff the context into the **kw or append it to
the args but, seems rather .. sub-optimal. Is there any design hints/tips ?
I don't fancy maintaining a set of patches against the main branch jst for
our codebase, and would rather do something to benefit everyone. I think
this may come up again in the future ;)

   Regards
   S.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20120801/b0806cc2/attachment.html>


More information about the OpenStack-dev mailing list