-
Notifications
You must be signed in to change notification settings - Fork 296
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
OnCall plugin use service accounts instead of api keys #2385
Conversation
@mderynck will this changes work with older grafana versions ( for example OSS) with no service accounts? |
@Konstantinov-Innokentii w/ this PR it might be worthwhile bumping our minimum required grafana version in |
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.
nit PluginState.getGrafanaToken
is called in the PluginState.syncDataWithOnCall
method, there's a small comment there mentioning "API keys", we might to remove/update that comment
# What this PR does Changes OnCall plugin to use service accounts and api tokens instead of api keys. API keys will continue to work but if the plugin ever replaces them it will use a service account instead. Previously this was thought to be unnecessary but it was missing the case where the API key was converted to a service account which it could no longer find when searching the `/api/auth/keys` endpoint. That key would not be deleted and it would conflict with a newly created one of the same name. Now the behaviour is as follows: 1. Anytime a new token is needed all API keys and tokens under the service account matching the defined names will be deleted 2. A service account will be created named `sa-autogen-OnCall` if one does not already exist 3. An api token will be created under that service account named `OnCall` ## Which issue(s) this PR fixes #1806 ## Checklist - [x] Unit, integration, and e2e (if applicable) tests updated - [x] Documentation added (or `pr:no public docs` PR label added if not required) - [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not required) --------- Co-authored-by: Joey Orlando <joey.orlando@grafana.com>
What this PR does
Changes OnCall plugin to use service accounts and api tokens instead of api keys. API keys will continue to work but if the plugin ever replaces them it will use a service account instead. Previously this was thought to be unnecessary but it was missing the case where the API key was converted to a service account which it could no longer find when searching the
/api/auth/keys
endpoint. That key would not be deleted and it would conflict with a newly created one of the same name.Now the behaviour is as follows:
sa-autogen-OnCall
if one does not already existOnCall
Which issue(s) this PR fixes
#1806
Checklist
pr:no public docs
PR label added if not required)CHANGELOG.md
updated (orpr:no changelog
PR label added if not required)