Engineering
How our public key can read the wall but nothing else
The wall has to be readable by anyone, and a buyer's email address must not be readable by anyone. Both facts live in the same table. This is how we make the first true and the second impossible, and how we check that it stays that way.
Two keys with two jobs
Our database gives us two kinds of keys. A public key goes to the visitor's browser so the wall can be drawn. A server key stays on our server and can do everything, which is why it never leaves it. Anything the public key can reach, anyone on the internet can reach, so the work is in deciding exactly what that is.
Two rules on the same table
We apply two independent rules to the table that holds blocks.
- A row rule: the public key may only see rows whose status is live. A block that is reserved, in review, rejected or refunded does not exist for it.
- A column rule: the public key may only read a short list of columns: the block's position and size, its status, title, link and image, and a few public details. The buyer's email address and payment identifiers are not on the list, so asking for them fails.
Either rule alone would leave a gap. Together, a visitor sees live blocks and only their public fields.
What each key can reach
| Data | Public key (the visitor's browser) | Server key (our code) |
|---|---|---|
| Live blocks: position, size, title, link, image | Read, live blocks only | Read and write |
| Blocks that are reserved, in review or rejected | Cannot read | Read and write |
| Buyer email and payment identifiers | Cannot read: those columns are not granted | Read and write |
| The launch list | Cannot read or write | Read and write |
| The outgoing email log and rate-limit counters | Cannot read or write | Read and write |
How we check it
Rules written once and never tested are a hope, not a protection. Our test suite builds a real Postgres database in memory, applies every database change in order, creates the same three roles the hosted service uses, and then tries to break the rules: reading a forbidden column as the public key, writing to the launch list as a visitor, and so on. A permission error is the expected result, and a test fails if it is ever missing.
Questions people ask
Can anyone read buyers' emails from the website?
No. Email addresses sit in columns the public key is not allowed to read. A request for them is refused.
What does the public key actually do?
It reads live blocks so the wall can be drawn, and nothing else.
What if the server key leaked?
That would be serious, because it can read everything. It stays on the server, out of the browser, and we replace it whenever there is any doubt.