HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3/dist-packages/keyring/backends/__pycache__/SecretService.cpython-38.pyc
U

ۦ�\v
�@s�ddlZddlmZddlmZddlmZmZmZm	Z	zddl
Z
ddlmZWn&e
k
rdYnek
rvYnXe�e�ZGdd�de�ZdS)�N�)�
properties)�KeyringBackend)�	InitError�PasswordDeleteError�ExceptionRaisedContext�
KeyringLockedc@sFeZdZdZdZejedd���Zdd�Z	dd�Z
d	d
�Zdd�Zd
S)�KeyringzSecret Service KeyringzPython keyring libraryc
Cs�t��}tjW5QRX|r$td��ttd�s6td��zt��}tt�|��Wn0tj	k
r�}ztd|��W5d}~XYnXdS)NzSecretStorage required�get_default_collectionz#SecretStorage 1.0 or newer requiredz&Unable to initialize SecretService: %s�)
r�
secretstorage�__name__�RuntimeError�hasattr�	dbus_init�listZget_all_collections�
exceptions�SecretStorageException)�cls�exc�bus�e�r�@/usr/lib/python3/dist-packages/keyring/backends/SecretService.py�prioritys
�zKeyring.priorityc
Cs�t��}z(t|d�r$t�||j�}n
t�|�}Wn0tjk
r`}ztd|��W5d}~XYnX|�	�r�|�
�|�	�r�td��|S)z�If self.preferred_collection contains a D-Bus path,
        the collection at that address is returned. Otherwise,
        the default collection is returned.
        �preferred_collectionz$Failed to create the collection: %s.Nz Failed to unlock the collection!)rrr�
Collectionrr
rrr�	is_locked�unlockr)�selfr�
collectionrrrr�get_preferred_collection)s
�z Keyring.get_preferred_collectioncCsX|��}|�||d��}|D]6}t|d�r2|��|��rBtd��|���d�SdS)z5Get password of the username for the service
        ��username�servicerzFailed to unlock the item!zutf-8N)r!�search_itemsrrrrZ
get_secret�decode�rr$r#r �items�itemrrr�get_password=s�
zKeyring.get_passwordcCs8|��}|j||d�}d||f}|j|||dd�dS)z5Set password for the username of the service
        )Zapplicationr$r#zPassword for '%s' on '%s'T)�replaceN)r!�appidZcreate_item)rr$r#Zpasswordr Z
attributesZlabelrrr�set_passwordJs�zKeyring.set_passwordcCs8|��}|�||d��}|D]}|��Std��dS)z8Delete the stored password (only the first one)
        r"zNo such password!N)r!r%�deleterr'rrr�delete_passwordVs�zKeyring.delete_passwordN)
r
�
__module__�__qualname__�__doc__r,rZ
ClassProperty�classmethodrr!r*r-r/rrrrr	s
r	)Zlogging�utilrZbackendr�errorsrrrrrZsecretstorage.exceptionsr�ImportError�AttributeErrorZ	getLoggerr
�logr	rrrr�<module>s