Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/secretstorage/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/secretstorage/__pycache__/item.cpython-310.pyc
o

j�_y�@s�dZddlmZmZddlmZddlmZddlm	Z	ddl
mZmZddl
mZmZmZmZmZddlmZmZmZdd	lmZed
ZGdd
�d
e�ZdS)
aQSecretStorage item contains a *secret*, some *attributes* and a
*label* visible to user. Editing all these properties and reading the
secret is possible only when the :doc:`collection <collection>` storing
the item is unlocked. The collection can be unlocked using collection's
:meth:`~secretstorage.collection.Collection.unlock` method.�)�Dict�Optional)�DBusConnection)�	SS_PREFIX)�Session)�LockedException�PromptDismissedException)�DBusAddressWrapper�exec_prompt�open_session�
format_secret�unlock_objects)�Cipher�
algorithms�modes)�default_backend�Itemc	@seZdZdZ	d,dededeeddfdd�Zd	d
de	fdd�Z
de	fd
d�Zd-dd�Zde	fdd�Z
deeeffdd�Zdeeefddfdd�Zdefdd�Zdeddfdd�Zd-dd�Zdefdd �Zdefd!d"�Z	#d.d$ed%eddfd&d'�Zdefd(d)�Zdefd*d+�ZdS)/rzRepresents a secret item.N�
connection�	item_path�session�returncCs0||_t|t|�|_|j�d�||_||_dS)N�Label)rr	�
ITEM_IFACE�_item�get_propertyrr)�selfrrr�r�4/usr/lib/python3/dist-packages/secretstorage/item.py�__init__s

z
Item.__init__�otherrcCst|jt�sJ�|j|jkS�N)�
isinstancer�str)rrrrr�__eq__#szItem.__eq__cCst|j�d��S)zDReturns :const:`True` if item is locked, otherwise
		:const:`False`.�Locked)�boolrr�rrrr�	is_locked'szItem.is_lockedcCs|��rtd��dS)zSIf collection is locked, raises
		:exc:`~secretstorage.exceptions.LockedException`.zItem is locked!N)r'rr&rrr�ensure_not_locked,s�zItem.ensure_not_lockedcCst|j|jg�S)a�Requests unlocking the item. Usually, this means that the
		whole collection containing this item will be unlocked.

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

		.. versionadded:: 2.1.2

		.. versionchanged:: 3.0
		   No longer accepts the ``callback`` argument.
		)r
rrr&rrr�unlock2s
zItem.unlockcCs|j�d�}t|�S)z%Returns item attributes (dictionary).�
Attributes)rr�dict)r�attrsrrr�get_attributesAszItem.get_attributes�
attributescCs|j�dd|�dS)z2Sets item attributes to `attributes` (dictionary).r*za{ss}N)r�set_property)rr.rrr�set_attributesFszItem.set_attributescC�|j�d�}t|t�s
J�|S)z$Returns item label (unicode string).r)rrr!r"�r�labelrrr�	get_labelJszItem.get_labelr3cCs|��|j�dd|�dS)zSets item label to `label`.r�sN)r(rr/r2rrr�	set_labelPszItem.set_labelcCsD|��|j�dd�\}|dkrt|j|�\}}|r td��dSdS)zDeletes the item.�Delete��/zPrompt dismissed.N)r(r�callr
rr)r�prompt�	dismissed�_resultrrr�deleteUs�zItem.deletecCs�|��|js
t|j�|_|j�dd|jj�\}|jjs"t|d�S|jj	dus*J�t
�|jj	�}t|d�}t|t
�|�t����}|d}|�t|��|��}t|t�sYJ�|d|d�S)z!Returns item secret (bytestring).�	GetSecret�o�N����)r(rrrrr:�object_path�	encrypted�bytes�aes_keyr�AESrr�CBCr�	decryptor�update�finalizer!)r�secret�aes�aes_ivrJ�encrypted_secret�
padded_secretrrr�
get_secret^szItem.get_secretcCs<|��|js
t|j�|_|j�dd|jj�\}t|d�S)z-Returns content type of item secret (string).r?r@�)r(rrrrr:rDr")rrMrrr�get_secret_content_typeos
zItem.get_secret_content_type�
text/plainrM�content_typecCs<|��|js
t|j�|_t|j||�}|j�dd|�dS)z�Sets item secret to `secret`. If `content_type` is given,
		also sets the content type of the secret (``text/plain`` by
		default).�	SetSecretz(oayays)N)r(rrrrrr:)rrMrV�_secretrrr�
set_secretws
zItem.set_secretcCr1)zlReturns UNIX timestamp (integer) representing the time
		when the item was created.

		.. versionadded:: 1.1�Created�rrr!�int)r�createdrrr�get_created�szItem.get_createdcCr1)zYReturns UNIX timestamp (integer) representing the time
		when the item was last modified.�Modifiedr[)r�modifiedrrr�get_modified�szItem.get_modifiedr )rN)rU)�__name__�
__module__�__qualname__�__doc__rr"rrrr%r#r'r(r)rr-r0r4r6r>rFrRrTrYr\r^rarrrrrs:���
�

		��
�	N)re�typingrr�jeepney.io.blockingr�secretstorage.definesr�secretstorage.dhcryptor�secretstorage.exceptionsrr�secretstorage.utilr	r
rrr
�&cryptography.hazmat.primitives.ciphersrrr�cryptography.hazmat.backendsrr�objectrrrrr�<module>s

Spamworldpro Mini