chore: make deps

This commit is contained in:
2025-04-28 09:04:50 +02:00
parent 724a1f2a61
commit a5890983a2
157 changed files with 18406 additions and 1408 deletions

View File

@ -22,7 +22,7 @@ import (
"os/exec"
"strings"
"github.com/alessio/shellescape"
"al.essio.dev/pkg/shellescape"
)
const (
@ -113,6 +113,28 @@ func (k macOSXKeychain) Delete(service, username string) error {
return err
}
// DeleteAll deletes all secrets for a given service
func (k macOSXKeychain) DeleteAll(service string) error {
// if service is empty, do nothing otherwise it might accidentally delete all secrets
if service == "" {
return ErrNotFound
}
// Delete each secret in a while loop until there is no more left
// under the service
for {
out, err := exec.Command(
execPathKeychain,
"delete-generic-password",
"-s", service).CombinedOutput()
if strings.Contains(string(out), "could not be found") {
return nil
} else if err != nil {
return err
}
}
}
func init() {
provider = macOSXKeychain{}
}