_ContextAuthPlugin needs a refresh

Bug #1709118 reported by Eric Fried
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Low
Unassigned

Bug Description

nova.context._ContextAuthPlugin is (sometimes) being used as the basis for keystoneauth1 endpoint discovery. With the advent of ksa 3.1.0, there are some new methods consumers are expecting to be able to run on an auth via a ksa Session or Adapter. (Note that they were added to BaseIdentityPlugin without being added as abstract methods to BaseAuthPlugin - this is probably a ksa bug.) An example of such a method is get_endpoint_data().

Now, it appears from the docstring that the only reason _ContextAuthPlugin exists is that the auths we get from keystone middleware are not serializable. This may have changed since that docstring was written in 2014.

So: we should either update _ContextAuthPlugin to provide the methods ksa expects (perhaps in response to a fixup in ksa's BaseAuthPlugin abc that mandates those methods be implemented); or (better) figure out a way to get rid of _ContextAuthPlugin entirely and just use what keystone provides.

A manifestation of this problem can be seen in the work for bp use-service-catalog-for-endpoints. This change [1] is in response to ksa Adapter.get_endpoint_data() raising AttributeError because Adapter.get_endpoint_data eventually filters down to Adapter.auth.get_endpoint_data; which breaks when the auth is a _ContextAuthPlugin.

[1] https://review.openstack.org/#/c/490057/3..4/nova/image/glance.py

Tags: note-to-self
Sean Dague (sdague)
Changed in nova:
status: New → Confirmed
tags: added: note-to-self
Changed in nova:
importance: Undecided → Low
Revision history for this message
Eric Fried (efried) wrote :

It's possible https://review.openstack.org/#/c/500956/ will help with this.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (master)

Related fix proposed to branch: master
Review: https://review.opendev.org/664703

Revision history for this message
Eric Fried (efried) wrote :

If https://review.opendev.org/664703 works, we can close this bug.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Eric Fried (<email address hidden>) on branch: master
Review: https://review.opendev.org/664703
Reason: Okay, we're not ready for this.

or

We need to implement a real get_endpoint_data in _ContextAuthPlugin

or

We need to get rid of _ContextAuthPlugin

Revision history for this message
Eric Fried (efried) wrote :

> It's possible https://review.openstack.org/#/c/500956/ will help with this.

It did.

I still think we could stand to figure out how to get rid of _ContextAuthPlugin, but it's not breaking anything anymore, so closing this bug out for the time being.

Changed in nova:
status: Confirmed → Invalid
Revision history for this message
Eric Fried (efried) wrote :

BTW, https://review.opendev.org/#/c/524316/ took advantage of the ksa fix and removed the workaround for this bug.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to nova (master)

Reviewed: https://review.opendev.org/524316
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=5601c82915a2d745ee600a4ca4c0e7215206dbb6
Submitter: Zuul
Branch: master

commit 5601c82915a2d745ee600a4ca4c0e7215206dbb6
Author: Eric Fried <email address hidden>
Date: Thu Nov 30 12:37:56 2017 -0600

    Remove workaround for bug #1709118

    A possible fix [1] for bug #1709118 is in keystoneauth1 release 3.3.0.
    This change removes a workaround for that bug in
    nova.utils.get_endpoint.

    [1] https://review.openstack.org/#/c/500956/

    Change-Id: If2a56ed56ecb3402fdee1189df81f0b9fbc483b3
    Related-Bug: #1709118

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.