[keystone] how to write a plugin?

Colleen Murphy colleen at gazlene.net
Tue Apr 2 03:41:16 UTC 2019


On Mon, Apr 1, 2019, at 4:43 PM, Sergey Vilgelm wrote:
> Hi Colleen, 
> 
> Thank you so much. Seems I need to rewrite resource driver, but I 
> didn’t find where the Keystone uses the `[resource] driver` option[0]. 
> The Resource Manger just creates an instance of 
> resource_sql.Resource[1].
> I changed the `[resource] driver` option to `sql1` in the 
> `/etc/keystone/keystone.conf` file and everything works fine :)
> 
> 
> 
> [0] 
> https://github.com/openstack/keystone/blob/master/keystone/conf/resource.py#L19
> [1] 
> https://github.com/openstack/keystone/blob/master/keystone/resource/core.py#L63
> 

My mistake, we unfortunately removed the ability to override the resource driver a few releases ago:

https://docs.openstack.org/releasenotes/keystone/pike.html#upgrade-notes

It relies on foreign keys with another table and so isn't suitable to be overridden by an out-of-tree driver.

Colleen

> --
>  Sergey Vilgelm 
> https://www.vilgelm.info
> 
> On Apr 1, 2019, 6:00 PM -0500, Colleen Murphy <colleen at gazlene.net>, wrote:
> > Hi Sergey,
> > 
> >  On Mon, Apr 1, 2019, at 1:10 PM, Sergey Vilgelm wrote:
> >> Hello community,
> >> 
> >>  Please help me to figure out how to write a plugin for keystone to
> >>  modify the current functionality. I planned to create a middleware, but
> >>  found that the paste was removed in Rocky and now Keystone uses the
> >>  hard-coded list of middleware/apps.
> >> 
> >>  I need to call an additional script/api when creating a domain or a
> >>  project. Is it possible to implement this without patching Keystone?
> >> 
> >>  --
> >>  Sergey Vilgelm
> >>  https://www.vilgelm.info
> >> 
> > 
> >  We have instructions for developing a plugin here:
> > 
> >  https://docs.openstack.org/keystone/latest/contributor/developing-drivers.html
> > 
> >  The short description is to subclass one of the base drivers (e.g. keystone.resource.backends.base.ResourceDriverBase) and to create a setuptools entrypoint for it, which you can then use to configure the driver option in keystone.conf.
> > 
> >  The driver interface is subject to change from release to release so be sure to read the release notes and update your driver implementation.
> > 
> >  Colleen
> >



More information about the openstack-discuss mailing list