26 July 2026

A security proxy in Rust at the edge of the API

si-gateway decides, for every request, who gets through and under what identity — allow-list of routes, tokens verified before PHP, an audit log with no secrets. The administration token no longer lives in a browser.

A security proxy in Rust at the edge of the API

The secret that lived in a browser

Until 26 July, authorisation lived entirely in the API's code, as attributes placed on each controller. The back office, for its part, had a token typed in that was valid across the whole estate and kept it in the browser's session storage. A flaw in that tool was worth the keys to every site — its own documentation said so in black and white.

Two further defects came from the same construction. A route whose attribute had been forgotten was open, and that omission was visible nowhere. A forged token, meanwhile, started the entire framework before being refused — the work was done, the bill paid, for a request that had no rights at all.

Closed by default, and verified before PHP

si-gateway is a small Rust service placed at the edge of the API. The web server consults it for every request, through an authorisation subrequest that does not carry the message body. It answers three questions: is this route declared, is this token authentic, and does its bearer have the right to enter this scope.

Anything not declared is refused — the exact opposite of the situation before. Signatures are verified against the identity server's public keys, before a line of PHP runs. The authorised scope is added to the forwarded request, and every decision goes into an audit log that contains no secrets.

It does not replace the API, it precedes it

The API's checks were not removed. If the proxy were bypassed — direct access to the application container from the internal network — the API would still refuse. A second barrier does not excuse the first; it only makes it less often called upon.

That is also what decided its size. The service fits in 2,800 lines of Rust as of 4 August 2026, most of which is the list of routes and the access policy — two files that can be read end to end. A security component you cannot read in full is not really one.

A site for your trade?

Let's talk about
your shop window.

Before we talk about a site, let's talk about yours: give us its address, and you receive five written findings within 48 working hours. It is free, with no obligation to go further — you do what you like with them, including nothing.

My free review