mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 03:27:54 +00:00
Batch tokens (#755)
This commit is contained in:
@@ -104,7 +104,18 @@ func Canonicalize(nsPath string) string {
|
||||
func SplitIDFromString(input string) (string, string) {
|
||||
prefix := ""
|
||||
slashIdx := strings.LastIndex(input, "/")
|
||||
if slashIdx > 0 {
|
||||
|
||||
switch {
|
||||
case strings.HasPrefix(input, "b."):
|
||||
prefix = "b."
|
||||
input = input[2:]
|
||||
|
||||
case strings.HasPrefix(input, "s."):
|
||||
prefix = "s."
|
||||
input = input[2:]
|
||||
|
||||
case slashIdx > 0:
|
||||
// Leases will never have a b./s. to start
|
||||
if slashIdx == len(input)-1 {
|
||||
return input, ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user