Transport
Thin port over PSR-18 + PSR-17. One method per auth-server endpoint.
Each method’s URL maps to a row in auth-server/internal/api/routes/routes.go. Wire shape is snake_case (parity with auth-client TS reference). Response arrays are decoded JSON with original keys preserved; the Laravel adapter can renormalize for app code if it wants.
Implementations:
- HttpTransport (PSR-18-backed, the default)
- InMemoryTransport (tests; canned responses)
Methods
request()
function request( string $method, string $path, ?array $body = null, array $headers = [], ?string $accessToken = null,): array;Send a JSON request. Returns the decoded body. Throws an appropriate VenAuthException subclass on non-2xx responses (status → class via ErrorMapper) or NetworkException on transport failure.
Parameters
$method—string· HTTP method (POST/GET/PUT/DELETE)$path—string· Path appended to baseUrl + apiPrefix (e.g. “/auth/login”)$body—array<string,mixed>|null· JSON body, null = no body$headers—array<string,string>· Extra headers (Authorization auto-attached if accessToken set)$accessToken—string|null· Bearer token to attach
Returns
array<string,mixed>