99designs / 99designs/keyring

How to use the default keyring using SecretServiceBackend?

Aperta
#134 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Go
Stelle
657
Fork
155
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Whatever I use for `LibSecretCollectionName` or `ServiceName`, the library attempts to create a new keyring. How can I use the default keyring? In seahorse it is listed as `Default keyring`:

![](https://github.com/99designs/keyring/assets/1225267/825ad5a1-4871-4c89-9baa-4eb2c9e50132)

Even if I name the collection the same way, the library will create a new keyring with the same name:

```Go
package main

import (
"github.com/99designs/keyring"
)

func main() {
ring, err := keyring.Open(keyring.Config{
AllowedBackends: []keyring.BackendType{
keyring.SecretServiceBackend,
},
LibSecretCollectionName: "Default keyring",
ServiceName: "myapp",
})
if err != nil {
panic(err)
}

err = ring.Set(keyring.Item{
Key: "foo",
Data: []byte("secret-bar"),
})
if err != nil {
panic(err)
}
}
```

![](https://github.com/99designs/keyring/assets/1225267/6b8dc73b-3966-46d1-9eeb-b182d269d748)

With the https://github.com/zalando/go-keyring library, using their example from the README will write to the default keyring, so it should be possible somehow.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.