-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix: preserve jwt details when switching auth type #4
Conversation
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.
Nice @kevinwcyu! Can the onResetApiKey
func be removed now?
@dprokop are you using the ConfigEditor from the SDK now? In that case you might want to review this too?
@sunker, |
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.
LGTM!
One thing that I'm not a fan of is that with this, the unnecessary data will be persisted when saving the data source. It'd be nice for the plugin API to expose a method to clean up the configuration before saving it but that does not exist 🤔
src/ConnectionConfig.test.tsx
Outdated
clientEmail: 'test@grafana.com', | ||
defaultProject: 'test-project', | ||
tokenUri: 'https://accounts.google.com/o/oauth2/token', |
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: It'd be nice to have these properties in a object outside the test so it's not needed to repeat it every time.
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.
If you bump the version in the package.json, it should automatically release the new version when merged (so you can use the changes in grafana/grafana)
#3
Preserves existing JWT details when switching between auth types.