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

Commit fd4eeee

Browse files
committed
fix TODOs
1 parent f8708ad commit fd4eeee

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

api/src/core/routes/migration.tsp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ namespace Migration {
2323
* This specific route is called by the "old" actor, notifying the server about their intent
2424
* to move to another home server. To fulfill this action,
2525
*
26-
* 1. A key trial must be passed
27-
* // TODO: Must it? If yes, specify for which cert(s) ^
26+
* 1. A key trial must be passed for all keys with which the actor has sent messages with
27+
* on this server.
2828
* 2. The "new" actor named in this request must confirm setting up this redirect.
2929
*
3030
* @returns
@@ -39,36 +39,33 @@ namespace Migration {
3939
op setupRedirect(
4040
@body newActorFid: string,
4141

42-
@doc("A completed `KeyTrial`.")
42+
@doc("A list of completed `KeyTrial`s.")
4343
@header({
4444
name: "X-P2-core-keytrial",
45+
format: "simple",
4546
})
46-
keyTrial: polyproto.core.models.KeyTrialCompleted,
47+
keyTrial: polyproto.core.models.KeyTrialCompleted[],
4748
): {
4849
@statusCode statusCode: 200 | 202;
4950
};
5051

5152
/**
52-
* Stop an in-progress or existing redirection process. Requires a completed key trial.
53-
* // TODO: Does it? ^ If yes, specify for which cert(s)
53+
* Stop an in-progress or existing redirection process.
5454
*
5555
* @param removeActorFid The FID of the actor to which a redirect should no longer exist
5656
*/
5757
@route("/redirect")
5858
@delete
59+
@useAuth(BearerAuth)
5960
@added(Version.`v1.0-beta.1`)
6061
@summary("Remove a redirect for migrating identities")
61-
op removeRedirect(
62-
@query removeActorFid: string,
62+
op removeRedirect(@query removeActorFid: string): {
63+
@statusCode statusCode: 204;
6364

64-
@doc("A completed `KeyTrial`.")
6565
@header({
66-
name: "X-P2-core-keytrial",
66+
name: "Content-Length",
6767
})
68-
keyTrial: polyproto.core.models.KeyTrialCompleted,
69-
): {
70-
@statusCode statusCode: 200;
71-
@body body: polyproto.core.models.KeyTrial;
68+
contentLength: 0;
7269
} | {
7370
@statusCode statusCode: 400;
7471
};
@@ -145,6 +142,7 @@ namespace Migration {
145142

146143
/**
147144
* Request allowing message re-signing. To fulfill this action, a key trial must be passed.
145+
* Unlocks message re-signing for messages signed with keys for which a key trial has been passed.
148146
* @param allowedResigningKeys List of PEM encoded `SubjectPublicKeyInfo`s. Only key pairs mentioned in this list are allowed to re-sign messages after the key trial has been passed.
149147
*/
150148
@route("/messages")
@@ -157,11 +155,12 @@ namespace Migration {
157155
allowedResigningKeys: string[];
158156
},
159157

160-
@doc("A completed `KeyTrial`.")
158+
@doc("A list of completed `KeyTrial`s.")
161159
@header({
162160
name: "X-P2-core-keytrial",
161+
format: "simple",
163162
})
164-
keyTrial: polyproto.core.models.KeyTrialCompleted, // TODO doesnt this have to be an array?
163+
keyTrial: polyproto.core.models.KeyTrialCompleted[],
165164
): {
166165
@statusCode statusCode: 200 | 403;
167166
};
@@ -293,15 +292,16 @@ namespace Migration {
293292
@route("/data")
294293
@delete
295294
@added(Version.`v1.0-beta.1`)
296-
@summary("Delete own actor data from the sever")
295+
@summary("Delete own actor data from the server")
297296
op deleteData(
298297
@query breakRedirect?: boolean = false,
299298

300-
@doc("A completed `KeyTrial`.")
299+
@doc("A list of completed `KeyTrial`s.")
301300
@header({
302301
name: "X-P2-core-keytrial",
302+
format: "simple",
303303
})
304-
keyTrial: polyproto.core.models.KeyTrialCompleted, // TODO: Must be array. re-evaluate if keytrial responses should be part of header. i think they are better suited as a body
304+
keyTrial: polyproto.core.models.KeyTrialCompleted[],
305305
): {
306306
@statusCode statusCode: 204;
307307

0 commit comments

Comments
 (0)