Files
google-mcp/auth/__pycache__/oauth_manager.cpython-312.pyc
T

65 lines
6.6 KiB
Plaintext
Raw Normal View History

Ë
·uh)ã ó(UddlZddlZddlZddlZddlmZmZmZmZm Z ddl
m Z ddl m
Z
mZmZmZej"ej$¬«ej&e«ZiZeeeeeffed< ddeded ed
ed ef
d Zded efd
Zded efdZy)éN)ÚDictÚOptionalÚCallableÚAnyÚTuple)ÚOAuthCallbackServer)Ústart_auth_flowÚhandle_auth_callbackÚget_credentialsÚ
get_user_info)ÚlevelÚ active_flowsÚuser_idÚscopesÚclient_secrets_pathÚportÚreturncó"tjdd«tvr t«dtdtddfˆˆˆˆfd }t |d¬ «} |j
«d
d }t|d ¬
«\}}dtj«|||dœt<d|dS#t$rZ} tjdd| «dtji«vr!tdj«t=d} ~ wwxYw)a­
Start an OAuth flow with automatic callback handling.
Args:
user_id: The unique identifier (e.g., email address) for the user.
scopes: List of OAuth scopes required.
client_secrets_path: Path to the Google client secrets JSON file.
port: Port to run the callback server on.
Returns:
A string with instructions for the user, including the authentication URL.
zStarting OAuth flow for user z
with scopes ÚcodeÚstaterNcó˜ tjd
«dd}|d|d|}t‰ ||¬«\}}dt
d<|t
d <|t
d
<tjd |«y#t$rF}tj d
d
|«dt
d<t
|«t
d<Yd}~yd}~wwxYw)Nz%Received authorization code for user úhttp://localhost:ú /callbackz?code=z&state=)rrÚauthorization_responseÚ redirect_uriÚ
authenticatedÚstatusÚauthenticated_userÚ credentialsú#Authentication successful for user z'Error handling OAuth callback for user ú: Úerror)ÚloggerÚinfor
rÚ Exceptionr"Ústr) rrrÚfull_callback_urlrrÚerrrrs €€€€úC/Users/taylorwilsdon/git/google_workspace_mcp/auth/oauth_manager.pyÚ handle_codez%start_oauth_flow.<locals>.handle_code,ø€ð K‰KиyÐ /¨t¨f°IÐ>ˆLØ#/ °t°f¸GÀEÀ7Ð KÐ ô/CØ$7ØØ'8Ø/Ñ   ð/>ŒL˜Ñ !  +Ø:LŒL˜Ñ !Ð"6Ñ 7Ø3>ŒL˜Ñ !  K‰KÐ=Ð>PÐ=QÐ Søäò L‰LÐBÀ7À)È2ÈaÈSÐ RØ.5ŒL˜Ñ ! (Ñ +Ü-0°«VŒL˜Ñ !  *ûð 4úsƒA6A:Á: C Â<CÃC T)rÚcallbackÚauto_open_browserrrF)rrrÚauto_handle_callbackÚpending)rÚ
start_timerÚserverÚauth_urlrzDAuthentication required. Please visit this URL to authorize access: a
A browser window should open automatically. After authorizing, you'll be redirected to a success page.
If the browser doesn't open automatically, copy and paste the URL into your browser. You can also check the status of your authentication by using:
check_auth_status
user_id: z#Error starting OAuth flow for user r!r0)
r#r$rÚstop_oauth_flowr&rÚstartr Útimer%r"ÚgetÚstop)
rrrrr*Úcallback_serverrr1rr(s
```` r)Ústart_oauth_flowr8sIû€ô$ ‡K¨y¸
ÀfÀXД,ÑÜ˜Ô ð4œ#ð4¤cð4¨d÷4ô:
ØØô€Oð )à×ÑÔð+¨4¨&° Ð:ˆ Ü)Ø 3ØØ%Ø!&ô 
ˆ ÜŸ)™)›+ØØ Øñ
!
Œ ðS؈jðð  

øô òÜ Ð:¸7¸)À2ÀaÀSÐ ”|×°Ó ˜Ñ ! (Ñ ˜WÐ
ûð
úsÁAB+Â+ DÂ4AD Ä Dcó’|tvrd|dSt|}|jdd«}|dk(r|jdd«}d|dS|d k(r|jd d
«}d |S|d k(r\ttj«|jd
tj««z
«}|jdd«}d|d|Sd|S)
Check the status of an active OAuth flow.
Args:
user_id: The unique identifier for the user.
Returns: