← Back
Editing: __init__.cpython-312.pyc
� ܓ�i,! � � � d dl Z d dlZdZd dlZd dlmZmZmZ d dlm Z dZ dZ e j d� Z G d � d � Zy# e$ r dZY �>w xY w)� NTF)�datetime� timedelta�timezone)�TIMEOUT_DEFAULTz sos-toolsz,urn:ietf:params:oauth:grant-type:device_code�sosc �H � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z d� Z d � Zdd�Zy ) �DeviceAuthorizationClassz$ Device Authorization Class c �j � d | _ d | _ d | _ || _ || _ | j � y �N)� _access_token�_access_expires_at�&_DeviceAuthorizationClass__device_code�client_identifier_url�token_endpoint�_use_device_code_grant)�selfr r s �?/usr/lib/python3.12/site-packages/sos/policies/auth/__init__.py�__init__z!DeviceAuthorizationClass.__init__! s6 � �!���"&���!���%:��"�,����#�#�%� c �t � | j � t d| j � �� | j � y)zv Start the device auth flow. In the future we will store the tokens in an in-memory keyring. z<Please visit the following URL to authenticate this device: N)�_request_device_code�print�_verification_uri_complete�poll_for_auth_completion�r s r r z/DeviceAuthorizationClass._use_device_code_grant+ s<