@@ -155,7 +155,7 @@ func (c *GenVars) retrieveSpecific(prefix, in string) (string, error) {
155155 c .setToken (in )
156156 return c .getTokenValue ()
157157 case AzKeyVaultPrefix :
158- azKv , err := NewKvStoreWithToken (c .ctx , in , c .config .tokenSeparator )
158+ azKv , err := NewKvStoreWithToken (c .ctx , in , c .config .tokenSeparator , c . config . keySeparator )
159159 if err != nil {
160160 return "" , err
161161 }
@@ -259,11 +259,13 @@ func (c *GenVars) normalizeKey(k string) string {
259259}
260260
261261func (c * GenVars ) stripPrefix (in , prefix string ) string {
262- return stripPrefix (in , prefix , c .config .tokenSeparator )
262+ return stripPrefix (in , prefix , c .config .tokenSeparator , c . config . keySeparator )
263263}
264264
265- func stripPrefix (in , prefix , tokenSeparator string ) string {
266- return strings .Replace (in , fmt .Sprintf ("%s%s" , prefix , tokenSeparator ), "" , 1 )
265+ func stripPrefix (in , prefix , tokenSeparator , keySeparator string ) string {
266+ t := in
267+ b := regexp .MustCompile (`[|].*` ).ReplaceAll ([]byte (t ), []byte ("" ))
268+ return strings .Replace (string (b ), fmt .Sprintf ("%s%s" , prefix , tokenSeparator ), "" , 1 )
267269}
268270
269271// FlushToFile saves contents to file provided
0 commit comments