← Back
Editing: Windows.cpython-38.pyc
U ۦ�\� � @ s� d dl mZ d dlZddlmZ ddlmZ ddlmZ ddl m Z ddlmZm Z e � �TZz"d d lmZ d d lmZ ej W n* ek r� d dlZd dlZej Y nX W 5 Q R X eZG dd� de�ZG d d� d�ZdS )� )�unicode_literalsN� )� text_type)� properties)�KeyringBackend)�SimpleCredential)�PasswordDeleteError�ExceptionRaisedContext)� pywintypes)� win32credc @ sf e Zd ZdZejedd� ��Zedd� �Z dd� Z dd � Zd d� Zdd � Z dd� Zdd� Zdd� ZdS )�WinVaultKeyringa� WinVaultKeyring stores encrypted passwords using the Windows Credential Manager. Requires pywin32 This backend does some gymnastics to simulate multi-user support, which WinVault doesn't support natively. See https://bitbucket.org/kang/python-keyring-lib/issue/47/winvaultkeyring-only-ever-returns-last#comment-731977 for details on the implementation, but here's the gist: Passwords are stored under the service name unless there is a collision (another password with the same service name but different user name), in which case the previous password is moved into a compound name: {username}@{service} c C s t rtd��dS )zA If available, the preferred backend on Windows. zRequires Windows and pywin32� )�missing_deps�RuntimeError)�cls� r �:/usr/lib/python3/dist-packages/keyring/backends/Windows.py�priority0 s zWinVaultKeyring.priorityc C s dt � S )Nz%(username)s@%(service)s)�vars)�username�servicer r r �_compound_name: s zWinVaultKeyring._compound_namec C sF | � |�}|r|d |kr,| � | �||��}|s4d S |d }|�d�S �N�UserName�CredentialBlobzutf-16)� _get_passwordr �decode)�selfr r �resZblobr r r �get_password>