@serve.zone/interfaces 16.8.0 → 17.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/changelog.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 2026-07-21 - 17.0.0
4
+
5
+ ### Breaking Changes
6
+
7
+ - make gateway-client credential handover explicitly two-phase (gateway)
8
+ - Provisioning now returns an unfinalized candidate credential without revoking existing credentials.
9
+ - Add candidate-authenticated finalization to activate credentials and revoke superseded client-bound credentials.
10
+ - Remove caller-selected gateway client finalization and provisioning-time revocation counts from the gateway API contract.
11
+
3
12
  ## 2026-07-21 - 16.8.0
4
13
 
5
14
  ### Features
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@serve.zone/interfaces',
6
- version: '16.8.0',
6
+ version: '17.0.0',
7
7
  description: 'Shared TypeScript interfaces and TypedRequest contracts for the serve.zone ecosystem.'
8
8
  };
9
9
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx3QkFBd0I7SUFDOUIsT0FBTyxFQUFFLFFBQVE7SUFDakIsV0FBVyxFQUFFLHVGQUF1RjtDQUNyRyxDQUFBIn0=
@@ -160,11 +160,20 @@ export interface IGatewayClientProvisioningSpec {
160
160
  capabilities: IGatewayTokenCapabilities;
161
161
  enabled?: boolean;
162
162
  }
163
- /** One-time credential material returned after durable token creation. */
163
+ /**
164
+ * One-time credential material returned after durable token creation.
165
+ *
166
+ * Provisioning creates a candidate only. Existing client-bound credentials
167
+ * remain active until the candidate authenticates the explicit finalization
168
+ * request, preventing a lost provisioning response from locking out the
169
+ * gateway client.
170
+ */
164
171
  export interface IGatewayClientCredential {
165
172
  tokenId: string;
166
173
  tokenValue: string;
167
174
  issuedAt: number;
175
+ state: 'candidate';
176
+ finalizationRequired: true;
168
177
  }
169
178
  export type TGatewayClientProvisioningAction = 'created' | 'updated' | 'unchanged';
170
179
  /**
@@ -33,10 +33,10 @@ export interface IReq_GetGatewayClientContext extends plugins.typedrequestInterf
33
33
  };
34
34
  }
35
35
  /**
36
- * Admin-only idempotent gateway-client upsert and credential handover.
37
- * A newly created durable client-bound credential is returned once, then prior
38
- * credentials bound to that client are revoked. Bootstrap and admin credentials
39
- * are never part of that revocation set.
36
+ * Admin-only gateway-client upsert and candidate credential issue.
37
+ * Provisioning never revokes prior client-bound credentials. The returned
38
+ * candidate must prove possession through finalizeGatewayClientCredential
39
+ * before the gateway activates it and revokes superseded siblings.
40
40
  */
