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

Support the gcp option in cast wallet list #8232

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

moricho
Copy link
Contributor

@moricho moricho commented Jun 23, 2024

Motivation

To list an account from GCP KMS as with the other options.
Related to this comment in the PR.

Solution

Adds a gcp flag to the MultiWallet and to the ListArgs of the cask wallet.
NOTE: The current implementation only supports a single key, but multiple keys should be supported in the next step

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

I don't have strong feelings about this feature and idk if gcloud keys are even widely used, but I don't mind adding this

@@ -394,6 +401,34 @@ impl MultiWalletOpts {

Ok(None)
}

// TODO: Support multiple keys
pub async fn gcp_signers(&self) -> Result<Option<Vec<WalletSigner>>> {
Copy link
Member

Choose a reason for hiding this comment

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

can we add a few docs here that describe what this does?

Comment on lines 56 to 57
.aws(self.aws || self.all)
.gcp(self.gcp || self.all)
Copy link
Member

Choose a reason for hiding this comment

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

this makes me realize that if --all is set, the command will always fail if the env vars are missing, same for aws, which is probably not great UX.
we could make gcp infallible if the env vars are missing, same for aws.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mattsse That's true. I created a helper function gcp_env_vars_set to check that all GCP environment variables are set and fixed the above part to .gcp(self.gcp || (self.all && gcp_env_vars_set())).

e2f5814

@moricho moricho force-pushed the wallet-gcp-option branch 2 times, most recently from 315d8ea to 1d971c9 Compare July 14, 2024 10:37
@moricho
Copy link
Contributor Author

moricho commented Jul 20, 2024

@mattsse Could you take another look when you have time? 👀

@zerosnacks zerosnacks added this to the v1.0.0 milestone Jul 31, 2024
@zerosnacks zerosnacks added C-cast Command: cast A-compatibility Area: compatibility labels Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compatibility Area: compatibility C-cast Command: cast
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants