apache / openwhisk-apigateway

Apache OpenWhisk API Gateway service for exposing actions as REST interfaces.
https://openwhisk.apache.org/
Apache License 2.0
64 stars 45 forks source link

App ID retrieval of keys can throw Error 500 #340

Closed mhamann closed 5 years ago

mhamann commented 5 years ago

This line throws error 500 when the keys cannot be found due to an invalid tenant ID: https://github.com/apache/incubator-openwhisk-apigateway/blob/master/scripts/lua/oauth/app-id.lua#L50

This is likely because err on line 43 and 44 is only triggered if there's a network-type error calling the API, but not if the API returns a status code in the 400-599 range.

When the tenant ID cannot be found, App ID returns a 400 status code.

I think the flow should work like this: