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
FEATURE: notify admins about old credentials #9854
Conversation
Security and API keys should be renewed periodically. This additional notification should help admins keep their Discourse safe and secure.
4d3c853
to
c148b3b
Compare
15037b4
to
ef4ab18
Compare
ef4ab18
to
c2b6585
Compare
@eviltrout thank you for the feedback. I fixed it. I think that old keys setting is very specific to this problem, so I didn't want to move that to SiteSettings model. Instead, I extended the test for "execute" method so there is no more need to test private methods. |
setting_key_messages = old_site_settings_keys.map { |key| "#{key.name} - #{key.updated_at}" } | ||
api_key_messages = old_api_keys.map { |key| "#{[key.description, key.user&.username, key.created_at].compact.join(" - ")}" } | ||
[setting_key_messages | api_key_messages].join("\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor but instead of two intermediate arrays, because we can just push into an existing array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! nice catch, fixed and I will merge that stuff tomorrow in the morning :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw I left a small comment in dev about the design of this feature in https://dev.discourse.org/t/automatic-reminder-to-reset-old-machine-generated-secrets/16311/9
Security and API keys should be renewed periodically.
This additional notification should help admins keep their Discourse safe and secure.