Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions projects/ProvinceSystem/docs/identity/auth-security.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ Never expose these as `NEXT_PUBLIC_*` env vars.

- Allows loopback (`127.0.0.1`, `::1`) and private TCP peers (`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) so Paper on the Docker host can reach a published API (peer is often `172.18.0.1`).
- Rejects the request if `X-Forwarded-For` or `X-Real-IP` is set, so public nginx `/api/` cannot use the same Docker gateway IP to regen or overwrite map JSON.
- Used for hashed queue upload, plugin regen, and all `POST /{map}/data/upload/{mode}` (including title tiers). No Bearer session is required on that upload path.
- Website title editor write/regen still uses `ensure_map_staff_write()` (staff Bearer + `tfmc.map.staff`).
- Used for plugin regen and all `POST /{map}/data/upload/{mode}` (including the regen queue and title tiers). No Bearer session is required on that upload path.
- Website title editor reads and regen use `ensure_map_staff_write()` (staff Bearer + `tfmc.map.staff`).

**Production rule:** TFMCWeb `api.base-url` on the game host must be loopback (e.g. `http://127.0.0.1:8000`), not the public website hostname. SimpleFactions regen and uploads inherit that URL through TFMCWeb's gateway. Hitting the public `/api/` hostname adds forwarded-for headers and is rejected.

Expand Down
12 changes: 6 additions & 6 deletions projects/ProvinceSystem/docs/integrations/precedent.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,12 @@ same as `STAFF_KEY`-gated routes elsewhere.
- `logged_by` is caller-supplied and trusted once the shared `X-Staff-Key` has
authenticated the request, the same trust model as every other `X-Staff-Key`
route in this codebase (e.g. `staff_name` fields in the skins routes). Not a
gap specific to this feature. **Web callers are exempt:** a session-authenticated
request has a known player behind it, so the server overrides `logged_by` with
that player's linked Minecraft name (`get_linked_minecraft_name` in
`backend/src/skins/codes.py`), falling back to their UUID. A signed-in staff
member therefore cannot attribute a case to someone else.
- `/staff/search` rate-limiting buckets web callers by `player_uuid` rather than
gap specific to this feature. **Staff panel callers are exempt:** a signed-in
account has a known staff member behind it, so the server overrides `logged_by`
with their linked Minecraft name, falling back to their Discord username
(`staff_name` in `backend/src/api/staff_access.py`). A signed-in staff member
therefore cannot attribute a case to someone else.
- `/staff/search` rate-limiting buckets staff panel callers by account rather than
client IP. Behind a reverse proxy every browser shares one IP and would
otherwise contend for a single 10/60s budget.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Primary client: `simplefactions/src/main/java/net/tfminecraft/simplefactions/res

| Call | Purpose |
|------|---------|
| `GET {api}/{mapRef}/map/province/{x},{z}` | Resolve province under player |
| `POST {api}/{mapRef}/data/upload/{mode}` | Push nation / provinces / guilds / queue / `map_markers` / title-tier JSON (internal IP; no staff token) |
| `GET {api}/{mapRef}/{hashedKey}/api/regenerate/{type}` | `textonly`, queued, or `fullregen` |
| `GET {api}/generator/banner` | Random banner patterns |
Expand Down
1 change: 0 additions & 1 deletion projects/ProvinceSystem/docs/map/generation.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ Primary client: `simplefactions/src/main/java/net/tfminecraft/simplefactions/res

| Call | Purpose |
|------|---------|
| `GET {api}/{mapRef}/map/province/{x},{z}` | Resolve province under player |
| `POST {api}/{mapRef}/data/upload/{mode}` | Push nation / provinces / guilds / queue / `map_markers` / titles (internal IP) |
| `GET {api}/{mapRef}/{hashedKey}/api/regenerate/{type}` | `textonly`, queued, or `fullregen` |
| `GET {api}/generator/banner` | Random banner patterns |
Expand Down
4 changes: 2 additions & 2 deletions projects/ProvinceSystem/docs/map/title-editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ Same as staff map viewer:

1. `/profile` redeem → Bearer session.
2. `permission_flags["tfmc.map.staff"]` on `rpc_player_meta` for map `realm_id`.
3. Editor route write and editor regen-trigger endpoints return **403** without permission.
3. Editor province data and regen-trigger endpoints return **403** without permission.

SimpleFactions `POST /data/upload/{mode}` (including title tiers) is not staff Bearer; it uses the same internal IP check as plugin regen. The editor UI does not write through the API: `POST /{map}/editor/titles/{tier}` and `POST /{map}/editor/regen/{type}` exist, but staff changes leave as a ZIP (see [Offline export](#offline-export)).
SimpleFactions `POST /data/upload/{mode}` (including title tiers) is not staff Bearer; it uses the same internal IP check as plugin regen. The editor UI does not write title tiers through the API; staff changes leave as a ZIP (see [Offline export](#offline-export)). `POST /{map}/editor/regen/{type}` starts a staff regeneration.

## Entry and nav

Expand Down