Skip to content

Commit d7fa03a

Browse files
musitdevnicholasflintwillow
authored andcommitted
fix: Change Hashicorp Vault delimiter to a - (#1061)
1 parent 27b93fe commit d7fa03a

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

util/signing/providers/hashicorp-vault/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ base64 = { workspace = true }
1616
anyhow = { workspace = true }
1717
async-trait = { workspace = true }
1818
uuid = { workspace = true }
19+
tracing = { workspace = true }
1920

2021
[dev-dependencies]
2122
tokio = { workspace = true }

util/signing/providers/hashicorp-vault/src/hsm/key.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ where
3030
async fn build(&self, key: Key) -> Result<HashiCorpVault<C>, SignerBuilderError> {
3131
let mut hsm = HashiCorpVault::try_from_env()
3232
.map_err(|e| SignerBuilderError::Internal(e.to_string()))?;
33-
hsm.set_key_id(key.to_delimited_canonical_string("_"));
33+
hsm.set_key_id(key.to_delimited_canonical_string("-"));
34+
tracing::info!("HashiCorp Vault builder key name:{}", hsm.get_key_id());
3435
if self.create_key {
3536
hsm = hsm
3637
.create_key()

util/signing/providers/hashicorp-vault/src/hsm/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ where
3131
self.key_name = key_id;
3232
}
3333

34+
/// Sets the key id
35+
pub fn get_key_id(&mut self) -> String {
36+
self.key_name.clone()
37+
}
38+
3439
/// Tries to create a new HashiCorp Vault HSM from the environment
3540
pub fn try_from_env() -> Result<Self, anyhow::Error> {
3641
let address = std::env::var("VAULT_ADDRESS").context("VAULT_ADDRESS not set")?;

0 commit comments

Comments
 (0)