Skip to main content

CredentialRefresher

@forge/monorepo


@forge/monorepo / backend/src / CredentialRefresher

Interface: CredentialRefresher

Defined in: backend/src/tools/credentials.ts:387

Obtains a fresh credential for a reference.

A port, because how a token is renewed differs entirely by vendor and by where the grant is stored. The host's implementation reads its own ConnectionStore, calls the vendor's token endpoint, re-seals the new refresh token and returns the new access credential — none of which the runtime should know about.

It is given the ref and the context, and not the expired credential: it has to look the grant up anyway, and handing it a dead secret would be one more copy of one for no purpose.

Methods

refresh()

refresh(input): Promise<RefreshableCredential>

Defined in: backend/src/tools/credentials.ts:388

Parameters

input
context

ExecutionContext

ref

string

Returns

Promise<RefreshableCredential>