unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Allen Li <vianchielfaura@gmail.com>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: 29575@debbugs.gnu.org
Subject: bug#29575: 25.3; Secret Service API treats labels as unique
Date: Mon, 11 Dec 2017 11:47:13 -0800	[thread overview]
Message-ID: <CAJr1M6cpivyosnXptWOSuweHO=e5fMYXOx7DUn244vhXk_5Okw@mail.gmail.com> (raw)
In-Reply-To: <87374hct91.fsf@gmx.de>

On Mon, Dec 11, 2017 at 5:02 AM, Michael Albinus <michael.albinus@gmx.de> wrote:
> Allen Li <vianchielfaura@gmail.com> writes:
>
> Hi Allen,
>
>> The Secret Service API [1] treats labels as unique keys for each
>> secret item in a collection.  However, labels are not required to be
>> unique in a collection [2], the attribute key/value pairs are.
>>
>> It is perfectly valid to have multiple secrets with the same label, in
>> which case Emacs's Secret Service API is not able to retrieve all but
>> the most recently created (?) secret.
>>
>> This can be demonstrated by creating two such secrets using the
>> secret-tool utility:
>>
>> secret-tool store --label=Test1 id foo
>> secret-tool store --label=Test1 id bar
>>
>> You can see how the attributes uniquely identify secrets:
>>
>> secret-tool store --label=Test2 id foo  # This overwrites the first secret.
>
> First of all: do you have a use case in mind for this? Whether we'll
> extend the Secret Service API depends on the real need.

Yes, I plan on implementing a personal password manager using the API.
I am not planning on a design that requires duplicate labels, but I
hesitated on starting my project because I predict implementing other
tools that interact with the same underlying keyring service that use
duplicate labels for implementation simplicity or other reasons.

>> Implementation idea: Use attribute plists instead of label strings to
>> uniquely identify secret items.
>
> Well, inside the org.freedesktop.Secret.{Service,Collection,Item}
> interfaces, an item is identified by an object path. We could extend our
> interface to allow both label and object path as item, and to throw away
> the "unique label rule" inside collections.

That sounds like a better starting idea.  One problem that comes to
mind is that the object path could be a valid label value, I think.  I
don’t think the specification places any guarantees on the object path
either, e.g. if another program modifies an Item, does that change the
object path from under us?  That would cause race bugs.

>
>> This would require creating a new copy of the API to preserve backward
>> compatibility.
>
> The change proposed above would be backward compatible.
>
> Best regards, Michael.





  reply	other threads:[~2017-12-11 19:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-05  5:42 bug#29575: 25.3; Secret Service API treats labels as unique Allen Li
2017-12-11 13:02 ` Michael Albinus
2017-12-11 19:47   ` Allen Li [this message]
2017-12-12  8:35     ` Michael Albinus
2017-12-13  3:41       ` Allen Li
2017-12-13 14:41         ` Ted Zlatanov
2018-05-15 12:56       ` Michael Albinus
2018-05-21  7:51         ` Allen Li
2018-05-22  9:35           ` Michael Albinus
2018-09-05  9:00             ` Michael Albinus
2018-09-08 23:58               ` Allen Li
2018-09-11  9:49                 ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJr1M6cpivyosnXptWOSuweHO=e5fMYXOx7DUn244vhXk_5Okw@mail.gmail.com' \
    --to=vianchielfaura@gmail.com \
    --cc=29575@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).