Attempt re-auth on failure

Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
master
Marcus Noble 2 weeks ago
parent dcd698c60d
commit 4f0fb2a170
Signed by: AverageMarcus
GPG Key ID: B8F2DB8A7AEBAF78
  1. 16
      main.go

@ -93,8 +93,20 @@ func processSecret(s *apiv1.Secret) {
item, err := opClient.GetSecret(vault, passwordID)
if err != nil {
log.Println("[ERROR] Could not get secret", err)
return
if strings.Contains(err.Error(), "session expired") {
opClient, err = buildOpClient()
if err != nil {
panic(err.Error())
}
item, err = opClient.GetSecret(vault, passwordID)
if err != nil {
log.Println("[ERROR] Could not get secret", err)
return
}
} else {
log.Println("[ERROR] Could not get secret", err)
return
}
}
s.Data = make(map[string][]byte)

Loading…
Cancel
Save