trust remaining_uses decrement by 2

Bug #1721439 reported by Craig Cerny
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Expired
Undecided
Unassigned

Bug Description

After setting the remaining_uses to a positive value e.g. 100, the remaining_uses are being decremented twice upon each use of the trust.

#create trust while logged in with admin
openstack trust create --project demo --role admin admin demo

#Set remaining uses on trust
mysql -e 'update keystone.trust set remaining_uses=100'

#With env's set to to the demo user:
stack@ubuntu-xenial:~$ openstack --os-trust-id 9338333bc185421d987a5e3c1a6b8659 trust show 9338333bc185421d987a5e3c1a6b8659
+--------------------+----------------------------------+
| Field | Value |
+--------------------+----------------------------------+
| deleted_at | None |
| expires_at | None |
| id | 9338333bc185421d987a5e3c1a6b8659 |
| impersonation | False |
| project_id | c9082a59cc66437dbab59422adc86fd0 |
| redelegation_count | 0 |
| remaining_uses | 98 |
| roles | admin |
| trustee_user_id | d569f0d606bf47e0b1dbf336aa4ece7e |
| trustor_user_id | c73ac9ac2e7b48ac872f2acb723892f8 |
+--------------------+----------------------------------+
stack@ubuntu-xenial:~$ openstack --os-trust-id 9338333bc185421d987a5e3c1a6b8659 trust show 9338333bc185421d987a5e3c1a6b8659 -c remaining_uses
+----------------+-------+
| Field | Value |
+----------------+-------+
| remaining_uses | 96 |
+----------------+-------+
stack@ubuntu-xenial:~$ openstack --os-trust-id 9338333bc185421d987a5e3c1a6b8659 trust show 9338333bc185421d987a5e3c1a6b8659 -c remaining_uses
+----------------+-------+
| Field | Value |
+----------------+-------+
| remaining_uses | 94 |
+----------------+-------+

description: updated
Revision history for this message
Lance Bragstad (lbragstad) wrote :

Is there a specific reason why remaining_uses is being modified directly in SQL when it's possible specify it on the trust creation? Is it possible to recreate this using only the API [0]?

[0] https://developer.openstack.org/api-ref/identity/v3-ext/index.html#os-trust-api

Revision history for this message
Lance Bragstad (lbragstad) wrote :

After some checking, we do have a test to ensure we only decrement by 1 [0].

[0] https://github.com/openstack/keystone/blob/master/keystone/tests/unit/test_v3_auth.py#L3968-L3977

Changed in keystone:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for OpenStack Identity (keystone) because there has been no activity for 60 days.]

Changed in keystone:
status: Incomplete → Expired
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.