Allow setting an ST2_API_KEY for st2chatops instead of user/pass#197
Merged
arm4b merged 4 commits intoStackStorm:masterfrom Jun 18, 2021
Merged
Allow setting an ST2_API_KEY for st2chatops instead of user/pass#197arm4b merged 4 commits intoStackStorm:masterfrom
arm4b merged 4 commits intoStackStorm:masterfrom
Conversation
cf5c62e to
1758535
Compare
1758535 to
b927e4b
Compare
Member
Author
|
OK. I think I found a clean enough way to make st2chatops use an api_key. What do you think? |
arm4b
reviewed
Jun 18, 2021
cognifloyd
commented
Jun 18, 2021
arm4b
approved these changes
Jun 18, 2021
Member
arm4b
left a comment
There was a problem hiding this comment.
Nice 👍
Thanks a lot.
BTW, I also remember that using ST2_API_KEY is more stable and recommended comparing to st2 username:password pair as st2chatops doesn't need to re-generate auth token (which sometimes fails on the javascript side).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Whenever I setup chatops, I prefer giving chatops an api_key instead of a username/password combo.
This PR allows us to add a previously generated st2 api_key as
st2chatops.api_keyinvalues.yaml(make sure to add the api_key object inst2.apikeysas well). Defining this api_key triggers replacing theST2_AUTH_USERNAMEandST2_AUTH_PASSWORDenvironment vars withST2_API_KEYbut only for the st2chatops deployment.