Skip to content

Interface: HttpTransportContract

Interface: HttpTransportContract

Defined in: auth-server-ts/src/contracts/transport.ts:14

HTTP transport port — one method per auth-server request. The default impl is fetch-backed (HttpTransport); tests can use InMemoryTransport.

Mirrors the PHP package’s Vendidit\AuthServer\Contracts\Transport.

Implementations:

  • HttpTransport (fetch-backed, the default)
  • InMemoryTransport (tests; canned responses)

A second, legacy port (HttpTransportPort) is exported for back-compat with AuthHttpClient / ServiceAuthClient — see below.

Methods

request()

request<T>(method, path, body?, headers?, accessToken?): Promise<T>

Defined in: auth-server-ts/src/contracts/transport.ts:21

Send a JSON request. Returns the decoded body. Throws an appropriate VenAuthException subclass on non-2xx responses (status + envelope code → class via error-mapper) or NetworkException on transport failure.

Type Parameters

T

T = Record<string, unknown>

Parameters

method

string

path

string

body?

Record<string, unknown> | null

headers?

Record<string, string>

accessToken?

string

Returns

Promise<T>