Skip to content

Commit 58d650e

Browse files
authored
Merge pull request #7719 from freedomofpress/7703-docs
docs(`api2`): document `Prefer: securedrop=x` header
2 parents dec43b2 + dcef95e commit 58d650e

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

API2.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ about support, compatibility, or documentation for other purposes.
2727

2828
Although the SecureDrop Server remains the source of truth for its clients, the
2929
v2 Journalist API borrows ideas from distributed systems and content-addressable
30-
storage.
30+
storage in order to:
3131

3232
1. Support the Journalist API's "occasionally connected" clients: actions should
3333
be possible while in offline mode, responsive even over flaky Tor connections,
@@ -42,11 +42,29 @@ storage.
4242
4. Hash a canonical representation of an endpoint's entire state (all sources,
4343
all items, etc.) to version it deterministically.
4444

45+
### Non-goals
46+
47+
5. The mechanisms specified here for synchronization, idempotence, etc. are for
48+
_performance_, _reliability_, and _integrity_. They assume that these endpoints
49+
are authenticated and restricted to SecureDrop journalists and administrators.
50+
These mechanisms are not (in themselves) for security, to mitigate
51+
denial-of-service attacks, etc.
52+
4553
## Overview
4654

4755
The request/response schemas referred to in these sequence diagrams are defined
4856
as mypy types in `securedrop.journalist_app.api2.types`.
4957

58+
A client can request a specific shape (version) of response from the server by
59+
including in its requests a header of the form—
60+
61+
```
62+
Prefer: securedrop=x
63+
```
64+
65+
—where `x` is one of the values documented in
66+
`securedrop.journalist_app.api2.API_MINOR_VERSION`.
67+
5068
### Initial synchronization
5169

5270
**Figure 1.**

0 commit comments

Comments
 (0)