Skip to main content

Module auth

Module auth 

Source
Expand description

OAuth 2.0 authentication via the installed-app (loopback) flow.

Token acquisition, on-disk caching, and silent refresh are delegated to yup-oauth2 — the maintained crate the Google API bindings themselves use — so this crate never hand-rolls the OAuth dance (architecture decision A2).

Scopes are least-privilege (D4): edit Google Docs, and access only the Drive files this app creates or opens (sufficient to read and resolve comments on app-created documents).

Constants§

SCOPES
OAuth scopes requested by org-gdocs (least privilege, D4).

Functions§

authenticator
Build an authenticator for the given credential and token-cache paths.
https_connector
Build an HTTPS connector using rustls with the platform’s native roots.
obtain_token
Force token acquisition for SCOPES, running the interactive loopback flow when no valid cached token exists and persisting the result.

Type Aliases§

Connector
HTTPS connector shared by the authenticator and the API hubs.
GoogleAuthenticator
A built OAuth authenticator over the shared HTTPS Connector.