@@ -17,7 +17,7 @@ import {
17
17
resetMigration ,
18
18
runMigrationsOnTenant ,
19
19
} from '@internal/database/migrations'
20
- import { getConfig } from '../../../config'
20
+ import { getConfig , JwksConfigKey } from '../../../config'
21
21
22
22
const patchSchema = {
23
23
body : {
@@ -27,6 +27,7 @@ const patchSchema = {
27
27
databaseUrl : { type : 'string' } ,
28
28
databasePoolUrl : { type : 'string' , nullable : true } ,
29
29
maxConnections : { type : 'number' } ,
30
+ jwks : { type : 'object' , nullable : true } ,
30
31
fileSizeLimit : { type : 'number' } ,
31
32
jwtSecret : { type : 'string' } ,
32
33
serviceKey : { type : 'string' } ,
@@ -89,6 +90,7 @@ interface tenantDBInterface {
89
90
database_pool_url ?: string
90
91
max_connections ?: number
91
92
jwt_secret : string
93
+ jwks : { keys ?: JwksConfigKey [ ] } | null
92
94
service_key : string
93
95
file_size_limit ?: number
94
96
feature_s3_protocol ?: boolean
@@ -113,6 +115,7 @@ export default async function routes(fastify: FastifyInstance) {
113
115
max_connections,
114
116
file_size_limit,
115
117
jwt_secret,
118
+ jwks,
116
119
service_key,
117
120
feature_purge_cache,
118
121
feature_image_transformation,
@@ -130,6 +133,7 @@ export default async function routes(fastify: FastifyInstance) {
130
133
maxConnections : max_connections ? Number ( max_connections ) : undefined ,
131
134
fileSizeLimit : Number ( file_size_limit ) ,
132
135
jwtSecret : decrypt ( jwt_secret ) ,
136
+ jwks,
133
137
serviceKey : decrypt ( service_key ) ,
134
138
migrationVersion : migrations_version ,
135
139
migrationStatus : migrations_status ,
@@ -163,7 +167,7 @@ export default async function routes(fastify: FastifyInstance) {
163
167
max_connections,
164
168
file_size_limit,
165
169
jwt_secret,
166
-
170
+ jwks ,
167
171
service_key,
168
172
feature_purge_cache,
169
173
feature_s3_protocol,
@@ -187,7 +191,7 @@ export default async function routes(fastify: FastifyInstance) {
187
191
maxConnections : max_connections ? Number ( max_connections ) : undefined ,
188
192
fileSizeLimit : Number ( file_size_limit ) ,
189
193
jwtSecret : decrypt ( jwt_secret ) ,
190
-
194
+ jwks ,
191
195
serviceKey : decrypt ( service_key ) ,
192
196
features : {
193
197
imageTransformation : {
@@ -215,6 +219,7 @@ export default async function routes(fastify: FastifyInstance) {
215
219
databaseUrl,
216
220
fileSizeLimit,
217
221
jwtSecret,
222
+ jwks,
218
223
serviceKey,
219
224
features,
220
225
databasePoolUrl,
@@ -231,6 +236,7 @@ export default async function routes(fastify: FastifyInstance) {
231
236
max_connections : maxConnections ? Number ( maxConnections ) : undefined ,
232
237
file_size_limit : fileSizeLimit ,
233
238
jwt_secret : encrypt ( jwtSecret ) ,
239
+ jwks,
234
240
service_key : encrypt ( serviceKey ) ,
235
241
feature_image_transformation : features ?. imageTransformation ?. enabled ?? false ,
236
242
feature_purge_cache : features ?. purgeCache ?. enabled ?? false ,
@@ -270,6 +276,7 @@ export default async function routes(fastify: FastifyInstance) {
270
276
databaseUrl,
271
277
fileSizeLimit,
272
278
jwtSecret,
279
+ jwks,
273
280
serviceKey,
274
281
features,
275
282
databasePoolUrl,
@@ -291,6 +298,7 @@ export default async function routes(fastify: FastifyInstance) {
291
298
max_connections : maxConnections ? Number ( maxConnections ) : undefined ,
292
299
file_size_limit : fileSizeLimit ,
293
300
jwt_secret : jwtSecret !== undefined ? encrypt ( jwtSecret ) : undefined ,
301
+ jwks,
294
302
service_key : serviceKey !== undefined ? encrypt ( serviceKey ) : undefined ,
295
303
feature_image_transformation : features ?. imageTransformation ?. enabled ,
296
304
feature_purge_cache : features ?. purgeCache ?. enabled ,
@@ -335,6 +343,7 @@ export default async function routes(fastify: FastifyInstance) {
335
343
databaseUrl,
336
344
fileSizeLimit,
337
345
jwtSecret,
346
+ jwks,
338
347
serviceKey,
339
348
features,
340
349
databasePoolUrl,
@@ -350,6 +359,7 @@ export default async function routes(fastify: FastifyInstance) {
350
359
anon_key : encrypt ( anonKey ) ,
351
360
database_url : encrypt ( databaseUrl ) ,
352
361
jwt_secret : encrypt ( jwtSecret ) ,
362
+ jwks : jwks || null ,
353
363
service_key : encrypt ( serviceKey ) ,
354
364
}
355
365
0 commit comments