Skip to content

Commit d4cadd0

Browse files
authored
Write 1.2.1 of the REST API spec (#195)
This basically adds the ability to set a CA certificate authenticator and identity in the call to startMultipeerReplciator. The TDK client will provide the cert and private key to use for both, so the test server need only do the following: 1. Convert the PEM bytes of the certificate into an appropriate platform type for the authenticator 2. Convert Base64 PKCS#12 data into bytes for using in TLSIdentity.CreateIdentity
1 parent cac5e75 commit d4cadd0

1 file changed

Lines changed: 44 additions & 4 deletions

File tree

spec/api/api.yaml

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ info:
4646
```
4747
4848
Changes
49+
1.2.1 (06/04/2025)
50+
* Add authenticator property to [/startMultipeerReplicator](#operation/startMultipeerReplicator)
51+
4952
1.2.0 (04/09/2025)
5053
* Add [/startMultipeerReplicator](#operation/startMultipeerReplicator),
5154
* Add [/stopMultipeerReplicator](#operation/stopMultipeerReplicator) endpoint
@@ -131,7 +134,7 @@ info:
131134
* Changed DocumentReplication.flags type from int to array of enums.
132135
* Added 'enableDocumentListener' to ReplicatorConfiguration.
133136
* Added a note that any enum values are case insensitive.
134-
version: 1.2.0
137+
version: 1.2.1
135138
tags:
136139
- name: API
137140
description: The API endpoints of the test server
@@ -833,16 +836,17 @@ paths:
833836
- API
834837
summary: Starts a Multipeer replicator
835838
description: |-
836-
Starts a P2P listener so that the device can act as the passive side of a P2P replication.
839+
Starts a multipeer replicator to create a mesh of connected clients.
837840
operationId: startMultipeerReplicator
838841
requestBody:
839842
description: |-
840-
The request object containing the collections to share and, optionally, the port to listen on.
843+
The request object containing the collections to share and the peer group ID. Optionally,
844+
it can contain an authenticator as well. The default (null) behavior is accept all connections.
841845
content:
842846
application/json:
843847
schema:
844848
type: object
845-
required: ['peerGroupID', 'database', 'collections']
849+
required: ['peerGroupID', 'database', 'collections', 'identity']
846850
properties:
847851
peerGroupID:
848852
type: string
@@ -854,6 +858,10 @@ paths:
854858
type: array
855859
items:
856860
$ref: "#/components/schemas/ReplicationCollection"
861+
identity:
862+
$ref: '#/components/schemas/MultipeerReplicatorIdentity'
863+
authenticator:
864+
$ref: '#/components/schemas/MultipeerReplicatorCAAuthenticator'
857865
required: true
858866
responses:
859867
'200':
@@ -1276,6 +1284,38 @@ components:
12761284
example: '1234567890abcdef'
12771285
status:
12781286
$ref: '#/components/schemas/ReplicatorStatus'
1287+
MultipeerReplicatorIdentity:
1288+
description: |-
1289+
MultipeerReplicatorIdentity is used to specify a TLS certificate and key particular
1290+
for a multipeer replciator so that it can identify itself.
1291+
type: object
1292+
required: ['encoding', 'data']
1293+
properties:
1294+
encoding:
1295+
type: string
1296+
enum: ['PKCS12']
1297+
description: The type of data contained in the data field.
1298+
data:
1299+
type: string
1300+
format: byte
1301+
description: Base-64 encoded data of the format specified in encoding
1302+
password:
1303+
type: string
1304+
example: 'pass'
1305+
description: The password if the data is password protected
1306+
MultipeerReplicatorCAAuthenticator:
1307+
description: |-
1308+
MultipeerReplicatorCAAuthenticator is used to authenticate the replicator using a CA certificate.
1309+
The certificate is expected to be in PEM format, and any accepted client must have a certificate
1310+
signed by the CA certificate.
1311+
type: object
1312+
required: ['type', 'certificate']
1313+
properties:
1314+
'type':
1315+
type: string
1316+
enum: ['CA-CERT']
1317+
certificate:
1318+
type: string
12791319
ResetConfiguration:
12801320
description: |-
12811321
ResetConfiguration describes how the databases will be setup after the reset.

0 commit comments

Comments
 (0)