VulCode

Atrium

The internal API through which the VulCode client panel runs a hotel's subscription in Atrium: reading its state, setting the plan with the end of the paid period and suspending it with a stated reason. The client cannot change the plan, because none of their routes writes it, and the API is guarded by a shared secret in the X-Service-Token header: with no secret configured it answers 503 instead of running unauthenticated.

TypeInternal service-to-service API
BackendExpress, TypeScript, Prisma
AccessShared secret in a header
Called byVulCode client panel
Atrium

Overview

Atrium is a panel for running a hotel: a floor map with live room status, bookings, housekeeping, repairs, the restaurant, inventory, the schedule and reports. A hotel pays for it in the VulCode client panel, so that is where the hotel's plan and any suspension have to come from.

That is what the internal API is for: a narrow service-to-service channel the client never sees and that cannot be opened by mistake.

Plans and what the client cannot change

A hotel is on either the free or the pro plan. The plan cannot be set from the hotel's panel, because no route available to the client writes it. It belongs to the VulCode client panel and only ever comes from there.

Atrium plans

freepro
Rooms10unlimited
Team members3unlimited
Reportsnoyes

Three calls

The VulCode client panel runs a hotel's subscription with three calls: reading its state, setting the plan and suspending it.

internal-api · bash
GET  /api/internal/hotels/:id
POST /api/internal/hotels/:id/plan      { "plan": "pro", "validUntil": "<end of the paid period>" }
POST /api/internal/hotels/:id/suspend   { "suspended": true, "reason": "<reason>" }

A paid plan always carries the end of the paid period, and setting free clears it. Both calls are written to the hotel's activity log under the name VulCode, so the owner sees where a plan change came from.

The end of a period with no scheduler

The end of the paid period is enough: once it passes, the hotel is served as free on the next request. An expired subscription needs no background job that might fail to run.

A smaller plan deletes nothing. A hotel with more rooms or team members than its plan allows keeps everything it has and is only stopped from adding more.

Suspension

A suspension is an operator decision, stored separately from anything the client controls. A suspended hotel stays fully readable, including data export, and every write is answered with 402. The hotel loses no data and gets back to work as soon as it pays.

A channel that never opens by mistake

The API is guarded by a shared secret sent in the X-Service-Token header and compared with the secret set on the server. If the secret is missing, the whole API answers 503 instead of accepting calls without authentication. Missing configuration ends in a closed door, not an open one.

Questions about Atrium

More projects

More work from the same category - see how we tackle similar challenges.

Have a similar project?

Get in touch - a quote is free and comes back within an hour.