Doing operation on the same secret many time in a row can cause issues because of sync lag.
It can lead to duplicate secrets as the Add / Edit, which is determining by querying the secret, can fail.
It also lead to intermittent error in our tests as sometime the secret do not exists when doing a Get right after a Set.
@TylerLeonhardt You mentionned the Get-SecretInfo logic as a possible root cause but I also saw this with the standard Get-Secret, which does not implement such filtering.
I am bringing that out of the current PR to keep an eye on it and do not necessarily want to hold it back because of this problem.
Here's a sample that should reproduce the issue.
(I had a successful run or 2 but running the loop a couple of time definitely produced the error)
$Vault = @{Vault = 'lpt'; Name = 'ABCDEF' }
1..10 | %{
Set-Secret @Vault -Secret 'EDCBA' -Verbose
Get-Secret @Vault -AsPlainText
Remove-Secret @Vault
}
# View duplicate
Get-SecretInfo @vault
# Cleanup
Get-SecretInfo @vault | % {Remove-Secret -Name $_.Name -Vault $Vault.Vault}
My initial thought is to ditch the module and replace them with the commands performing the same aciton.
If I can figure a proper set of command 100% foolproof, it can be retrofitted in the module.
Doing operation on the same secret many time in a row can cause issues because of sync lag.
It can lead to duplicate secrets as the Add / Edit, which is determining by querying the secret, can fail.
It also lead to intermittent error in our tests as sometime the secret do not exists when doing a Get right after a Set.
@TylerLeonhardt You mentionned the
Get-SecretInfologic as a possible root cause but I also saw this with the standardGet-Secret, which does not implement such filtering.I am bringing that out of the current PR to keep an eye on it and do not necessarily want to hold it back because of this problem.
Here's a sample that should reproduce the issue.
(I had a successful run or 2 but running the loop a couple of time definitely produced the error)
My initial thought is to ditch the module and replace them with the commands performing the same aciton.
If I can figure a proper set of command 100% foolproof, it can be retrofitted in the module.