Skip to content

Commit 2591dc1

Browse files
authored
Support slash in mount (#288)
* Support slash in mount * Update hashicorp_vault.rs * Update hashicorp_vault.rs
1 parent a804de5 commit 2591dc1

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

teller-providers/src/providers/hashicorp_vault.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,14 @@ impl Hashivault {
8989

9090
fn parse_path(pm: &PathMap) -> Result<(&str, &str, &str)> {
9191
let (engine, full_path) = (pm.protocol.as_deref().unwrap_or("kv2"), pm.path.as_str());
92-
let (mount, path) = full_path.split_once('/').ok_or_else(|| {
93-
Error::Message(
94-
"path must have initial mount seperated by '/', e.g. `secret/foo`".to_string(),
95-
)
96-
})?;
92+
let (mount, path) = full_path
93+
.split_once("://")
94+
.or_else(|| full_path.split_once('/'))
95+
.ok_or_else(|| {
96+
Error::Message(
97+
"path must have initial mount seperated by '/', e.g. `secret/foo`".to_string(),
98+
)
99+
})?;
97100
Ok((engine, mount, path))
98101
}
99102

0 commit comments

Comments
 (0)