From b02aa9877cc3d7f4cf486d82916322c9349e7be6 Mon Sep 17 00:00:00 2001 From: brent s Date: Mon, 13 Dec 2021 00:40:11 -0500 Subject: [PATCH] docs modification --- collection_funcs.go | 15 ++++++++++++--- consts.go | 5 +---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/collection_funcs.go b/collection_funcs.go index 7f7cc31..bcb492a 100644 --- a/collection_funcs.go +++ b/collection_funcs.go @@ -1,10 +1,10 @@ package gosecret import ( - `strings` + "strings" "time" - `github.com/godbus/dbus/v5` + "github.com/godbus/dbus/v5" ) /* @@ -46,7 +46,16 @@ func NewCollection(service *Service, path dbus.ObjectPath) (coll *Collection, er whether any existing secret with the same label should be replaced or not, and the optional itemType. itemType is optional; if specified, it should be a Dbus interface (only the first element is used). - If not specified, the default DbusDefaultItemType will be used. + If not specified, the default DbusDefaultItemType will be used. The most common itemType is DbusDefaultItemType + and is the current recommendation. + Other types used are: + + org.gnome.keyring.NetworkPassword + org.gnome.keyring.Note + + These are libsecret schemas as defined at + https://gitlab.gnome.org/GNOME/libsecret/-/blob/master/libsecret/secret-schemas.c (and bundled in with libsecret). + Support for adding custom schemas MAY come in the future but is unsupported currently. */ func (c *Collection) CreateItem(label string, attrs map[string]string, secret *Secret, replace bool, itemType ...string) (item *Item, err error) { diff --git a/consts.go b/consts.go index f0b6939..61a7a66 100644 --- a/consts.go +++ b/consts.go @@ -19,10 +19,7 @@ const ( // DbusPrompterInterface is an interface for issuing a Prompt. Yes, it should be doubled up like that. DbusPrompterInterface string = DbusServiceBase + ".Prompt.Prompt" /* - DbusDefaultItemType is the default type to use for Item.Type. - I've only ever seen "org.gnome.keyring.NetworkPassword" in the wild - aside from the below. It may be legacy (gnome-keyring is obsoleted by SecretService). - If in doubt, the below is considered the "proper" interface. + DbusDefaultItemType is the default type to use for Item.Type/Collection.CreateItem. */ DbusDefaultItemType string = DbusServiceBase + ".Generic" )