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

Store cloudAddr in unencrypted JSON data. Simplify logic for updating and resetting plugin settings #103

Merged
merged 2 commits into from
Nov 25, 2024

Conversation

ddelnano
Copy link
Member

@ddelnano ddelnano commented Nov 18, 2024

Summary: Store cloudAddr in unencrypted JSON data. Simplify logic for updating and resetting plugin settings

This addresses #100 (comment). Before this change, all plugin settings were stored in secureJsonData. This means that all settings, even the non secret ones like cloudAddr, were all encrypted. This prevents the plugin from reading the currently saved cloudAddr back.

By storing the cloudAddr in jsonData, we can show the user the current value of the input field and prevent the confusion linked above.

This change also simplifies the config editor component by leveraging the onUpdateDatasourceJsonDataOption, onUpdateDatasourceSecureJsonDataOption and updateDatasourcePluginResetOption functions from Grafana's SDK.

Testing done: Built the plugin, loaded in a local Grafana and tested the following:

  • Verified that queries work with a newly created data source
  • Verified that the plugin can read the currently configured cloudAddr setting
    grafana-datasource

… and resetting plugin settings

Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
(cherry picked from commit 8aaaef64a46c37a4651d11f9ee5762933ca4cfd6)
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
@ddelnano
Copy link
Member Author

@pixie-io/maintainers could you give this a review when you have the chance?

@vihangm vihangm merged commit 52211b6 into pixie-io:main Nov 25, 2024
4 checks passed
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.

2 participants