You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 15, 2025. It is now read-only.
* Request a new ID-Cert, usually done when wanting to authenticate a new session, or after
22
+
* an ID-Cert has been revoked, to re-authenticate a session.
23
+
*/
21
24
@route("/idcert")
22
25
@summary("Get a new ID-Cert")
23
26
@added(Version.`v1.0-alpha.1`)
24
27
@post
25
28
@tag("Sensitive Actions")
26
-
/**
27
-
* Request a new ID-Cert, usually done when wanting to authenticate a new session, or after
28
-
* an ID-Cert has been revoked, to re-authenticate a session.
29
-
*/
30
29
opnewIdCert(
31
30
@doc("Sensitive actions require a second factor of authentication to be executed. Read [section 4.1.2 of the protocol definition](https://docs.polyphony.chat/Protocol%20Specifications/core/#412-sensitive-actions) for more information.")
@doc("Contains your new ID-Cert in PEM encoding, along with a new session token.")
36
-
@statusCodestatusCode:201;
37
-
@bodynewIdCert: {
38
-
@doc("The generated [ID-Cert](/Protocol%20Specifications/core/#71-home-server-signed-certificates-for-public-client-identity-keys-id-cert) in PEM format.")
39
-
@example("------BEGIN CERTIFICATE------...")
40
-
id_cert:string,
41
-
@doc("An authorization secret, called a \"session token\", valid for this `id_cert`/session.")
42
-
token:string
43
-
}
31
+
@header({
32
+
name:"X-P2-Sensitive-Solution",
33
+
})
34
+
sensitiveSolution:string,
35
+
36
+
@bodycsr:string,
37
+
): {
38
+
@doc("Contains your new ID-Cert in PEM encoding, along with a new session token.")
39
+
@statusCode
40
+
statusCode:201;
41
+
42
+
@bodynewIdCert: {
43
+
@doc("The generated [ID-Cert](/Protocol%20Specifications/core/#71-home-server-signed-certificates-for-public-client-identity-keys-id-cert) in PEM format.")
44
+
@example("------BEGIN CERTIFICATE------...")
45
+
id_cert:string;
46
+
47
+
@doc("An authorization secret, called a \"session token\", valid for this `id_cert`/session.")
48
+
token:string;
49
+
};
44
50
};
45
51
46
-
@route("/session/keymaterial")
47
-
@summary("Upload encrypted private key material")
48
-
@added(Version.`v1.0-alpha.1`)
49
-
@post
50
52
/**
51
53
* Upload encrypted private key material to the server for later retrieval. The size of
52
-
* the individual array elements must not exceed
53
-
* the server's maximum upload size for this route. This is usually not more than 10kb and can be as
54
+
* the individual array elements must not exceed
55
+
* the server's maximum upload size for this route. This is usually not more than 10kb and can be as
54
56
* low as 800 bytes, depending on the server configuration.
55
57
* @parampkm Array of encrypted private key material objects.
56
58
*/
57
-
opuploadEncryptedPKM(@body@minItems(1) pkm:
58
-
polyproto.core.models.EncryptedPKM[]): {
59
-
@statusCodestatusCode:201;
60
-
} | {
61
-
@doc("Used, if the `serial_number` does not match any known ID-Cert from this actor.")
62
-
@statusCodestatusCode:404;
63
-
} | {
64
-
@doc("Status code for when the server already has key material for the given `serial_number`. The client would need to delete the existing key material before uploading new key material.")
65
-
@statusCodestatusCode:409;
66
-
} | {
67
-
@doc("Uploaded key material exceeds the server's maximum upload size.")
@doc("Used, if the `serial_number` does not match any known ID-Cert from this actor.")
71
+
@statusCode
72
+
statusCode:404;
73
+
}
74
+
| {
75
+
@doc("Status code for when the server already has key material for the given `serial_number`. The client would need to delete the existing key material before uploading new key material.")
76
+
@statusCode
77
+
statusCode:409;
78
+
}
79
+
| {
80
+
@doc("Uploaded key material exceeds the server's maximum upload size.")
81
+
@statusCode
82
+
statusCode:413;
83
+
};
84
+
75
85
/**
76
86
* Retrieve encrypted private key material from the server. The `serial_numbers`, if
77
87
* provided, must match the serial numbers of ID-Certs that the client has uploaded key
78
88
* material for. If no `serial_numbers` are provided, the server will return all key
@doc("Returned, if no `serial_numbers` are provided and the client has not uploaded any key material.")
86
-
@statusCodestatusCode:204;
87
-
@header({name:"Content-Length"}) contentLength:0;
100
+
@statusCode
101
+
statusCode:204;
102
+
103
+
@header({
104
+
name:"Content-Length",
105
+
})
106
+
contentLength:0;
88
107
} | {
89
108
@doc("Returned, if none of the `serial_numbers` match any known ID-Certs from this actor.")
90
-
@statusCodestatusCode:404;
109
+
@statusCode
110
+
statusCode:404;
91
111
};
92
112
113
+
/**
114
+
* Delete encrypted private key material from the server. The `serial_number(s)`, must match
115
+
* the serial numbers of ID-Certs that the client has uploaded key material for.
116
+
*/
93
117
@route("/session/keymaterial")
94
118
@tag("Sensitive Actions")
95
119
@summary("Delete encrypted private key material")
96
120
@added(Version.`v1.0-alpha.1`)
97
121
@delete
98
-
/**
99
-
* Delete encrypted private key material from the server. The `serial_number(s)`, must match
100
-
* the serial numbers of ID-Certs that the client has uploaded key material for.
101
-
*/
102
122
opdeleteEncryptedPKM(
103
123
@doc("Sensitive actions require a second factor of authentication to be executed. Read [section 4.1.2 of the protocol definition](https://docs.polyphony.chat/Protocol%20Specifications/core/#412-sensitive-actions) for more information.")
@doc("Returned, if none of the `serial_numbers` match any known ID-Certs from this actor.")
110
-
@statusCodestatusCode:404;
138
+
@statusCode
139
+
statusCode:404;
111
140
};
112
-
141
+
142
+
/**
143
+
* Retrieve the maximum upload size for encrypted private key material, in bytes.
144
+
*
145
+
* @returns The upload size limit, in bytes.
146
+
*/
113
147
@route("/session/keymaterial/size")
114
148
@summary("Get encrypted private key material upload size limit")
115
149
@added(Version.`v1.0-alpha.1`)
116
150
@get
117
151
@useAuth(NoAuth)
118
-
/**
119
-
* Retrieve the maximum upload size for encrypted private key material, in bytes.
120
-
*
121
-
* @returns The upload size limit, in bytes.
122
-
*/
123
152
opencryptedPKMsizeLimit(): {
124
-
@header({name:"X-MAX-PAYLOAD-SIZE"}) size:uint32;
153
+
@header({
154
+
name:"X-MAX-PAYLOAD-SIZE",
155
+
})
156
+
size:uint32;
125
157
@statusCodestatusCode:200;
126
158
};
127
159
160
+
/**
161
+
* Invalidate a session and its' associated ID-Cert by providing the session ID associated
162
+
* with it.
163
+
*/
128
164
@route("/session")
129
165
@delete
130
166
@added(Version.`v1.0-alpha.1`)
131
167
@summary("Delete/Revoke Session")
132
168
@useAuth(BearerAuth)
133
-
/**
134
-
* Invalidate a session and its' associated ID-Cert by providing the session ID associated
135
-
* with it.
136
-
*/
137
169
opdeleteSession(
138
170
@doc("Sensitive actions require a second factor of authentication to be executed. Read [section 4.1.2 of the protocol definition](https://docs.polyphony.chat/Protocol%20Specifications/core/#412-sensitive-actions) for more information.")
* Rotate the server's identity key. Requires server administrator permissions.
189
+
* @returns The servers' new ID-Cert, encoded as PEM
190
+
*/
148
191
@route("/key/server")
149
192
@summary("Rotate Server Identity Key")
150
193
@added(Version.`v1.0-alpha.1`)
151
194
@post
152
195
@useAuth(BearerAuth)
153
196
@tag("Sensitive Actions")
154
-
/**
155
-
* Rotate the server's identity key. Requires server administrator permissions.
156
-
* @returns The servers' new ID-Cert, encoded as PEM
157
-
*/
158
-
opname(@doc("Sensitive actions require a second factor of authentication to be executed. Read [section 4.1.2 of the protocol definition](https://docs.polyphony.chat/Protocol%20Specifications/core/#412-sensitive-actions) for more information.")
@doc("Sensitive actions require a second factor of authentication to be executed. Read [section 4.1.2 of the protocol definition](https://docs.polyphony.chat/Protocol%20Specifications/core/#412-sensitive-actions) for more information.")
199
+
@header({
200
+
name:"X-P2-Sensitive-Solution",
201
+
})
202
+
sensitiveSolution:string,
203
+
):string;
160
204
}
161
205
162
206
@tag("Federated Identity - Registration not required")
163
207
namespaceUnregistered {
164
-
@route("/challenge")
165
-
@summary("Receive a challenge string")
166
-
@useAuth(BearerAuth)
167
-
@added(Version.`v1.0-alpha.1`)
168
-
@get
169
-
/**
170
-
* Request a challenge string. See the corresponding
0 commit comments