godaddy / godaddy/node-openstack-wrapper

Keystone.js throws unhandled exception when auth fails

未關閉
#31 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
JavaScript
星號
34
分支
33
PR 合併指標
30 天內沒有已合併 PR

描述

If I use bad credentials (bad password or domain for example) I get an unhandled exception from keystone.js when calling keystone.getToken():

Uncaught TypeError: Cannot set property 'token' of undefined
at Request._callback (node_modules/openstack-wrapper/lib/keystone.js:138:22)
at Request.self.callback (node_modules/request/request.js:185:22)
at Request. (node_modules/request/request.js:1161:10)
at IncomingMessage. (node_modules/request/request.js:1083:12)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickDomainCallback (internal/process/next_tick.js:218:9)

The problem seems to be that the code is expecting body.token to always exist, but in this case I can see the body is: {"error":{"message":"The request you have made requires authentication.","code":401,"title":"Unauthorized"}}

I'm using node.js v 8.11 (but same thing found in v 8.14 as well).

貢獻指南

開啟貢獻指南

研究方向

Start with keystone.getToken() and the callback at node_modules/openstack-wrapper/lib/keystone.js:138, then reproduce the request using bad credentials. Trace the 401 response containing error rather than token; done means authentication failure no longer causes an unhandled exception and the failure is surfaced to the caller.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript, node.js
領域
api, authentication
Issue 類型
缺陷
難度
2/5
預估耗時
1-3 小時
活躍度
停滯
描述清晰度
描述清楚
新手友好度
52/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。