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

feat: implement configurable API key storage #4

Merged
merged 3 commits into from
Apr 9, 2024

Conversation

nkzk
Copy link
Contributor

@nkzk nkzk commented Mar 27, 2024

Introduce an APIKeyStorage interface with two concrete implementations: KeyringAPIKeyStorage and FileAPIKeyStorage.

The FileAPIKeyStorage implementation is first of all intended for WSL2 environments where keyring does not work that well, so temporarly storing to the file-system is the most user-friendly option.

The ResolveAPIKeyStorage function resolves which storage mechanism to use. If the system is WSL2, automatically use FileAPIKeyStorage.

Refactor config package to align with the new storage mechanism.

nkzk added 3 commits March 27, 2024 15:38
Introduce an APIKeyStorage interface with two concrete implementations:
KeyringAPIKeyStorage and FileAPIKeyStorage.

The FileAPIKeyStorage implementation is first of all intended for WSL2 environments
where keyring does not work that well, so temporarly storing to the file-system is
the most user-friendly option.

The ResolveAPIKeyStorage function resolves which storage mechanism to use. If the system
is WSL2, automatically use FileAPIKeyStorage.

Refactor config package to align with the new storage mechanism.
@emilkje
Copy link
Collaborator

emilkje commented Apr 6, 2024

Hello @nkzk,

Thank you for your contribution!

Your work is a great step towards enhancing the versatility of cwc, enabling it to function seamlessly across a wider range of environments. However, I must inform you that some recent updates have led to merge conflicts with your pull request. The silver lining is that these updates actually simplify the integration of your feature by leveraging the existing APIKeyStorage abstraction.

Would you prefer to update your pull request to resolve these conflicts, or would you rather wait and revisit your contribution later? I apologize for the inconvenience caused by these unforeseen changes that have affected your pull request.

@emilkje
Copy link
Collaborator

emilkje commented Apr 9, 2024

I'll resolve the merge conflict and pull it in, thanks @nkzk

@emilkje emilkje merged commit d529524 into intility:main Apr 9, 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