39 lines
1.7 KiB
Markdown
39 lines
1.7 KiB
Markdown
# SXCHNGE BFF
|
|
|
|
Independent Go module with an operational HTTP shell and selected, adapted
|
|
Sendico foundations. Sendico remains an external financial-services provider;
|
|
there are no Sendico module imports, shared databases or sibling-path dependencies.
|
|
See the [architecture and service plan](../docs/architecture/bff.md) and
|
|
[reuse provenance](PROVENANCE.md).
|
|
|
|
## Run and validate
|
|
|
|
Requires Go 1.26 or later. From the repository root:
|
|
|
|
```sh
|
|
make test-backend
|
|
make lint-backend
|
|
make run-backend
|
|
```
|
|
|
|
The default address is `127.0.0.1:8082`; override with `SXCHNGE_HTTP_ADDR`.
|
|
`GET /healthz` reports process health. `GET /readyz` deliberately returns **503**
|
|
with `not_configured`: persistence, authentication and Sendico are not connected.
|
|
No product routes return dummy success. The process handles SIGINT/SIGTERM with
|
|
bounded graceful shutdown. Production transport must terminate HTTPS.
|
|
|
|
## Present components
|
|
|
|
- `cmd/bff`, `internal/httpapi`: HTTP process, timeouts and operational endpoints.
|
|
- `internal/browser`: explicit HTTPS origin/CSRF policy and Secure HttpOnly
|
|
host-only session cookie. Apply this policy to every future browser mutation;
|
|
it is not yet connected to product routes because those do not exist.
|
|
- `internal/credential`: random opaque credentials and storage digests. Never use
|
|
this helper for passwords or short OTP codes.
|
|
- `internal/evidence`: confined server-generated object keys; not a substitute
|
|
for ownership, upload validation or private storage controls.
|
|
|
|
Only the standard library is required. Larger adapted flows, persistence,
|
|
provider DTOs/mappers, email and live integration follow the plan in separate
|
|
contributions. Source-derived components evolve independently inside this repo.
|