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

Add persistence to API keys #72

Merged
merged 7 commits into from
Dec 18, 2024
Merged

Add persistence to API keys #72

merged 7 commits into from
Dec 18, 2024

Conversation

rzats
Copy link
Contributor

@rzats rzats commented Oct 1, 2024

Closes #63.

  • Introduces a new store named apiKeySelections. This is populated when the application is initially launched, and saved in the browser's local storage.
  • This stores API and auth keys across different signals.
  • Also adds a checkbox to prevent API keys from being saved, which cleans the store immediately when deactivated.

Copy link
Contributor

@melange396 melange396 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change this so that all of the api key and authorization token fields across the different endpoints share the same singular backing store? That will save the user from having to enter their key into the forms of each individual endpoint, plus our permissions model allows us to grant permission to multiple endpoints via just one key (so a user should never need a plurality of keys).

Can we move the "Save API keys & auth tokens" checkbox next to or right above the "FETCH DATA" button, and can we make it default to unchecked?

@rzats rzats requested a review from melange396 October 9, 2024 14:08
src/components/dialogs/ImportAPIDialog.svelte Outdated Show resolved Hide resolved
src/components/dialogs/apiKeySelections.ts Outdated Show resolved Hide resolved
src/components/dialogs/dataSources/CDC.svelte Outdated Show resolved Hide resolved
src/store.ts Outdated Show resolved Hide resolved
src/store.ts Outdated Show resolved Hide resolved
@rzats rzats requested a review from melange396 November 21, 2024 17:18
src/components/dialogs/dataSources/CDC.svelte Outdated Show resolved Hide resolved
src/store.ts Outdated Show resolved Hide resolved
src/components/dialogs/ImportAPIDialog.svelte Outdated Show resolved Hide resolved
src/components/dialogs/apiKeySelections.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@melange396 melange396 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think there is still one more superfluous variable, but otherwise this is probably good to go.

src/components/dialogs/dataSources/COVIDcast.svelte Outdated Show resolved Hide resolved
Copy link
Contributor

@melange396 melange396 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@rzats rzats merged commit 6b6fe3b into dev Dec 18, 2024
6 checks passed
@rzats rzats deleted the rzatserkovnyi/persistent-apikeys branch December 18, 2024 13:51
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.

(Optionally) save API key between sessions
2 participants