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

Fix: preserve jwt details when switching auth type #4

Merged
merged 3 commits into from
Mar 14, 2022

Conversation

kevinwcyu
Copy link
Contributor

#3

Preserves existing JWT details when switching between auth types.

@kevinwcyu kevinwcyu marked this pull request as ready for review February 25, 2022 22:02
Copy link

@sunker sunker left a 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?

@kevinwcyu
Copy link
Contributor Author

@sunker, onResetApiKey is still used by JWTForm.

Copy link

@andresmgot andresmgot left a 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 🤔

Comment on lines 182 to 184
clientEmail: 'test@grafana.com',
defaultProject: 'test-project',
tokenUri: 'https://accounts.google.com/o/oauth2/token',

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.

@kevinwcyu kevinwcyu requested a review from a team as a code owner March 14, 2022 13:16
@kevinwcyu kevinwcyu requested review from sunker and vickyyyyyyy and removed request for a team March 14, 2022 13:16
Copy link

@andresmgot andresmgot left a 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)

@kevinwcyu kevinwcyu merged commit 27f7b14 into main Mar 14, 2022
@kevinwcyu kevinwcyu deleted the preserve-jwt-on-auth-type-change branch March 14, 2022 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants