Skip to content

basalt / drives/src / DriveAuthorization

Interface: DriveAuthorization ​

Defined in: drives/src/provider.ts:253

The OAuth half of an adapter. Kept separate because it is the only part that touches long-lived secrets.

Methods ​

account()? ​

> optional account(session): Promise<DriveAccount>

Defined in: drives/src/provider.ts:270

Identity behind the tokens, for display and duplicate detection.

Parameters ​

session ​

DriveSession

Returns ​

Promise<DriveAccount>


authorizeUrl() ​

> authorizeUrl(input): string

Defined in: drives/src/provider.ts:255

Builds the provider's consent URL. Pure — no I/O.

Parameters ​

input ​

DriveAuthorizeInput

Returns ​

string


exchange() ​

> exchange(input): Promise<DriveTokens>

Defined in: drives/src/provider.ts:257

Exchanges an authorization code for the first token pair.

Parameters ​

input ​

DriveExchangeInput

Returns ​

Promise<DriveTokens>


refresh() ​

> refresh(input): Promise<DriveTokens>

Defined in: drives/src/provider.ts:266

Refreshes an expired access token.

Throw DriveCredentialsInvalidError when the provider says the grant is gone (invalid_grant, a revoked consent): that is terminal, and the engine marks the connection invalid instead of retrying forever. Any other error is treated as transient and retried with backoff.

Parameters ​

input ​

DriveRefreshInput

Returns ​

Promise<DriveTokens>


revoke()? ​

> optional revoke(input): Promise<void>

Defined in: drives/src/provider.ts:268

Best-effort revocation at the provider when a connection is disconnected.

Parameters ​

input ​
fetch ​

GuardedFetch

tokens ​

DriveTokens

Returns ​

Promise<void>

Released under the MIT License.