Fix token auth to /run and add login for other endpoints #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
According to salt API documentation the
/run
endpoint bypasses normal authentication and so doesn't take into account theX-Auth-Token
header with a session token.This is confirmed by this comment in a GH issue
It only handles an eauth token generated by mk_token
So currently token auth cannot work with the saltstack terraform provider
This PR fixes that behaviour by sending configured eauth token in request data when calling
/run
endpoint and add handling of login through/login
endpoint and session tokens for other endpoints for later use (only working when authenticating with username & password as you cannot login with an eauth token)