Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

Commit 734203b

Browse files
authored
Overall changes + API stubs (#52)
* Define headers for migration section * Add stubs for needed migrations routes * Link fixes and clarifying improvements
1 parent 460e137 commit 734203b

File tree

3 files changed

+72
-16
lines changed

3 files changed

+72
-16
lines changed

docs/APIs/core/Routes: No registration needed.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,30 @@ This request has no body.
466466

467467
---
468468

469+
## <span class="group-h">Migration</span>
470+
471+
Routes concerned with identity migration and re-signing messages.
472+
473+
---
474+
475+
### <span class="request-h"><span class="request request-post">POST</span> Set up a redirect for migrating identities [:material-lock-outline:](#authorization "Authorization required")</span>
476+
477+
`.p2/core/v1/migration/redirect/extern`
478+
479+
---
480+
481+
### <span class="request-h"><span class="request request-get">GET</span> Request message re-signing [:material-lock-outline:](#authorization "Authorization required")</span>
482+
483+
`.p2/core/v1/migration/messages/extern`
484+
485+
---
486+
487+
### <span class="request-h"><span class="request request-post">POST</span> Commit re-signed messages [:material-lock-outline:](#authorization "Authorization required")</span>
488+
489+
`.p2/core/v1/migration/messages/extern`
490+
491+
---
492+
469493
TODO: "All challenge strings and their responses created in the context of account migration must be made public to ensure that a chain of trust can be maintained"
470494

471495
TODO: Add routes concerned with account and data migration.
@@ -475,4 +499,3 @@ TODO: Add routes concerned with account and data migration.
475499
## Glossary
476500

477501
--8<-- "snippets/glossary.md"
478-

docs/APIs/core/Routes: Registration needed.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ Remove a service from the list of services discoverable by other actors.
369369

370370
---
371371

372-
### <span clas="request-h"><span class="request request-put">PUT</span> Set primary service provider [:material-lock-outline:](#authorization "Authorization required") :material-eye-lock-outline:{title="This route is considered a sensitive action."}</span>
372+
### <span class="request-h"><span class="request request-put">PUT</span> Set primary service provider [:material-lock-outline:](#authorization "Authorization required") :material-eye-lock-outline:{title="This route is considered a sensitive action."}</span>
373373

374374
`/.p2/core/v1/services/primary`
375375

@@ -421,6 +421,30 @@ for a given service namespace.
421421

422422
---
423423

424+
## <span class="group-h">Migration</span>
425+
426+
Routes concerned with identity migration and re-signing messages.
427+
428+
---
429+
430+
### <span class="request-h"><span class="request request-post">POST</span> Set up a redirect for migrating identities [:material-lock-outline:](#authorization "Authorization required")</span>
431+
432+
`.p2/core/v1/migration/redirect`
433+
434+
---
435+
436+
### <span class="request-h"><span class="request request-post">POST</span> Request enabling message re-signing (Receive key trial) [:material-lock-outline:](#authorization "Authorization required")</span>
437+
438+
`.p2/core/v1/migration/messages`
439+
440+
---
441+
442+
### <span class="request-h"><span class="request request-post">POST</span> Complete key trial [:material-lock-outline:](#authorization "Authorization required")</span>
443+
444+
`.p2/core/v1/migration/messages/keys`
445+
446+
---
447+
424448
TODO: Add routes concerned with account and data migration.
425449

426450
---

docs/Protocol Specifications/core.md

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -212,18 +212,18 @@ are employed to sign messages that the actor sends to other servers.
212212

213213
!!! note "Using one identity for several polyproto implementations"
214214

215-
An actor can choose to use the same identity for multiple polyproto implementations. If section
216-
[4.1.3](#413-authenticating-on-a-foreign-server) is implemented correctly, this should not be a problem.
215+
An actor can choose to use the same identity for multiple polyproto implementations. Read
216+
[section #9](#9-services) for more information.
217217

218218
!!! info
219219

220-
You can read more about the Identity Keys and Certificates in [7. Keys and signatures](#7-keys-and-signatures).
220+
You can read more about Identity Certificates in [section #6.](#6-cryptography-and-id-certs)
221221

222222
### 4.1 Authentication
223223

224224
The core polyproto specification does not contain a strict definition of authentication procedures
225225
and endpoints. This allows for a wide range of authentication methods to be used. However, if
226-
implementations want to closely interoperate with each other, they should **highly** consider
226+
implementations want to closely interoperate with each other, they should highly consider
227227
implementing the [polyproto-auth](./auth.md) standard for authenticating on home servers and
228228
foreign servers alike.
229229

@@ -312,10 +312,10 @@ servers from generating federation tokens for users without their consent and kn
312312

313313
!!! abstract
314314

315-
The above scenario is not unique to polyproto, and rather a problem other federated services/
316-
protocols, like ActivityPub, have as well. There is no real solution to this problem, but it can
317-
be mitigated a bit by making it more difficult for malicious home servers to do something like
318-
this without the actor noticing.
315+
The above scenario is not unique to polyproto, and rather a problem other federated
316+
services/protocols, like ActivityPub, have as well. There is no real solution to this problem,
317+
but it can be mitigated a bit by making it more difficult for malicious home servers to do
318+
something like this without the actor noticing.
319319

320320
Polyproto servers need to inform users of new sessions. This visibility hampers malicious home
321321
servers, but does not solve the issue of them being able to create federation tokens for servers the
@@ -337,7 +337,7 @@ excluding the new session. The `NEW_SESSION` event's stored data can be accessed
337337
## 5. Federation IDs (FIDs)
338338

339339
Every client requires an associated actor identity. Actors are distinguished by a unique federation
340-
ID (FID), consist of their identifier, which is unique per instance, and the instance's root domain.
340+
ID (FID). FIDs consist of their identifier, which is unique per instance, and the instance's root domain.
341341
This combination ensures global uniqueness.
342342

343343
FIDs used in public contexts are formatted as `actor@optionalsubdomain.domain.tld`, and are case-insensitive.
@@ -394,7 +394,8 @@ When signing an ID-CSR, the home server must verify the correctness of all claim
394394
This includes checking whether the signature matches the certificates' contents and checking the
395395
certificate's validity period.
396396

397-
Actors must use a separate ID-Cert for each client or session they use.
397+
Actors must use a separate ID-Cert for each client or session they use. Separating ID-Certs
398+
limits the potential damage a compromised ID-Cert can cause.
398399

399400
For two implementations of polyproto to be interoperable, they must support an overlapping set of
400401
digital signature algorithms. See [Section 6.4](#64-cryptographic-recommendations) for more
@@ -529,6 +530,15 @@ Users must hold on to all of their past key pairs, as they might need them to
529530
[migrate their account in the future](#7-migrations). How this is done is specified in
530531
[section 6.3: Private key loss prevention and private key recovery](#63-private-key-loss-prevention-and-private-key-recovery).
531532

533+
The lifetime of an actor ID-Cert should be limited to a maximum of 60 days. This is to ensure that even
534+
in a worst-case scenario, a compromised ID-Cert can only be used for a limited amount of time. The
535+
renewal of an ID-Cert is considered a [sensitive action](#412-sensitive-actions) and should require
536+
a second factor of authentication. A client that has this second factor of authentication stored
537+
should renew the ID-Cert of the authenticated actor without further interaction.
538+
539+
Server ID-Certs should be rotated way less often (every 1-3 years). Only rotate a server ID-Cert
540+
if it is suspected to be compromised, is lost, or has expired.
541+
532542
```mermaid
533543
sequenceDiagram
534544
autonumber
@@ -748,14 +758,16 @@ should be distinguishable from signed messages at first glance.
748758
As described in previous sections, actors must hold on to their past identity key pairs, should they
749759
want or need to migrate their account.
750760

751-
Home servers must offer a way for actors to upload and recover their private identity keys while not
761+
Home servers must offer a way for actors to upload and recover their private identity keys while not
752762
having access to the private keys themselves. Private identity keys must be encrypted with
753763
strong passphrases and encryption schemes such as AES, before being uploaded to the server.
754764
Authenticated actors can download their encrypted private identity keys from the server at any time.
755765
All encryption and decryption operations must be done client-side.
756766

757767
If any uncertainty about the availability of the home server exists, clients should regularly
758768
download their encrypted private identity keys from the server and store them in a secure location.
769+
Ideally, each client should immediately download their encrypted private identity keys from the
770+
server after connecting. Clients should never store key backups in an unencrypted manner.
759771

760772
Whether an actor uploads their encrypted private identity keys to the server is their own choice.
761773
It is also recommended backing up the encrypted private identity keys in some other secure location.
@@ -783,9 +795,6 @@ implementing polyproto.
783795

784796
#### 6.5.1 Signing keys and ID-Certs
785797

786-
- Actor and client signing keys should be rotated regularly (every 20-60 days). This is to ensure
787-
that a compromised key can only be used for a limited amount of time. Server identity keys should be
788-
rotated way less often (every 1-5 years), and perhaps only when a leak is suspected.
789798
- When a server is asked to generate a new ID-Cert for an actor, it must make sure that the CSR is
790799
valid and, if set, has an expiry date less than or equal to the expiry date of the server's own ID-Cert.
791800
- Due to the fact that a `SERVER_KEY_CHANGE` gateway event is bound to generate a large amount of

0 commit comments

Comments
 (0)