From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Allen Li Newsgroups: gmane.emacs.bugs Subject: bug#29575: 25.3; Secret Service API treats labels as unique Date: Mon, 11 Dec 2017 11:47:13 -0800 Message-ID: References: <87374hct91.fsf@gmx.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1513021925 7843 195.159.176.226 (11 Dec 2017 19:52:05 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 11 Dec 2017 19:52:05 +0000 (UTC) Cc: 29575@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 11 20:51:57 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOU7I-0001dm-SW for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Dec 2017 20:51:57 +0100 Original-Received: from localhost ([::1]:55222 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eOU7Q-0005DK-4M for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Dec 2017 14:52:04 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34569) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eOU3Z-00024Y-QP for bug-gnu-emacs@gnu.org; Mon, 11 Dec 2017 14:48:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eOU3W-0001gd-Mx for bug-gnu-emacs@gnu.org; Mon, 11 Dec 2017 14:48:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48557) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eOU3W-0001ft-JW for bug-gnu-emacs@gnu.org; Mon, 11 Dec 2017 14:48:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eOU3W-00045e-CF for bug-gnu-emacs@gnu.org; Mon, 11 Dec 2017 14:48:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Allen Li Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Dec 2017 19:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29575 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 29575-submit@debbugs.gnu.org id=B29575.151302164115656 (code B ref 29575); Mon, 11 Dec 2017 19:48:02 +0000 Original-Received: (at 29575) by debbugs.gnu.org; 11 Dec 2017 19:47:21 +0000 Original-Received: from localhost ([127.0.0.1]:57238 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOU2r-00044S-11 for submit@debbugs.gnu.org; Mon, 11 Dec 2017 14:47:21 -0500 Original-Received: from mail-qt0-f181.google.com ([209.85.216.181]:42297) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOU2p-00044A-7G for 29575@debbugs.gnu.org; Mon, 11 Dec 2017 14:47:19 -0500 Original-Received: by mail-qt0-f181.google.com with SMTP id g9so41591071qth.9 for <29575@debbugs.gnu.org>; Mon, 11 Dec 2017 11:47:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=5uiOzhasHLvqc0pe2HbYBEzH0zwV38ag1VXutVQdzqI=; b=OrbvFJGrdnqhDJnVUV/YO4pXyDrC8Z+z5l/RM6udT2jhA5sQUJE3aiyR1tThYATVyd dIprieN6bSc360suw15+iLcSwRQRDNr25eIf3udYA/g87dy3QTP1LycT4X/2V66Hb/HI JY4S7+Hl0l28KfFrafpGuts3gjV0aSdS/rcnNV5uciABK3k59N95kK6CNquBu1D0QXB7 OjsM2rfvIcTjDwsjSdZgLXcuAOS+S7dTCbMKay4bIHW2rlNYcXWRhKBvbRCrnPegDeAZ PdQUiB8cNWfNNmDQNbXp4FZCLWeiQliWFGyQhCqaqwCigr7FKPrZ8oqcp+0/P13dxecW Zw4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=5uiOzhasHLvqc0pe2HbYBEzH0zwV38ag1VXutVQdzqI=; b=MEVfumK/S5MCqfRrmS0Azrkl8RcB1E6hfC6orHhwr0qA8pqzdaNecgsmPfyoWz6MQK C2Y3mE5PI9D2rMG65yMuCAnlaPluZqvHIC7RxzeThZRko5z2cmssmWeXQUUgRDCtiRRx EezlGLMU3nhAWCqQJi62XOmnhrPTMrZn8tkJLbwMkJl0R2/sW71MJ9F/YckwKCpyWRUs 1whauhEUrYxZWZkXB84Rx25mmfzc9uuUZGOGtJtgwFk0bCzyf5QPzdalDjMUEJ10B8gE p+ZsJK92NEhMgOeygtwxf+1w2jGYLvjbV1aaxGkXEVHPFBp5x+sv+sQUssSrqsBIRBli QK5Q== X-Gm-Message-State: AKGB3mIo3gG0hW++RzdUB7kORrQO9udOVdmDXjZrF5eq+xSuOTVFTPVY DqRb8tk6Yxk23ljADLm435AwlyjO3TEtd44EWq4= X-Google-Smtp-Source: ACJfBouIhRWXr0+Hi37t6uZt06zXsfmDgxL7a5fizqKhJy44011QP/mXB3gWjTiDZAA+ZGob9HBYN/+0+he3xuY7VSE= X-Received: by 10.55.55.146 with SMTP id e140mr2060733qka.106.1513021633589; Mon, 11 Dec 2017 11:47:13 -0800 (PST) Original-Received: by 10.237.55.36 with HTTP; Mon, 11 Dec 2017 11:47:13 -0800 (PST) In-Reply-To: <87374hct91.fsf@gmx.de> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:140941 Archived-At: On Mon, Dec 11, 2017 at 5:02 AM, Michael Albinus w= rote: > Allen Li 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=3DTest1 id foo >> secret-tool store --label=3DTest1 id bar >> >> You can see how the attributes uniquely identify secrets: >> >> secret-tool store --label=3DTest2 id foo # This overwrites the first se= cret. > > 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=E2=80=99t think the specification places any guarantees on the object p= ath 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.