[api] Inconsistency between v3 API and keystone token timestamps

Bug #1634568 reported by Brant Knudson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Low
Brant Knudson

Bug Description

The v3 API spec for tokens documents the format of timestamps[1]. It says the format is like "CCYY-MM-DDThh:mm:ss±hh:mm".

By this, the timestamps returned by keystone should be like 2016-10-17T15:17:03+00:00. But they actually show up like this:

V3:
"issued_at": "2016-10-17T15:17:03.000000Z",
"expires_at": "2016-10-17T16:17:03.000000Z",

V2:
"issued_at": "2016-10-17T15:17:56.000000Z",
"expires": "2016-10-17T16:17:56Z",

Tempest has checks that the timestamp ends in Z.

[1] http://developer.openstack.org/api-ref/identity/v3/?expanded=validate-and-show-information-for-token-detail#id19

Tags: api-ref
Praveen N (praveenn)
Changed in keystone:
assignee: nobody → Praveen N (praveenn)
Changed in keystone:
milestone: none → ocata-1
importance: Undecided → High
Revision history for this message
Lance Bragstad (lbragstad) wrote :

Since this is a v2-ism, we should be able to apply an easy fix to the v3_to_v2_token method [0]. This will keep the v2 behavior isolated to v2.0 token code.

[0] https://github.com/openstack/keystone/blob/4ac5cb927486a3461255f30c86c1cd9df4d46f16/keystone/token/providers/common.py#L119

Revision history for this message
Steve Martinelli (stevemar) wrote :

@praveenn, please do not assign a bug to yourself unless you have a fix ready

Changed in keystone:
assignee: Praveen N (praveenn) → nobody
Changed in keystone:
assignee: nobody → Kalaswan Datta (kalaswan-datta)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

Fix proposed to branch: master
Review: https://review.openstack.org/396534

Changed in keystone:
status: New → In Progress
Revision history for this message
Steve Martinelli (stevemar) wrote : Re: Inconsistency between v3 API and keystone token timestamps
Changed in keystone:
assignee: Kalaswan Datta (kalaswan-datta) → Lance Bragstad (lbragstad)
Changed in keystone:
milestone: ocata-1 → ocata-2
Revision history for this message
Steve Martinelli (stevemar) wrote :

I'll try to confirm the assumption that the token provider refactoring fixed this issue, soon.

Revision history for this message
Steve Martinelli (stevemar) wrote :

this looks OK to me now...

stevemar@ubuntu:/opt/stack$ source ~/devstack/openrc admin admin
WARNING: setting legacy OS_TENANT_NAME to support cli tools.
<<this sets the auth and version to 3>>

stevemar@ubuntu:/opt/stack$ openstack token issue
+------------+-----------------------------------+
| Field | Value
+------------+-----------------------------------+
| expires | 2016-12-13T15:33:12+0000
| id | gAAAAABYvnjb554MXv4_MMDN7d6JAQ
| project_id | e8228d4835664159abdcaeb4bf8a26ac
| user_id | 08bdbf92b87d47469aa40d4b10217f40
+------------+-----------------------------------+

stevemar@ubuntu:/opt/stack$ openstack token issue --os-identity-api-version 2 --os-auth-url http://172.16.240.201:5000/v2.0

Ignoring domain related config project_domain_id because identity API version is 2.0
Ignoring domain related config user_domain_id because identity API version is 2.0
Ignoring domain related config project_domain_id because identity API version is 2.0
Ignoring domain related config user_domain_id because identity API version is 2.0
Ignoring domain related config project_domain_id because identity API version is 2.0
Ignoring domain related config user_domain_id because identity API version is 2.0

+------------+---------------------------------
| Field | Value
+------------+---------------------------------
| expires | 2016-12-13T15:33:50+0000
| id | oz1E2HQwVIJqhdz9D703gvFJTbM
| project_id | e8228d4835664159abdcaeb4bf8a26ac
| user_id | 08bdbf92b87d47469aa40d4b10217f40
+------------+---------------------------------

Changed in keystone:
status: In Progress → Invalid
assignee: Lance Bragstad (lbragstad) → nobody
importance: High → Undecided
milestone: ocata-2 → none
Revision history for this message
Brant Knudson (blk-u) wrote :

The v3 documentation is still incorrect.

Changed in keystone:
status: Invalid → New
tags: added: api-ref
summary: - Inconsistency between v3 API and keystone token timestamps
+ [api] Inconsistency between v3 API and keystone token timestamps
Changed in keystone:
importance: Undecided → Low
guoshan (guoshan)
Changed in keystone:
assignee: nobody → guoshan (guoshan)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

Fix proposed to branch: master
Review: https://review.openstack.org/413878

Changed in keystone:
status: New → In Progress
Changed in keystone:
milestone: none → ocata-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/413878
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=76139d150761e70d34c2b9afb225d57a279a8304
Submitter: Jenkins
Branch: master

commit 76139d150761e70d34c2b9afb225d57a279a8304
Author: jolie <email address hidden>
Date: Thu Dec 22 11:10:04 2016 +0800

    [api] Inconsistency between v3 API and keystone token timestamps

    The v3 API spec for tokens documents the format of timestamps.
    It says the format is like "CCYY-MM-DDThh:mm:ss±hh:mm".
    By this, the timestamps returned by keystone like this:
    2016-12-13T15:33:12+0000

    Change-Id: I616865c1b12457487c4aeb5b8e907ca01cb79ef9
    Closes-Bug:#1634568

Changed in keystone:
status: In Progress → Fix Released
Revision history for this message
Brant Knudson (blk-u) wrote :

https://review.openstack.org/#/c/413878/ didn't fix the problem. The timestamps in the v3 token issue response still doesn't match the spec as described in the bug description.

Changed in keystone:
status: Fix Released → New
milestone: ocata-3 → none
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

Fix proposed to branch: master
Review: https://review.openstack.org/416372

Changed in keystone:
assignee: guoshan (guoshan) → Brant Knudson (blk-u)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on keystone (master)

Change abandoned by Steve Martinelli (<email address hidden>) on branch: master
Review: https://review.openstack.org/396534
Reason: no movement in months, abandon in favor of https://review.openstack.org/#/c/416372/

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/416372
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=ec4d0551c0cd3af355a9a64bd2b82c34d538552e
Submitter: Jenkins
Branch: master

commit ec4d0551c0cd3af355a9a64bd2b82c34d538552e
Author: Brant Knudson <email address hidden>
Date: Tue Jan 3 16:51:25 2017 -0600

    Correct timestamp format in token responses

    The token issue response has timestamps like this:

      "issued_at": "2017-01-03T22:42:55.000000Z"
      "expires_at": "2017-01-03T23:42:55.000000Z"

    Which didn't match the format documented in the API spec (the
    response has subsecond precision and Z rather than ±HHMM).

    Change-Id: I1deeac1776a7716ee66d187d1c1c7c1f5b02235f
    Closes-Bug: 1634568

Changed in keystone:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/keystone 11.0.0.0b3

This issue was fixed in the openstack/keystone 11.0.0.0b3 development milestone.

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.