Repository navigation
Closed
Description
Description of Issue/Question
When using the /login endpoint of the rest server, rest_cherrypy accepts both a json object and an array of 1 object, containing the login credentials. Whereas rest_tornado only accepts a json object. Is this inconsistency by design? What is expected behaviour?
Setup
Set up rest_cherrypy or rest_tornado according to docs.
Steps to Reproduce Issue
(Include debug logs if possible and relevant.)
curl -si CHERRY_PY:8000/login \
-H "Accept: application/json" \
-H "Content-type: application/json" \
-d '{
"username": "saltuser",
"password": "saltuser",
"eauth": "auto"
}'
=> OK
curl -si CHERRY_PY:8000/login \
-H "Accept: application/json" \
-H "Content-type: application/json" \
-d '[{
"username": "saltuser",
"password": "saltuser",
"eauth": "auto"
}]'
=> OK
curl -si TORNADO:8000/login \
-H "Accept: application/json" \
-H "Content-type: application/json" \
-d '{
"username": "saltuser",
"password": "saltuser",
"eauth": "auto"
}'
=> OK
curl -si TORNADO:8000/login \
-H "Accept: application/json" \
-H "Content-type: application/json" \
-d '[{
"username": "saltuser",
"password": "saltuser",
"eauth": "auto"
}]'
=> 400 Invalid requestVersions Report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
Salt: 2016.3.4
Dependency Versions:
cffi: 0.8.6
cherrypy: 3.5.0
dateutil: 2.2
gitdb: 0.5.4
gitpython: 0.3.2 RC1
ioflo: Not Installed
Jinja2: 2.7.3
libgit2: Not Installed
libnacl: 1.4.4
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.2
mysql-python: 1.2.3
pycparser: 2.10
pycrypto: 2.6.1
pygit2: Not Installed
Python: 2.7.9 (default, Jun 29 2016, 13:08:31)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 14.4.0
RAET: Not Installed
smmap: 0.8.2
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.0.5
System Versions:
dist: debian 8.6
machine: x86_64
release: 3.16.0-4-amd64
system: Linux
version: debian 8.6
Activity
fracklen commentedon Nov 21, 2016
I only noticed this, since the inconsistency makes https://github.com/jenkinsci/saltstack-plugin only support
rest_cherrypy. And due to https://bitbucket.org/cherrypy/cherrypy/issue/1298/ssl-not-working,rest_tornadoseems a good choice for getting HTTPS.Ch3LL commentedon Nov 22, 2016
I believe this is another issue to be aware of in terms of feature parity between cherrypy and tornado as documented in this issue #26505 . According to that issue there are already some known differences between teh two salt-api's and this one seems to be one of those.
ping @whiteinge Looks like this is another difference between the two. Would you like to add it to that list on that issue so we ensure this is included in the efforts to bring both api's up to par?
whiteinge commentedon Nov 22, 2016
Thanks @Ch3LL. I added it to that list and linked this issue. It's a minor thing but compatibility for client libraries is important.
@fracklen That switchover is not likely to happen soon. If you want to use rest_cherrypy with SSL CherryPy version 3.2.3 works across all distros and is a good version to install.
Ch3LL commentedon Nov 23, 2016
perfect thanks will approve this as a feature request towards feature parity between the two.
stale commentedon Jul 27, 2018
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.
mattp- commentedon Oct 2, 2018
this isn't stale
stale commentedon Oct 2, 2018
Thank you for updating this issue. It is no longer marked as stale.
stale commentedon Jan 9, 2020
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.