This module is a collection of types and utilities representing a highly experimental API definition system. This can
potentially be very powerful, as the goal of it is to allow you to define your entire API - from endpoints to
authorization to validation to response - in a single place. This is a work in progress, and is probably not ready
for production yet, but feel free to play around with it and see what you think. (It should be safe-enough - I'm just
not sure the opinions expressed in this module are optimal yet.)
IMPORTANT: It makes the following assumptions:
You've used some system to authenticate the request and attach Auth.ReqInfo to the request object. You can
stub this out in development, but you'd typically do this by attaching a bearer token to the request with this
information encoded in it and then authenticating and decoding the token. (See
https://github.com/wymp/ts-auth-gateway and https://github.com/wymp/ts-auth-gateway-header-decoder)
This module is a collection of types and utilities representing a highly experimental API definition system. This can potentially be very powerful, as the goal of it is to allow you to define your entire API - from endpoints to authorization to validation to response - in a single place. This is a work in progress, and is probably not ready for production yet, but feel free to play around with it and see what you think. (It should be safe-enough - I'm just not sure the opinions expressed in this module are optimal yet.)
IMPORTANT: It makes the following assumptions:
Auth.ReqInfo
to the request object. You can stub this out in development, but you'd typically do this by attaching a bearer token to the request with this information encoded in it and then authenticating and decoding the token. (See https://github.com/wymp/ts-auth-gateway and https://github.com/wymp/ts-auth-gateway-header-decoder)See ApiSpec for more information.