Skip to content

Commit

Permalink
refactor: move isvalid methods to injectors (#422)
Browse files Browse the repository at this point in the history
Signed-off-by: Bence Csati <bcsati@cisco.com>
  • Loading branch information
csatib02 authored Aug 21, 2024
1 parent f02a7b6 commit 044af0d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions injector/bao/injector.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,10 @@ func (i *SecretInjector) readBaoPath(path, versionOrData string, update bool) (m
return secretData, nil
}

func IsValidPrefix(value string) bool {
return strings.HasPrefix(value, "bao:") || strings.HasPrefix(value, ">>bao:")
}

func HasInlineBaoDelimiters(value string) bool {
return len(FindInlineBaoDelimiters(value)) > 0
}
Expand Down
4 changes: 4 additions & 0 deletions injector/vault/injector.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,10 @@ func (i *SecretInjector) readVaultPath(path, versionOrData string, update bool)
return secretData, nil
}

func IsValidPrefix(value string) bool {
return strings.HasPrefix(value, "vault:") || strings.HasPrefix(value, ">>vault:")
}

func HasInlineVaultDelimiters(value string) bool {
return len(FindInlineVaultDelimiters(value)) > 0
}
Expand Down

0 comments on commit 044af0d

Please sign in to comment.