kuzzleio / kuzzle

Open-source Back-end, self-hostable & ready to use - Real-time, storage, advanced search - Web, Apps, Mobile, IoT -
https://kuzzle.io
Apache License 2.0
1.43k stars 123 forks source link

CLI commands don't seem to use credentials #1309

Closed barroudjo closed 5 years ago

barroudjo commented 5 years ago

Expected Behavior

Commands such as resetDatabase should work when the proper password and username are provided, eg in our case

./bin/kuzzle -U god -P god resetDatabase --noint

should work, and it did in versions 1.7.0 (and I think in version 1.7.1).

Current Behavior

Instead of working as it used to, now we get the error:

{ [Error: Forbidden action [null/null/admin/resetDatabase] for user -1] status: 403 }

Which appears to mean that the credentials are not used and that kuzzle attempts to do it as the anonymous user, which of course we haven't allowed. What makes me think this is the problem is that when doing it through the API (HTTP) it works fine, with the same credentials.

Possible Solution

Correct a bug where the credentials provided in the CLI are not used I guess ?

Steps to Reproduce

Explained above

Context (Environment)

Kuzzle version: 1.7.4 Node.js version: 11.10.0, but same problem with other versions SDK version: NA I should add that this was reproduced on different workstations, but all of them running on windows 10.

Aschen commented 5 years ago

Hi @barroudjo ,

Thanks for the feedback! I just send a hotfix: https://github.com/kuzzleio/kuzzle/pull/1310