Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting an ST2_API_KEY for st2chatops instead of user/pass #197

Merged
merged 4 commits into from
Jun 18, 2021

Conversation

cognifloyd
Copy link
Member

@cognifloyd cognifloyd commented Jun 15, 2021

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_key in values.yaml (make sure to add the api_key object in st2.apikeys as well). Defining this api_key triggers replacing the ST2_AUTH_USERNAME and ST2_AUTH_PASSWORD environment vars with ST2_API_KEY but only for the st2chatops deployment.

@pull-request-size pull-request-size bot added the size/S PR that changes 10-29 lines. Very easy to review. label Jun 15, 2021
@cognifloyd cognifloyd requested a review from arm4b June 15, 2021 18:56
@cognifloyd cognifloyd added RFR and removed WIP labels Jun 18, 2021
@cognifloyd
Copy link
Member Author

OK. I think I found a clean enough way to make st2chatops use an api_key. What do you think?

values.yaml Outdated Show resolved Hide resolved
@pull-request-size pull-request-size bot added size/XS PR that changes 0-9 lines. Quick fix/merge. and removed size/S PR that changes 10-29 lines. Very easy to review. labels Jun 18, 2021
@cognifloyd cognifloyd requested a review from arm4b June 18, 2021 18:49
Copy link
Member

@arm4b arm4b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@arm4b arm4b changed the title Allow setting an api_key for st2chatops instead of user/pass Allow setting an ST2_API_KEY for st2chatops instead of user/pass Jun 18, 2021
@arm4b arm4b merged commit d3a794c into StackStorm:master Jun 18, 2021
@cognifloyd cognifloyd removed the RFR label Jun 26, 2021
@cognifloyd cognifloyd deleted the secrets_api_key branch November 11, 2021 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature size/XS PR that changes 0-9 lines. Quick fix/merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants