@smartcrab/contracts-management 0.6.3 → 0.7.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/dist/clients.d.ts CHANGED
@@ -71,6 +71,7 @@ export declare const clientSchema: z.ZodObject<{
71
71
  none: "none";
72
72
  }>;
73
73
  require_pkce: z.ZodBoolean;
74
+ require_nonce: z.ZodBoolean;
74
75
  status: z.ZodEnum<{
75
76
  active: "active";
76
77
  disabled: "disabled";
@@ -120,6 +121,7 @@ export declare const clientListResponseSchema: z.ZodObject<{
120
121
  none: "none";
121
122
  }>;
122
123
  require_pkce: z.ZodBoolean;
124
+ require_nonce: z.ZodBoolean;
123
125
  status: z.ZodEnum<{
124
126
  active: "active";
125
127
  disabled: "disabled";
@@ -157,6 +159,7 @@ export declare const clientCreateRequestSchema: z.ZodObject<{
157
159
  none: "none";
158
160
  }>;
159
161
  require_pkce: z.ZodDefault<z.ZodBoolean>;
162
+ require_nonce: z.ZodDefault<z.ZodBoolean>;
160
163
  mobile_app: z.ZodOptional<z.ZodObject<{
161
164
  app_scheme: z.ZodString;
162
165
  ios_bundle_id: z.ZodNullable<z.ZodString>;
@@ -194,6 +197,7 @@ export declare const clientCreateResponseSchema: z.ZodObject<{
194
197
  none: "none";
195
198
  }>;
196
199
  require_pkce: z.ZodBoolean;
200
+ require_nonce: z.ZodBoolean;
197
201
  status: z.ZodEnum<{
198
202
  active: "active";
199
203
  disabled: "disabled";
@@ -232,6 +236,7 @@ export declare const clientGetResponseSchema: z.ZodObject<{
232
236
  none: "none";
233
237
  }>;
234
238
  require_pkce: z.ZodBoolean;
239
+ require_nonce: z.ZodBoolean;
235
240
  status: z.ZodEnum<{
236
241
  active: "active";
237
242
  disabled: "disabled";
@@ -261,6 +266,7 @@ export declare const clientUpdateRequestSchema: z.ZodObject<{
261
266
  none: "none";
262
267
  }>>;
263
268
  require_pkce: z.ZodOptional<z.ZodBoolean>;
269
+ require_nonce: z.ZodOptional<z.ZodBoolean>;
264
270
  status: z.ZodOptional<z.ZodEnum<{
265
271
  active: "active";
266
272
  disabled: "disabled";
@@ -296,6 +302,7 @@ export declare const clientUpdateResponseSchema: z.ZodObject<{
296
302
  none: "none";
297
303
  }>;
298
304
  require_pkce: z.ZodBoolean;
305
+ require_nonce: z.ZodBoolean;
299
306
  status: z.ZodEnum<{
300
307
  active: "active";
301
308
  disabled: "disabled";
package/dist/clients.js CHANGED
@@ -64,6 +64,8 @@ export const clientSchema = z.strictObject({
64
64
  allowed_resources: z.array(httpsUrlSchema).max(20),
65
65
  token_endpoint_auth_method: tokenEndpointAuthMethodSchema,
66
66
  require_pkce: z.boolean(),
67
+ /** design.md §32.1: when true, OpenID Connect authorization requests require nonce. */
68
+ require_nonce: z.boolean(),
67
69
  status: clientStatusSchema,
68
70
  mobile_app: mobileAppSchema.nullable(),
69
71
  created_at: z.iso.datetime(),
@@ -91,6 +93,7 @@ export const clientCreateRequestSchema = z.strictObject({
91
93
  allowed_resources: z.array(httpsUrlSchema).max(20).default([]),
92
94
  token_endpoint_auth_method: tokenEndpointAuthMethodSchema,
93
95
  require_pkce: z.boolean().default(true),
96
+ require_nonce: z.boolean().default(true),
94
97
  mobile_app: mobileAppSchema.optional(),
95
98
  });
96
99
  /**
@@ -118,6 +121,7 @@ export const clientUpdateRequestSchema = z.strictObject({
118
121
  allowed_resources: z.array(httpsUrlSchema).max(20).optional(),
119
122
  token_endpoint_auth_method: tokenEndpointAuthMethodSchema.optional(),
120
123
  require_pkce: z.boolean().optional(),
124
+ require_nonce: z.boolean().optional(),
121
125
  status: clientStatusSchema.optional(),
122
126
  mobile_app: mobileAppSchema.nullable().optional(),
123
127
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartcrab/contracts-management",
3
- "version": "0.6.3",
3
+ "version": "0.7.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "zod": "4.6.7",
31
- "@smartcrab/contracts-public": "0.6.3"
31
+ "@smartcrab/contracts-public": "0.7.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "typescript": "5.9.3",
@@ -20,6 +20,7 @@ const VALID_CLIENT = {
20
20
  allowed_resources: ["https://api.customer.example"],
21
21
  token_endpoint_auth_method: "none",
22
22
  require_pkce: true,
23
+ require_nonce: true,
23
24
  status: "active",
24
25
  mobile_app: null,
25
26
  created_at: "2026-08-02T08:10:00Z",
@@ -166,4 +167,14 @@ describe("clientCreateRequestSchema", () => {
166
167
  }).success,
167
168
  ).toBe(true);
168
169
  });
170
+ test("defaults require_nonce to true on create", () => {
171
+ expect(
172
+ clientCreateRequestSchema.parse({
173
+ environment_id: VALID_CLIENT.environment_id,
174
+ client_type: "web_bff",
175
+ name: "BFF",
176
+ token_endpoint_auth_method: "client_secret_basic",
177
+ }).require_nonce,
178
+ ).toBe(true);
179
+ });
169
180
  });
package/src/clients.ts CHANGED
@@ -78,6 +78,8 @@ export const clientSchema = z.strictObject({
78
78
  allowed_resources: z.array(httpsUrlSchema).max(20),
79
79
  token_endpoint_auth_method: tokenEndpointAuthMethodSchema,
80
80
  require_pkce: z.boolean(),
81
+ /** design.md §32.1: when true, OpenID Connect authorization requests require nonce. */
82
+ require_nonce: z.boolean(),
81
83
  status: clientStatusSchema,
82
84
  mobile_app: mobileAppSchema.nullable(),
83
85
  created_at: z.iso.datetime(),
@@ -113,6 +115,7 @@ export const clientCreateRequestSchema = z.strictObject({
113
115
  allowed_resources: z.array(httpsUrlSchema).max(20).default([]),
114
116
  token_endpoint_auth_method: tokenEndpointAuthMethodSchema,
115
117
  require_pkce: z.boolean().default(true),
118
+ require_nonce: z.boolean().default(true),
116
119
  mobile_app: mobileAppSchema.optional(),
117
120
  });
118
121
  export type ClientCreateRequest = z.infer<typeof clientCreateRequestSchema>;
@@ -148,6 +151,7 @@ export const clientUpdateRequestSchema = z.strictObject({
148
151
  allowed_resources: z.array(httpsUrlSchema).max(20).optional(),
149
152
  token_endpoint_auth_method: tokenEndpointAuthMethodSchema.optional(),
150
153
  require_pkce: z.boolean().optional(),
154
+ require_nonce: z.boolean().optional(),
151
155
  status: clientStatusSchema.optional(),
152
156
  mobile_app: mobileAppSchema.nullable().optional(),
153
157
  });