Skip to content

collection.unlock() and collection.is_locked() both return True #32

Open

Description

@mandarm

I tried the following; collection.unlock() and collection.is_locked() both return True. I must be doing something wrong, but don't know enough about secretstorage to identify what my error is. Please help!

    $ python3
    Python 3.8.10 (default, Jun  2 2021, 10:49:15) 
    [GCC 9.4.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import secretstorage
    >>> collection = secretstorage.get_default_collection(secretstorage.dbus_init())
    >>> collection.is_locked()
    True
    >>> collection.unlock()
    True
    >>> collection.is_locked()
    True
    >>> 

pip list says SecretStorage 3.3.1

Activity

  1. mitya57 commented on Sep 28, 2021

    @mitya57
    Owner

    The unlock method has a counter-intuitive interface:
    https://secretstorage.readthedocs.io/en/latest/collection.html#secretstorage.collection.Collection.unlock

    Returns a boolean representing whether the prompt has been dismissed; that means False on successful unlocking and True if it has been dismissed.

    We inherited it from the Secret Service specification. I hate it too, but now it's too late to change it.

  2. mandarm commented on Sep 29, 2021

    @mandarm
    Author

    Thanks! Is my understanding that collection.unlock() should interactively prompt for a password correct? It doesn't for me, so I'm probably doing something else that's wrong.

  3. mitya57 commented on Sep 29, 2021

    @mitya57
    Owner

    Is my understanding that collection.unlock() should interactively prompt for a password correct?

    Yes, it should prompt for a password. Are you using gnome-keyring? If yes, is it GNOME Shell, some other desktop environment or a headless system?

  4. mandarm commented on Sep 30, 2021

    @mandarm
    Author

    Sorry for taking your time. I'll have physical access to the machine tomorrow, and I'm hoping things will just work if I login to the desktop environment (Lubuntu 20.04 / LXQT by default, but will switch to plain fvwm shortly). For now, I'm logged in via ssh and ran the following

    gnome-keyring-daemon --start
    export SSH_AUTH_SOCK=/run/user/1001/keyring/ssh
    

    before updating SecretStorage and running the code in my first post. collection.unlock() just returns True for me; no prompt, no exception.

    One other possibility -- just a random thought -- is that the secrets / collection is stored in an older incompatible format. I'm trying to revive this machine by installing a light distribution, but the home directories have been around and unused for some years.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions