Rotate the PCR notice signing secret
Changes the secret the PCR signs the connectionβs notices with. A new secret is a new connection: connectionToken and noticeEndpointUrl change too.
Providers: Lerian (PCR).
How it works
- The rotation runs in five steps. (1) A new token and a PCR idempotency key are recorded as a pending rotation (
pendingOperationROTATE). (2) The PCR rotates the secret under that key and signs with the new one from then on. (3) The new token is recorded with the new secret as the current connection. The previous connection keeps authenticating notices untilpreviousConnectionValidUntil. (4) The subscriptionβs address at the PCR moves to the new tokenβs. (5) The new token is promoted. - The answer is the subscription as stored afterwards. The secret is never returned or logged.
- From step 3 on, a notice the PCR delivers to the previous token, signed with the new secret, is accepted. A notice refused before that, or after the window, comes back through the PCRβs retries or
POST /v1/collections/connection/subscription/deliveries/{delivery_id}/redeliver. A notice delivered twice is stored once. - Run
POST /v1/collections/connection/subscription/syncfirst when the connection has no subscription, has a creation pending, or its address at the PCR is not the current tokenβs (as a failure at step 4 leaves it). Otherwise the rotation is refused withPBP-0802. This keeps another failure at step 4 from leaving the PCR signing with a secret its address does not accept. - Exception: a rotation pending for more than 24 hours is replaced by the new one, whatever the address. Step 4 then moves the address.
- Failures are recorded and answered as in
POST /v1/collections/connection/subscription/sync. - Before step 3, a failed rotation stays pending. The same request under the same
Idempotency-Key, orPOST /v1/collections/connection/subscription/sync, finishes it with the same secret within 24 hours ofpendingSince. A rotation pending longer is replaced by a new one. - A failure at step 4 returns
200with the subscription as recorded: the new token current,syncStateSYNC_FAILEDwith the problem inlastSyncError, and the previous address still at the PCR.POST /v1/collections/connection/subscription/syncmoves it. TheIdempotency-Keykeeps that answer. - If the PCR no longer has the subscription, the rotation ends and the subscription is created again, with a new token and a new secret. If that creation fails after step 3, the new token stays current, the failure is answered as in
POST /v1/collections/connection/subscription/sync, and no audit entry records the rotation.POST /v1/collections/connection/subscription/syncfinishes the creation. - Every other rotation that reaches step 3 is recorded in the collections audit trail, with its
reasonand the identity that asked.
POST
Rotate the PCR notice signing secret
Headers
Body
application/json
Response
OK. The subscription as stored afterwards. After a failure at step 4, syncState is SYNC_FAILED.
How the subscription at the PCR compares with what collections expects. NOT_SUBSCRIBED: no subscription. SYNCED: address, event types and state match. DIVERGENT: the PCR holds it differently, for example paused or changed in the PCR's own console. SYNC_FAILED: the last attempt failed (lastSyncError).
Available options:
NOT_SUBSCRIBED, SYNCED, DIVERGENT, SYNC_FAILED Example:
"NOT_SUBSCRIBED"

