Skip to content

Expired Token doesnt throw an Exception #657

Open
@kzap

Description

@kzap

If you have a long running process like a daemon and it only sets the token upon running the script
after 24 hours the token expires and no error is thrown even if 401s are being returned by the APIs

specifically this was seen in the queuesService->queue->claimMessages but shouldnt it be a global, if a 401 is returned, reauth or throw an Exception rather than silently ignore...

rather than having people to put in logic to look for 401s, by default throw an exception or reauth

here was my debugging log:

# Errors: 0 
# Request:
POST /v1/[CLOUD ID]/queues/[QUEUE NAME]/claims?limit=1 HTTP/1.1
Host: dfw.queues.api.rackspacecloud.com
Content-Type: application/json
User-Agent: OpenCloud/1.14.2 Guzzle/3.9.3 cURL/7.19.7 PHP/5.6.17
Accept: application/json
X-Auth-Token: [OLD TOKEN[
Client-ID: [CLIENT ID]
Content-Length: 24

{"grace":300,"ttl":3600}

# Response:
HTTP/1.1 401 Unauthorized
Server: nginx/1.4.6 (Ubuntu)
Date: Wed, 17 Feb 2016 23:27:39 GMT
Content-Type: text/plain
Transfer-Encoding: chunked
Connection: keep-alive
WWW-Authenticate: Keystone uri='https://identity.api.rackspacecloud.com/v2.0/tokens'

Authentication required

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions