forked from NpgsqlRest/NpgsqlRest
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathappsettings.json
More file actions
647 lines (628 loc) · 25.8 KB
/
Copy pathappsettings.json
File metadata and controls
647 lines (628 loc) · 25.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
{
//
// The application name used to set the application name property in connection string by "NpgsqlRest"."SetApplicationNameInConnection" or the "NpgsqlRest"."UseJsonApplicationName" settings.
// It is the name of the top-level directory set to null.
//
"ApplicationName": null,
//
// Production or Development
//
"EnvironmentName": "Production",
"Config": {
//
// Expose current configuration to the endpoint for debugging and inspection. Note, the password in the connection string is not exposed.
//
"ExposeAsEndpoint": "/config",
//
// Add the environment variables to configuration first.
//
"AddEnvironmentVariables": false
},
"ConnectionStrings": {
//
// See https://www.npgsql.org/doc/connection-string-parameters.html
//
"Default": ""
},
//
// Specify the urls the web host will listen on. See https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.hosting.hostingabstractionswebhostbuilderextensions.useurls?view=aspnetcore-8.0
//
"Urls": "http://localhost:5000;http://localhost:5001",
//
// Enable to invoke UseKestrelHttpsConfiguration. See https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.hosting.webhostbuilderkestrelextensions.usekestrelhttpsconfiguration?view=aspnetcore-8.0
//
"Ssl": {
"Enabled": false,
//
// Adds middleware for redirecting HTTP Requests to HTTPS. See https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.builder.httpspolicybuilderextensions.usehttpsredirection?view=aspnetcore-8.0
//
"HttpsRedirection": true,
//
// Adds middleware for using HSTS, which adds the Strict-Transport-Security header. See https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.builder.hstsbuilderextensions.usehsts?view=aspnetcore-2.1
//
"UseHsts": true
},
// //
// // Uncomment to configure Kestrel web server and to add certificates
// // See https://learn.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel/endpoints?view=aspnetcore-8.0
// //
// "Kestrel": {
// "Endpoints": {
// "Http": {
// "Url": "http://localhost:5000"
// },
// "HttpsInlineCertFile": {
// "Url": "https://localhost:5001",
// "Certificate": {
// "Path": "<path to .pfx file>",
// "Password": "$CREDENTIAL_PLACEHOLDER$"
// }
// },
// "HttpsInlineCertAndKeyFile": {
// "Url": "https://localhost:5002",
// "Certificate": {
// "Path": "<path to .pem/.crt file>",
// "KeyPath": "<path to .key file>",
// "Password": "$CREDENTIAL_PLACEHOLDER$"
// }
// },
// "HttpsInlineCertStore": {
// "Url": "https://localhost:5003",
// "Certificate": {
// "Subject": "<subject; required>",
// "Store": "<certificate store; required>",
// "Location": "<location; defaults to CurrentUser>",
// "AllowInvalid": "<true or false; defaults to false>"
// }
// },
// "HttpsDefaultCert": {
// "Url": "https://localhost:5004"
// }
// },
// "Certificates": {
// "Default": {
// "Path": "<path to .pfx file>",
// "Password": "$CREDENTIAL_PLACEHOLDER$"
// }
// }
// },
//
// Authentication and Authorization settings
//
"Auth": {
//
// Enable Cookie Auth
//
"CookieAuth": false,
"CookieAuthScheme": null,
"CookieValidDays": 14,
"CookieName": null,
"CookiePath": null,
"CookieDomain": null,
"CookieMultiSessions": true,
"CookieHttpOnly": true,
//
// Enable JWT Auth. Can work with Cookie Auth.
//
"BearerTokenAuth": false,
"BearerTokenAuthScheme": null,
"BearerTokenExpireHours": 1,
"BearerRefreshTokenExpireDays": 14,
//
// Enable external auth providers
//
"External": {
"Enabled": false,
//
// sessionStorage key to store the status of the external auth process returned by the signin page.
// The value is HTTP status code (200 for success, 401 for unauthorized, 403 for forbidden, etc.)
//
"BrowserSessionStatusKey": "__external_status",
//
// sessionStorage key to store the message of the external auth process returned by the signin page.
//
"BrowserSessionMessageKey": "__external_message",
//
// Path to the signin page to handle the external auth process. Redirect to this page to start the external auth process.
// Format placeholder {0} is the provider name in lowercase (google, linkedin, github, etc.)
//
"SigninUrl": "/signin-{0}",
//
// Sign in page template. Format placeholders {0} is the provider name, {1} is the script to redirect to the external auth provider.
//
"SignInHtmlTemplate": "<!DOCTYPE html><html><head><meta charset=\"utf-8\" /><title>Talking To {0}</title></head><body>Loading...{1}</body></html>",
//
// URL to redirect after the external auth process is completed. Usually this is resolved from the request automatically. Except when it's not.
//
"RedirectUrl": null,
//
// Path to redirect after the external auth process is completed.
//
"ReturnToPath": "/",
//
// Query string key to store the path to redirect after the external auth process is completed.
// Use this to set dynamic return path. If this query string key is not found, the ReturnToPath value is used.
//
"ReturnToPathQueryStringKey": "return_to",
//
// Login command to execute after the external auth process is completed.
// The first parameter is the email returned from the provider, the second parameter is the name is the email returned from the provider.
// The command uses the same rules as the login enabled routine. See: https://vb-consulting.github.io/npgsqlrest/login-endpoints
//
"LoginCommand": "select * from login($1, $2)",
"Google": {
//
// visit https://console.cloud.google.com/apis/ to configure your google app and get your client id and client secret
//
"Enabled": false,
"ClientId": "",
"ClientSecret": "",
"AuthUrl": "https://accounts.google.com/o/oauth2/v2/auth?response_type=code&client_id={0}&redirect_uri={1}&scope=openid profile email&state={2}",
"TokenUrl": "https://oauth2.googleapis.com/token",
"InfoUrl": "https://www.googleapis.com/oauth2/v3/userinfo",
"EmailUrl": null
},
"LinkedIn": {
//
// visit https://www.linkedin.com/developers/apps/ to configure your linkedin app and get your client id and client secret
//
"Enabled": false,
"ClientId": "",
"ClientSecret": "",
"AuthUrl": "https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id={0}&redirect_uri={1}&state={2}&scope=r_liteprofile%20r_emailaddress",
"TokenUrl": "https://www.linkedin.com/oauth/v2/accessToken",
"InfoUrl": "https://api.linkedin.com/v2/me",
"EmailUrl": "https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements//(handle~))"
},
"GitHub": {
//
// visit https://github.com/settings/developers/ to configure your github app and get your client id and client secret
//
"Enabled": false,
"ClientId": "",
"ClientSecret": "",
"AuthUrl": "https://github.com/login/oauth/authorize?client_id={0}&redirect_uri={1}&state={2}&allow_signup=false",
"TokenUrl": "https://github.com/login/oauth/access_token",
"InfoUrl": "https://api.github.com/user",
"EmailUrl": null
}
}
},
//
// Serilog settings
//
"Log": {
//
// See https://github.com/serilog/serilog/wiki/Configuration-Basics#minimum-level
//
"MinimalLevels": {
"System": "Warning",
"Microsoft": "Warning"
},
"ToConsole": true,
"ToFile": false,
"FilePath": "logs/log.txt",
"FileSizeLimitBytes": 30000000,
"RetainedFileCountLimit": 30,
"RollOnFileSizeLimit": true,
//
// See https://github.com/serilog/serilog/wiki/Formatting-Output
//
"OutputTemplate": "[{Timestamp:HH:mm:ss.fff} {Level:u3}] {Message:lj} [{SourceContext}]{NewLine}{Exception}"
},
//
// Static files settings
//
"StaticFiles": {
"Enabled": false,
"RootPath": "wwwroot",
"AnonymousPaths": [
"*"
],
"LoginRedirectPath": "/login/"
},
//
// Cross-origin resource sharing
//
"Cors": {
"Enabled": false,
"AllowedOrigins": [],
"AllowedMethods": [
"*"
],
"AllowedHeaders": [
"*"
]
},
//
// https://vb-consulting.github.io/npgsqlrest/
//
"NpgsqlRest": {
//
// Connection name to be used from the ConnectionStrings section or NULL to use the first avaialable connection string.
//
"ConnectionName": null,
//
// Sets the ApplicationName connection property in the connection string to the value of the ApplicationName configuration.
// Note: This option is ignored if the UseJsonApplicationName option is enabled.
//
"SetApplicationNameInConnection": true,
//
// Sets the ApplicationName connection property dynamically on every request in the following format:
// {"app": [Application Name], "uid": [User Id for authenticated users or NULL], "id": [Valud of X-Execution-Id request header or NULL]}
// Note: ApplicationName connection property is limited to 64 characters.
//
"UseJsonApplicationName": true,
//
// See https://vb-consulting.github.io/npgsqlrest/options/#schemasimilarto
//
"SchemaSimilarTo": null,
//
// See https://vb-consulting.github.io/npgsqlrest/options/#schemanotsimilarto
//
"SchemaNotSimilarTo": null,
//
// See https://vb-consulting.github.io/npgsqlrest/options/#includeschemas
//
"IncludeSchemas": null,
//
// See https://vb-consulting.github.io/npgsqlrest/options/#excludeschemas
//
"ExcludeSchemas": null,
//
// See https://vb-consulting.github.io/npgsqlrest/options/#namesimilarto
//
"NameSimilarTo": null,
//
// See https://vb-consulting.github.io/npgsqlrest/options/#namenotsimilarto
//
"NameNotSimilarTo": null,
//
// See https://vb-consulting.github.io/npgsqlrest/options/#includenames
//
"IncludeNames": null,
//
// See https://vb-consulting.github.io/npgsqlrest/options/#excludenames
//
"ExcludeNames": null,
//
// See https://vb-consulting.github.io/npgsqlrest/options/#commentsmode
//
"CommentsMode": "ParseAll",
//
// See https://vb-consulting.github.io/npgsqlrest/options/#urlpathprefix
//
"UrlPathPrefix": "/api",
//
// Convert all URL paths to kebab-case from the original PostgreSQL names.
//
"KebabCaseUrls": true,
//
// Convert all parameter names to camel case from the original PostgreSQL paramater names.
//
"CamelCaseNames": true,
//
// Set to true to force all created endpoints to require authorization.
// See https://vb-consulting.github.io/npgsqlrest/options/#requiresauthorization
//
"RequiresAuthorization": true,
//
// See https://vb-consulting.github.io/npgsqlrest/options/#logendpointcreatedinfo
//
"LogEndpointCreatedInfo": true,
//
// See https://vb-consulting.github.io/npgsqlrest/options/#logannotationsetinfo
//
"LogAnnotationSetInfo": true,
//
// See https://vb-consulting.github.io/npgsqlrest/options/#logconnectionnoticeevents
//
"LogConnectionNoticeEvents": true,
//
// See https://vb-consulting.github.io/npgsqlrest/options/#logcommands
//
"LogCommands": false,
//
// See https://vb-consulting.github.io/npgsqlrest/options/#logcommandparameters
//
"LogCommandParameters": false,
//
// See https://vb-consulting.github.io/npgsqlrest/options/#commandtimeout
//
"CommandTimeout": null,
//
// See https://vb-consulting.github.io/npgsqlrest/options/#defaulthttpmethod
//
"DefaultHttpMethod": null,
//
// See https://vb-consulting.github.io/npgsqlrest/options/#defaultrequestparamtype
//
"DefaultRequestParamType": null,
//
// See https://vb-consulting.github.io/npgsqlrest/options/#requestheadersmode
//
"RequestHeadersMode": "Ignore",
//
// See https://vb-consulting.github.io/npgsqlrest/options/#requestheadersparametername
//
"RequestHeadersParameterName": "headers",
//
// See https://vb-consulting.github.io/npgsqlrest/options/#returnnpgsqlexceptionmessage
//
"ReturnNpgsqlExceptionMessage": true,
//
// https://vb-consulting.github.io/npgsqlrest/options/#postgresqlerrorcodetohttpstatuscodemapping
//
"PostgreSqlErrorCodeToHttpStatusCodeMapping": {
"57014": 205
},
//
// https://vb-consulting.github.io/npgsqlrest/options/#customrequestheaders
//
"CustomRequestHeaders": {
},
//
// Authentication options for NpgsqlRest endpoints
//
"AuthenticationOptions": {
//
// Url path that will be used for the login endpoint. If NULL, the login endpoint will not be created.
// See more on login endpoints at https://vb-consulting.github.io/npgsqlrest/login-endpoints
//
"LoginPath": null,
//
// Url path that will be used for the logout endpoint. If NULL, the logout endpoint will not be created.
// See more on logout endpoints at https://vb-consulting.github.io/npgsqlrest/annotations/#logout
//
"LogoutPath": null,
//
// See https://vb-consulting.github.io/npgsqlrest/options/#authenticationoptionsdefaultauthenticationtype
// (Default value is set from the ApplicationName configuration property)
//
"DefaultAuthenticationType": null,
//
// Name of the PostgreSQL text parameter that will be used to pass the authenticated user id to the PostgreSQL routine (function or query) automatically (supplied values are rewritten).
//
"UserIdParameterName": null,
//
// Name of the PostgreSQL text parameter that will be used to pass the authenticated user name to the PostgreSQL routine (function or query) automatically (supplied values are rewritten).
//
"UserNameParameterName": null,
//
// Name of the PostgreSQL text array parameter that will be used to pass the authenticated user roles list to the PostgreSQL routine (function or query) automatically (supplied values are rewritten).
//
"UserRolesParameterName": null,
//
// Custom mapping of the parameter names to the claim names. When this parameter name is found in the claim collection by the key, the value of the claim is passed to the PostgreSQL routine.
//
"CustomParameterNameToClaimMappings": { }
},
//
// Enable or disable the generation of HTTP files for NpgsqlRest endpoints.
// See more on HTTP files at:
// https://marketplace.visualstudio.com/items?itemName=humao.rest-client or
// https://learn.microsoft.com/en-us/aspnet/core/test/http-files?view=aspnetcore-8.0
//
"HttpFileOptions": {
"Enabled": false,
//
// Options for HTTP file generation:
// - File: Generate HTTP files in the file system.
// - Endpoint: Generate Endpoint(s) with HTTP file(s) content.
// - Both: Generate HTTP files in the file system and Endpoint(s) with HTTP file(s) content.
//
"Option": "File",
//
// File name. If not set, the database name will be used if connection string is set.
// If neither ConnectionString nor Name is set, the file name will be "npgsqlrest".
//
"Name": null,
//
// The pattern to use when generating file names. {0} is database name, {1} is schema suffix with underline when FileMode is set to Schema.
// Use this property to set the custom file name.
// .http extension will be added automatically.
//
"NamePattern": "{0}_{1}",
//
// Adds comment header to above request based on PostgreSQL routine.
// - None: skip.
// - Simple: Add name, parameters and return values to comment header. This default.
// - Full: Add the entire routine code as comment header.
//
"CommentHeader": "Simple",
//
// When CommentHeader is set to Simple or Full, set to true to include routine comments in comment header.
//
"CommentHeaderIncludeComments": true,
//
// - Database: to create one http file for entire database.
// - Schema: to create one http file for each schema.
//
"FileMode": "Schema",
//
// Set to true to overwrite existing files.
//
"FileOverwrite": true
},
//
// Enable or disable the generation of TypeScript client source code files for NpgsqlRest endpoints.
//
"TsClient": {
"Enabled": false,
//
// File path for the generated code. Set to null to skip the code generation. Use {0} to set schema name when BySchema is true
//
"FilePath": null,
//
// Force file overwrite.
//
"FileOverwrite": true,
//
// Include current host information in the URL prefix.
//
"IncludeHost": true,
//
// Set the custom host prefix information.
//
"CustomHost": null,
//
// Adds comment header to above request based on PostgreSQL routine
// Set None to skip.
// Set Simple (default) to add name, parameters and return values to comment header.
// Set Full to add the entire routine code as comment header.
//
"CommentHeader": "Simple",
//
// When CommentHeader is set to Simple or Full, set to true to include routine comments in comment header.
//
"CommentHeaderIncludeComments": true,
//
// Create files by PostgreSQL schema. File name will use formatted FilePath where {0} is is the schema name in the pascal case.
//
"BySchema": true,
//
// Set to true to include status code in response: {status: response.status, response: model}
//
"IncludeStatusCode": true,
//
// Create separate file with global types {name}Types.d.ts
//
"CreateSeparateTypeFile": true,
//
// Module name to import "baseUrl" constant, instead of defining it in a module.
//
"ImportBaseUrlFrom": null,
//
// Module name to import "pasreQuery" function, instead of defining it in a module.
//
"ImportParseQueryFrom": null,
//
// Include optional parameter `parseUrl: (url: string) => string = url=>url` that will parse constructed url.
//
"IncludeParseUrlParam": false,
//
// Include optional parameter `parseRequest: (request: RequestInit) => RequestInit = request=>request` that will parse constructed request.
//
"IncludeParseRequestParam": false,
//
// Header lines on a each auto-generated source file. Default is ["// autogenerated at {0}", "", ""] where {0} is current timestamp.
//
"HeaderLines": null,
//
// Array of routine names to skip (without schema)
//
"SkipRoutineNames": [],
//
// Array of generated function names to skip
//
"SkipFunctionNames": [],
//
// Array of url paths to skip
//
"SkipPaths": []
},
//
// Enable or disable the creation of the endpoints for the PostgreSQL routines (functions and procedures).
//
"RoutinesSource": {
"Enabled": true,
//
// Override the default SchemaSimilarTo option for the RoutinesSource.
//
"SchemaSimilarTo": null,
//
// Override the default SchemaNotSimilarTo option for the RoutinesSource.
//
"SchemaNotSimilarTo": null,
//
// Override the default IncludeSchemas option for the RoutinesSource.
//
"IncludeSchemas": null,
//
// Override the default ExcludeSchemas option for the RoutinesSource.
//
"ExcludeSchemas": null,
//
// Override the default NameSimilarTo option for the RoutinesSource.
//
"NameSimilarTo": null,
//
// Override the default NameNotSimilarTo option for the RoutinesSource.
//
"NameNotSimilarTo": null,
//
// Override the default IncludeNames option for the RoutinesSource.
//
"IncludeNames": null,
//
// Override the default ExcludeNames option for the RoutinesSource.
//
"ExcludeNames": null,
//
// Override the default CommentsMode option for the RoutinesSource.
//
"CommentsMode": null,
//
// Provide a custom query or a function name to select the routines information metadata or null to use the default query.
// See the default query: https://github.com/vb-consulting/NpgsqlRest/blob/master/NpgsqlRest/RoutineSourceQuery.cs
//
"Query": null
},
//
// Enable or disable the creation of the endpoints for the PostgreSQL tables and views.
//
"CrudSource": {
"Enabled": false,
//
// Override the default SchemaSimilarTo option for the CrudSource.
//
"SchemaSimilarTo": null,
//
// Override the default SchemaNotSimilarTo option for the CrudSource.
//
"SchemaNotSimilarTo": null,
//
// Override the default IncludeSchemas option for the CrudSource.
//
"IncludeSchemas": null,
//
// Override the default ExcludeSchemas option for the CrudSource.
//
"ExcludeSchemas": null,
//
// Override the default NameSimilarTo option for the CrudSource.
//
"NameSimilarTo": null,
//
// Override the default NameNotSimilarTo option for the CrudSource.
//
"NameNotSimilarTo": null,
//
// Override the default IncludeNames option for the CrudSource.
//
"IncludeNames": null,
//
// Override the default ExcludeNames option for the CrudSource.
//
"ExcludeNames": null,
//
// Override the default CommentsMode option for the CrudSource.
//
"CommentsMode": null,
//
// Provide a custom query or a function name to select the tables and views information metadata or null to use the default query.
// See the default query: https://github.com/vb-consulting/NpgsqlRest/blob/master/plugins/NpgsqlRest.CrudSource/CrudSourceQuery.cs
//
"Query": null,
//
// Set of flags to enable or disable the creation of the CRUD endpoints for the specific types of the PostgreSQL tables and views.
// Possible values are:
// Select, Update, UpdateReturning, Insert, InsertReturning, InsertOnConflictDoNothing, InsertOnConflictDoUpdate, InsertOnConflictDoNothingReturning,
// InsertOnConflictDoUpdateReturning, Delete, DeleteReturning, All
//
"CrudTypes": [
"All"
]
}
}
}