-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[batcher] Replace Fireblocks wallet with KMS wallet (#550)
- Loading branch information
Showing
9 changed files
with
294 additions
and
366 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package common | ||
|
||
import ( | ||
"github.com/urfave/cli" | ||
) | ||
|
||
type KMSKeyConfig struct { | ||
KeyID string | ||
Region string | ||
Disable bool | ||
} | ||
|
||
func KMSWalletCLIFlags(envPrefix string, flagPrefix string) []cli.Flag { | ||
return []cli.Flag{ | ||
cli.StringFlag{ | ||
Name: PrefixFlag(flagPrefix, "kms-key-id"), | ||
Usage: "KMS key ID that stores the private key", | ||
Required: false, | ||
EnvVar: PrefixEnvVar(envPrefix, "KMS_KEY_ID"), | ||
}, | ||
cli.StringFlag{ | ||
Name: PrefixFlag(flagPrefix, "kms-key-region"), | ||
Usage: "KMS key region", | ||
Required: false, | ||
EnvVar: PrefixEnvVar(envPrefix, "KMS_KEY_REGION"), | ||
}, | ||
cli.BoolFlag{ | ||
Name: PrefixFlag(flagPrefix, "kms-key-disable"), | ||
Usage: "Disable KMS wallet", | ||
Required: false, | ||
EnvVar: PrefixEnvVar(envPrefix, "KMS_KEY_DISABLE"), | ||
}, | ||
} | ||
} | ||
|
||
func ReadKMSKeyConfig(ctx *cli.Context, flagPrefix string) KMSKeyConfig { | ||
return KMSKeyConfig{ | ||
KeyID: ctx.String(PrefixFlag(flagPrefix, "kms-key-id")), | ||
Region: ctx.String(PrefixFlag(flagPrefix, "kms-key-region")), | ||
Disable: ctx.Bool(PrefixFlag(flagPrefix, "kms-key-disable")), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.