Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions teller-providers/src/providers/hashicorp_vault.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,14 @@ impl Hashivault {

fn parse_path(pm: &PathMap) -> Result<(&str, &str, &str)> {
let (engine, full_path) = (pm.protocol.as_deref().unwrap_or("kv2"), pm.path.as_str());
let (mount, path) = full_path.split_once('/').ok_or_else(|| {
Error::Message(
"path must have initial mount seperated by '/', e.g. `secret/foo`".to_string(),
)
})?;
let (mount, path) = full_path
.split_once("://")
.or_else(|| full_path.split_once('/'))
.ok_or_else(|| {
Error::Message(
"path must have initial mount seperated by '/', e.g. `secret/foo`".to_string(),
)
})?;
Ok((engine, mount, path))
}

Expand Down