apache / openwhisk

Apache OpenWhisk is an open source serverless cloud platform
https://openwhisk.apache.org/
Apache License 2.0
6.54k stars 1.17k forks source link

Inconsistency between action and package list actions with invalid namespace #3943

Open mgencur opened 6 years ago

mgencur commented 6 years ago

Environment details:

Steps to reproduce the issue:

  1. List actions with an invalid namespace/package:
    wsk action list /whisk.syssstem/utils
  2. List packages with an invalid namespace:
    wsk package list /whisk.systsdf

Provide the expected results and outputs:

I'd expect both of the commands would return a message saying that the respective namespace or package doesn't exist.

Provide the actual results and outputs:

The output of wsk action list is

error: Unable to obtain the list of actions for namespace 'whisk.syssstem': The supplied authentication is not authorized to access 'whisk.syssstem/utils'. (code 1119)
Run 'wsk --help' for usage.

The output of wsk package list is

packages

Additional thoughts

dubee commented 6 years ago

Looks like the backend returns a 200 response for the invalid package list call and a 403 for the invalid action list call.

rabbah commented 6 years ago

the reason - for the sake of discussion - is that you can query any namespace for its list of public packages. the controller does not confirm the presence or absence of a namespace when listing packages since returning [] is also a valid response (the namespace has no shared packages).

rabbah commented 6 years ago

furthermore, i'd say wsk package get rather than wsk package list should be scrutinized to have a response similar to wsk action list and it does.

wsk package get /whisk.syssstem/utils

and the controller will respond with 403 and "The supplied authentication is not authorized to access 'whisk.syssstem/utils'.".