Skip to content

Commit f8649cb

Browse files
committed
feat(grpc): add v3 SyncKeys
1 parent c97ae34 commit f8649cb

12 files changed

Lines changed: 454 additions & 957 deletions

File tree

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,7 @@ Supported platforms can be retrieved via the REST API: [/v1/platforms](https://p
175175
- [Installation Guide](INSTALL.md) - Detailed setup instructions
176176
- [gRPC API](docs/grpc.md) - gRPC interface documentation
177177
- [REST API](docs/rest.md) - REST API reference
178-
- [Content Specifications](docs/specification.md) - Payload format specs
179-
- [REST API (Swagger)](https://publisher.smswithoutborders.com/docs) - Interactive API reference
180178
- [Platform Adapters](platforms/README.md) - Extending functionality
181-
- [Reliability Testing](docs/reliability_test.md) - Testing guidelines
182179

183180
## Testing
184181

docs/dfd/adapters_architecture.md

Lines changed: 0 additions & 132 deletions
This file was deleted.

docs/dfd/store_tokens_locally.md

Lines changed: 0 additions & 71 deletions
This file was deleted.

docs/grpc.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- [v3: Get PNBA Code](#v3-get-pnba-code)
1212
- [v3: Exchange PNBA Code and Store Token](#v3-exchange-pnba-code-and-store-token)
1313
- [v3: Revoke and Delete PNBA Token](#v3-revoke-and-delete-pnba-token)
14+
- [v3: Sync Keys](#v3-sync-keys)
1415
- [Version 2 API](#version-2-api)
1516
- [v2: Get OAuth2 Authorization URL](#v2-get-oauth2-authorization-url)
1617
- [v2: Exchange OAuth2 Code and Store Token](#v2-exchange-oauth2-code-and-store-token)
@@ -392,6 +393,52 @@ grpcurl -plaintext \
392393

393394
---
394395

396+
### v3: Sync Keys
397+
398+
Syncs the client and server ephemeral key pools for a token. It rotates the client's key pool with a new set of 256 client ephemeral public keys, and the server generates a new pool of 256 server ephemeral keys.
399+
400+
**Request:** `SyncKeysRequest`
401+
402+
| Field | Type | Required | Description |
403+
| :--- | :--- | :--- | :--- |
404+
| token_id | bytes | Yes | Unique identifier for the stored token |
405+
| key_id | uint32 | Yes | The current key index used for encrypting the token |
406+
| client_ephemeral_public_keys | list[PublicKey] | Yes | Exactly 256 new ephemeral public keys generated by the client |
407+
408+
**Response:** `SyncKeysResponse`
409+
410+
| Field | Type | Description |
411+
| :--- | :--- | :--- |
412+
| success | bool | Operation success |
413+
| message | string | Response message |
414+
| server_ephemeral_public_keys | list[PublicKey] | Exactly 256 ephemeral public keys generated by the server |
415+
416+
**Example:**
417+
418+
```bash
419+
grpcurl -plaintext \
420+
-H 'x-payload-bin: <encrypted_payload_binary>' \
421+
-H 'x-public-key-bin: <client_pk_binary>' \
422+
-H 'x-key-id: <key_id>' \
423+
-H 'x-nonce-bin: <nonce_binary>' \
424+
-H 'x-timestamp: <timestamp>' \
425+
-d @ \
426+
-proto protos/v3/publisher.proto \
427+
<your_host>:<your_port> publisher.v3.Publisher/SyncKeys <<EOF
428+
{
429+
"token_id": "<token_id_binary>",
430+
"key_id": 123,
431+
"client_ephemeral_public_keys": [
432+
{"key_id": 0, "public_key": "..."},
433+
... 254 more keys ...
434+
{"key_id": 255, "public_key": "..."}
435+
]
436+
}
437+
EOF
438+
```
439+
440+
---
441+
395442
## Version 2 API
396443

397444
**Package:** `publisher.v2`

0 commit comments

Comments
 (0)