41
41
  export interface IReq_ProvisionGatewayClientCredential extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_ProvisionGatewayClientCredential> {
42
42
  method: 'provisionGatewayClientCredential';
@@ -52,9 +52,35 @@ export interface IReq_ProvisionGatewayClientCredential extends plugins.typedrequ
52
52
  success: true;
53
53
  action: TGatewayClientProvisioningAction;
54
54
  gatewayClient: IGatewayClient;
55
- /** One-time credential material returned only after durable creation. */
55
+ /** One-time, unfinalized credential material returned after durable creation. */
56
56
  credential: IGatewayClientCredential;
57
+ message?: string;
58
+ } | {
59
+ success: false;
60
+ message: string;
61
+ };
62
+ }
63
+ /**
64
+ * Candidate-authenticated completion of a gateway-client credential handover.
65
+ * The gateway resolves client ownership from the candidate token itself; the
66
+ * caller cannot select a gateway client or finalize another credential.
67
+ */
68
+ export interface IReq_FinalizeGatewayClientCredential extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_FinalizeGatewayClientCredential> {
69
+ method: 'finalizeGatewayClientCredential';
70
+ request: {
71
+ /** The one-time candidate token value returned by provisioning. */
72
+ apiToken: string;
73
+ /** Must identify the same candidate credential as apiToken. */
74
+ tokenId: string;
75
+ /** Admin/operator identities cannot finalize a candidate by substitution. */
76
+ identity?: never;
77
+ };
78
+ response: {
79
+ success: true;
80
+ gatewayClientId: string;
81
+ tokenId: string;
57
82
  revokedCredentialCount: number;
83
+ finalizedAt: number;
58
84
  message?: string;
59
85
  } | {
60
86
  success: false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serve.zone/interfaces",
3
- "version": "16.8.0",
3
+ "version": "17.0.0",
4
4
  "private": false,
5
5
  "description": "Shared TypeScript interfaces and TypedRequest contracts for the serve.zone ecosystem.",
6
6
  "exports": {
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@serve.zone/interfaces',
6
- version: '16.8.0',
6
+ version: '17.0.0',
7
7
  description: 'Shared TypeScript interfaces and TypedRequest contracts for the serve.zone ecosystem.'
8
8
  }
@@ -190,11 +190,20 @@ export interface IGatewayClientProvisioningSpec {
190
190
  enabled?: boolean;
191
191
  }
192
192
 
193
- /** One-time credential material returned after durable token creation. */
193
+ /**
194
+ * One-time credential material returned after durable token creation.
195
+ *
196
+ * Provisioning creates a candidate only. Existing client-bound credentials
197
+ * remain active until the candidate authenticates the explicit finalization
198
+ * request, preventing a lost provisioning response from locking out the
199
+ * gateway client.
200
+ */
194
201
  export interface IGatewayClientCredential {
195
202
  tokenId: string;
196
203
  tokenValue: string;
197
204
  issuedAt: number;
205
+ state: 'candidate';
206
+ finalizationRequired: true;
198
207
  }
199
208
 
200
209
  export type TGatewayClientProvisioningAction = 'created' | 'updated' | 'unchanged';
@@ -58,10 +58,10 @@ export interface IReq_GetGatewayClientContext extends plugins.typedrequestInterf
58
58
  }
59
59
 
60
60
  /**
61
- * Admin-only idempotent gateway-client upsert and credential handover.
62
- * A newly created durable client-bound credential is returned once, then prior
63
- * credentials bound to that client are revoked. Bootstrap and admin credentials
64
- * are never part of that revocation set.
61
+ * Admin-only gateway-client upsert and candidate credential issue.
62
+ * Provisioning never revokes prior client-bound credentials. The returned
63
+ * candidate must prove possession through finalizeGatewayClientCredential
64
+ * before the gateway activates it and revokes superseded siblings.
65
65
  */
66
66
  export interface IReq_ProvisionGatewayClientCredential extends plugins.typedrequestInterfaces.implementsTR<
67
67
  plugins.typedrequestInterfaces.ITypedRequest,
@@ -81,9 +81,41 @@ export interface IReq_ProvisionGatewayClientCredential extends plugins.typedrequ
81
81
  success: true;
82
82
  action: TGatewayClientProvisioningAction;
83
83
  gatewayClient: IGatewayClient;
84
- /** One-time credential material returned only after durable creation. */
84
+ /** One-time, unfinalized credential material returned after durable creation. */
85
85
  credential: IGatewayClientCredential;
86
+ message?: string;
87
+ }
88
+ | {
89
+ success: false;
90
+ message: string;
91
+ };
92
+ }
93
+
94
+ /**
95
+ * Candidate-authenticated completion of a gateway-client credential handover.
96
+ * The gateway resolves client ownership from the candidate token itself; the
97
+ * caller cannot select a gateway client or finalize another credential.
98
+ */
99
+ export interface IReq_FinalizeGatewayClientCredential extends plugins.typedrequestInterfaces.implementsTR<
100
+ plugins.typedrequestInterfaces.ITypedRequest,
101
+ IReq_FinalizeGatewayClientCredential
102
+ > {
103
+ method: 'finalizeGatewayClientCredential';
104
+ request: {
105
+ /** The one-time candidate token value returned by provisioning. */
106
+ apiToken: string;
107
+ /** Must identify the same candidate credential as apiToken. */
108
+ tokenId: string;
109
+ /** Admin/operator identities cannot finalize a candidate by substitution. */
110
+ identity?: never;
111
+ };
112
+ response:
113
+ | {
114
+ success: true;
115
+ gatewayClientId: string;
116
+ tokenId: string;
86
117
  revokedCredentialCount: number;
118
+ finalizedAt: number;
87
119
  message?: string;
88
120
  }
89
121
  | {