Skip to content
This repository was archived by the owner on Jan 2, 2026. It is now read-only.

Commit b552ef5

Browse files
committed
replace timestamp with notBefore and notAfter, add todo
1 parent ba6a883 commit b552ef5

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

api/src/core/routes/federated_identity.tsp

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ namespace FederatedIdentity {
8484
} | {
8585
@doc("Returned, if no `serial_numbers` are provided and the client has not uploaded any key material.")
8686
@statusCode statusCode: 204;
87+
@header({name: "Content-Length"}) contentLength: 0;
8788
} | {
8889
@doc("Returned, if none of the `serial_numbers` match any known ID-Certs from this actor.")
8990
@statusCode statusCode: 404;
@@ -103,6 +104,7 @@ namespace FederatedIdentity {
103104
@header({name: "X-P2-Sensitive-Solution"}) sensitiveSolution: string,
104105
@query serials: uint64[]): {
105106
@statusCode statusCode: 204;
107+
@header({name: "Content-Length"}) contentLength: 0;
106108
} | {
107109
@doc("Returned, if none of the `serial_numbers` match any known ID-Certs from this actor.")
108110
@statusCode statusCode: 404;
@@ -142,6 +144,19 @@ namespace FederatedIdentity {
142144
} | {
143145
@statusCode statusCode: 404;
144146
};
147+
148+
@route("/key/server")
149+
@summary("Rotate Server Identity Key")
150+
@added(Version.`v1.0-alpha.1`)
151+
@post
152+
@useAuth(BearerAuth)
153+
@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+
op name(@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.")
159+
@header({name: "X-P2-Sensitive-Solution"}) sensitiveSolution: string,): string;
145160
}
146161

147162
@tag("Federated Identity - Registration not required")
@@ -161,19 +176,6 @@ namespace FederatedIdentity {
161176
@body challengeStringResponse: polyproto.core.models.ChallengeStringResponse
162177
};
163178

164-
@route("/key/server")
165-
@summary("Rotate Server Identity Key")
166-
@added(Version.`v1.0-alpha.1`)
167-
@post
168-
@useAuth(BearerAuth)
169-
@tag("Sensitive Actions")
170-
/**
171-
* Rotate the server's identity key. Requires server administrator permissions.
172-
* @returns The servers' new ID-Cert, encoded as PEM
173-
*/
174-
op name(@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.")
175-
@header({name: "X-P2-Sensitive-Solution"}) sensitiveSolution: string,): string;
176-
177179
@route("/idcert/server")
178180
@get
179181
@added(Version.`v1.0-alpha.1`)
@@ -210,13 +212,12 @@ namespace FederatedIdentity {
210212
/**
211213
* Request the ID-Certs of a specific actor. The specified actor must be registered on this server.
212214
* @param fid The ID of the actor whose ID-Cert(s) should be returned.
213-
* @param timestamp An optional UNIX timestamp to retrieve the ID-Cert the actor had at that
214-
* point in time, instead of the current one.
215+
* @param notBefore: Return only ID-Certs from at or after a specific point in time. UNIX 64 bit timestamp.
216+
* @param notAfter: Return only ID-Certs from at or before a specific point in time. UNIX 64 bit timestamp.
215217
* @param session_id Optionally, return only the ID-Certs matching a specific `session_id`.
216-
* @param body timestamp: UNIX-Timestamp. If specified, the server will return the ID-Cert(s) which the actor had at the specified time. session_id: Request the ID-Cert for a specific session ID.
217218
* @returns JSON-Array of Object(s), each object containing "id_cert" (PEM encoded ID-Cert) and "invalidated" (boolean). An ID-Cert is considered invalidated, if the server or actor choose to revoke the validity of the ID-Cert before the lifetime of the certificate was scheduled to end.
218219
*/
219-
op actorCerts(@path fid: string, @query timestamp?: uint64, @query session_id?: string): {
220+
op actorCerts(@path fid: string, @query notBefore?: uint64, @query notAfter?: uint64, @query session_id?: string): {
220221
@statusCode statusCode: 200;
221222
@body response: {
222223
@doc("PEM encoded ID-Cert")
@@ -247,7 +248,6 @@ namespace FederatedIdentity {
247248
}
248249
}
249250

250-
/*
251-
TODO: Missing routes:
252-
- Changing actor federation ID
253-
*/
251+
/**
252+
* TODO: ID-Cert caching cache number
253+
*/

0 commit comments

Comments
 (0)