How to use the secretstorage.get_default_collection function in SecretStorage

To help you get started, we’ve selected a few SecretStorage examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github HenriWahl / Nagstamon / Nagstamon / Nagstamon / thirdparty / keyring / backends / SecretService.py View on Github external
def get_default_collection(self):
        bus = secretstorage.dbus_init()
        try:
            collection = secretstorage.get_default_collection(bus)
        except exceptions.SecretStorageException as e:
            raise InitError("Failed to create the collection: %s." % e)
        if collection.is_locked():
            collection.unlock()
            if collection.is_locked(): # User dismissed the prompt
                raise InitError("Failed to unlock the collection!")
        return collection
github ansible / awx / awx / lib / site-packages / keyring / backends / SecretService.py View on Github external
def get_default_collection(self):
        bus = secretstorage.dbus_init()
        try:
            collection = secretstorage.get_default_collection(bus)
        except exceptions.SecretStorageException as e:
            raise InitError("Failed to create the collection: %s." % e)
        if collection.is_locked():
            collection.unlock()
            if collection.is_locked(): # User dismissed the prompt
                raise InitError("Failed to unlock the collection!")
        return collection
github nficano / alexa-find-my-iphone / src / site-packages / keyring / backends / SecretService.py View on Github external
def get_default_collection(self):
        bus = secretstorage.dbus_init()
        try:
            collection = secretstorage.get_default_collection(bus)
        except exceptions.SecretStorageException as e:
            raise InitError("Failed to create the collection: %s." % e)
        if collection.is_locked():
            collection.unlock()
            if collection.is_locked(): # User dismissed the prompt
                raise InitError("Failed to unlock the collection!")
        return collection
github OpenCobolIDE / OpenCobolIDE / open_cobol_ide / extlibs / keyring / backends / SecretService.py View on Github external
def get_default_collection(self):
        bus = secretstorage.dbus_init()
        try:
            collection = secretstorage.get_default_collection(bus)
        except exceptions.SecretStorageException as e:
            raise InitError("Failed to create the collection: %s." % e)
        if collection.is_locked():
            collection.unlock()
            if collection.is_locked(): # User dismissed the prompt
                raise InitError("Failed to unlock the collection!")
        return collection
github n1nj4sec / pupy / pupy / pupylib / PupyCredentials.py View on Github external
def del_pass(self):
        if not self.bus:
            return

        collection = secretstorage.get_default_collection(self.bus)
        if collection.is_locked():
            collection.unlock()
        x=collection.search_items(self.collection).next()
        x.delete()
github n1nj4sec / pupy / pupy / pupylib / PupyCredentials.py View on Github external
def store_pass(self, password):
        if not self.bus:
            return

        try:
            collection = secretstorage.get_default_collection(self.bus)
            if collection.is_locked():
                collection.unlock()
            collection.create_item('pupy_credentials', self.collection, password)
        except Exception as e:
            logger.warning("Error with GnomeKeyring store_pass : %s"%e)