generated from ghga-de/microservice-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig_schema.json
793 lines (793 loc) · 22.7 KB
/
config_schema.json
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
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
{
"$defs": {
"IvaType": {
"description": "The type of IVA",
"enum": [
"Phone",
"Fax",
"PostalAddress",
"InPerson"
],
"title": "IvaType",
"type": "string"
},
"TOTPAlgorithm": {
"description": "Hash algorithm used for TOTP code generation",
"enum": [
"sha1",
"sha256",
"sha512"
],
"title": "TOTPAlgorithm",
"type": "string"
},
"UserWithIVA": {
"additionalProperties": false,
"description": "User with external ID and associated IVA.",
"properties": {
"ext_id": {
"description": "The external ID of the user",
"title": "Ext Id",
"type": "string"
},
"name": {
"description": "The full name of the user",
"title": "Name",
"type": "string"
},
"email": {
"description": "The email address of the user",
"title": "Email",
"type": "string"
},
"iva_type": {
"$ref": "#/$defs/IvaType",
"description": "The type of the validation address of the user"
},
"iva_value": {
"description": "The actual validation address of the user",
"title": "Iva Value",
"type": "string"
}
},
"required": [
"ext_id",
"name",
"email",
"iva_type",
"iva_value"
],
"title": "UserWithIVA",
"type": "object"
}
},
"additionalProperties": false,
"description": "Modifies the original Settings class provided by the user",
"properties": {
"auth_events_topic": {
"default": "auth",
"description": "The name of the topic for authentication related events",
"title": "Auth Events Topic",
"type": "string"
},
"second_factor_recreated_event_type": {
"default": "second_factor_recreated",
"description": "The event type for recreation of the second factor for authentication",
"title": "Second Factor Recreated Event Type",
"type": "string"
},
"iva_events_topic": {
"default": "ivas",
"description": "The name of the topic for IVA related events",
"title": "Iva Events Topic",
"type": "string"
},
"iva_state_changed_event_type": {
"default": "iva_state_changed",
"description": "The event type for IVA state changes",
"title": "Iva State Changed Event Type",
"type": "string"
},
"dataset_deletion_event_topic": {
"default": "metadata_datasets",
"description": "the topic of the event announcing dataset deletions",
"title": "Dataset Deletion Event Topic",
"type": "string"
},
"dataset_deletion_event_type": {
"default": "dataset_deleted",
"description": "the type of the event announcing dataset deletions",
"title": "Dataset Deletion Event Type",
"type": "string"
},
"claims_collection": {
"default": "claims",
"description": "Name of the collection for user claims",
"title": "Claims Collection",
"type": "string"
},
"users_collection": {
"default": "users",
"description": "Name of the collection for users",
"title": "Users Collection",
"type": "string"
},
"user_tokens_collection": {
"default": "user_tokens",
"description": "Name of the collection for user tokens",
"title": "User Tokens Collection",
"type": "string"
},
"ivas_collection": {
"default": "ivas",
"description": "Name of the collection for IVAs",
"title": "Ivas Collection",
"type": "string"
},
"user_events_topic": {
"default": "users",
"description": "The name of the topic for user related events",
"title": "User Events Topic",
"type": "string"
},
"service_name": {
"default": "auth_service",
"description": "Short name of this service",
"title": "Service Name",
"type": "string"
},
"service_instance_id": {
"description": "A string that uniquely identifies this instance across all instances of this service. This is included in log messages.",
"examples": [
"germany-bw-instance-001"
],
"title": "Service Instance Id",
"type": "string"
},
"kafka_servers": {
"description": "A list of connection strings to connect to Kafka bootstrap servers.",
"examples": [
[
"localhost:9092"
]
],
"items": {
"type": "string"
},
"title": "Kafka Servers",
"type": "array"
},
"kafka_security_protocol": {
"default": "PLAINTEXT",
"description": "Protocol used to communicate with brokers. Valid values are: PLAINTEXT, SSL.",
"enum": [
"PLAINTEXT",
"SSL"
],
"title": "Kafka Security Protocol",
"type": "string"
},
"kafka_ssl_cafile": {
"default": "",
"description": "Certificate Authority file path containing certificates used to sign broker certificates. If a CA is not specified, the default system CA will be used if found by OpenSSL.",
"title": "Kafka Ssl Cafile",
"type": "string"
},
"kafka_ssl_certfile": {
"default": "",
"description": "Optional filename of client certificate, as well as any CA certificates needed to establish the certificate's authenticity.",
"title": "Kafka Ssl Certfile",
"type": "string"
},
"kafka_ssl_keyfile": {
"default": "",
"description": "Optional filename containing the client private key.",
"title": "Kafka Ssl Keyfile",
"type": "string"
},
"kafka_ssl_password": {
"default": "",
"description": "Optional password to be used for the client private key.",
"format": "password",
"title": "Kafka Ssl Password",
"type": "string",
"writeOnly": true
},
"generate_correlation_id": {
"default": true,
"description": "A flag, which, if False, will result in an error when inbound requests don't possess a correlation ID. If True, requests without a correlation ID will be assigned a newly generated ID in the correlation ID middleware function.",
"examples": [
true,
false
],
"title": "Generate Correlation Id",
"type": "boolean"
},
"kafka_max_message_size": {
"default": 1048576,
"description": "The largest message size that can be transmitted, in bytes. Only services that have a need to send/receive larger messages should set this.",
"examples": [
1048576,
16777216
],
"exclusiveMinimum": 0,
"title": "Kafka Max Message Size",
"type": "integer"
},
"kafka_max_retries": {
"default": 0,
"description": "The maximum number of times to immediately retry consuming an event upon failure. Works independently of the dead letter queue.",
"examples": [
0,
1,
2,
3,
5
],
"minimum": 0,
"title": "Kafka Max Retries",
"type": "integer"
},
"kafka_enable_dlq": {
"default": false,
"description": "A flag to toggle the dead letter queue. If set to False, the service will crash upon exhausting retries instead of publishing events to the DLQ. If set to True, the service will publish events to the DLQ topic after exhausting all retries",
"examples": [
true,
false
],
"title": "Kafka Enable DLQ",
"type": "boolean"
},
"kafka_dlq_topic": {
"default": "dlq",
"description": "The name of the topic used to resolve error-causing events.",
"examples": [
"dlq"
],
"title": "Kafka DLQ Topic",
"type": "string"
},
"kafka_retry_backoff": {
"default": 0,
"description": "The number of seconds to wait before retrying a failed event. The backoff time is doubled for each retry attempt.",
"examples": [
0,
1,
2,
3,
5
],
"minimum": 0,
"title": "Kafka Retry Backoff",
"type": "integer"
},
"mongo_dsn": {
"description": "MongoDB connection string. Might include credentials. For more information see: https://naiveskill.com/mongodb-connection-string/",
"examples": [
"mongodb://localhost:27017"
],
"format": "multi-host-uri",
"minLength": 1,
"title": "Mongo Dsn",
"type": "string"
},
"db_name": {
"default": "auth-db",
"description": "the name of the database located on the MongoDB server",
"examples": [
"auth-db",
"user-management",
"users-and-claims"
],
"title": "Db Name",
"type": "string"
},
"mongo_timeout": {
"anyOf": [
{
"exclusiveMinimum": 0,
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "Timeout in seconds for API calls to MongoDB. The timeout applies to all steps needed to complete the operation, including server selection, connection checkout, serialization, and server-side execution. When the timeout expires, PyMongo raises a timeout exception. If set to None, the operation will not time out (default MongoDB behavior).",
"examples": [
300,
600,
null
],
"title": "Mongo Timeout"
},
"log_level": {
"default": "INFO",
"description": "The minimum log level to capture.",
"enum": [
"CRITICAL",
"ERROR",
"WARNING",
"INFO",
"DEBUG",
"TRACE"
],
"title": "Log Level",
"type": "string"
},
"log_format": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "If set, will replace JSON formatting with the specified string format. If not set, has no effect. In addition to the standard attributes, the following can also be specified: timestamp, service, instance, level, correlation_id, and details",
"examples": [
"%(timestamp)s - %(service)s - %(level)s - %(message)s",
"%(asctime)s - Severity: %(levelno)s - %(msg)s"
],
"title": "Log Format"
},
"log_traceback": {
"default": true,
"description": "Whether to include exception tracebacks in log messages.",
"title": "Log Traceback",
"type": "boolean"
},
"max_iva_verification_attempts": {
"default": 10,
"description": "Maximum number of verification attempts for an IVA",
"title": "Max Iva Verification Attempts",
"type": "integer"
},
"totp_issuer": {
"default": "GHGA",
"description": "Issuer name for TOTP provisioning URIs",
"title": "Totp Issuer",
"type": "string"
},
"totp_image": {
"anyOf": [
{
"format": "uri",
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "URL of the PNG image provided in the TOTP provisioning URIs",
"examples": [
"https://www.ghga.de/logo.png"
],
"title": "Totp Image"
},
"totp_algorithm": {
"$ref": "#/$defs/TOTPAlgorithm",
"default": "sha1"
},
"totp_digits": {
"default": 6,
"description": "Number of digits used for the TOTP code",
"maximum": 12,
"minimum": 6,
"title": "Totp Digits",
"type": "integer"
},
"totp_interval": {
"default": 30,
"description": "Time interval in seconds for generating TOTP codes",
"maximum": 300,
"minimum": 10,
"title": "Totp Interval",
"type": "integer"
},
"totp_tolerance": {
"default": 1,
"description": "Number of intervals to check before and after the current time",
"maximum": 10,
"minimum": 0,
"title": "Totp Tolerance",
"type": "integer"
},
"totp_attempts_per_code": {
"default": 3,
"description": "Maximum number of attempts to verify an individual TOTP code",
"maximum": 10,
"minimum": 1,
"title": "Totp Attempts Per Code",
"type": "integer"
},
"totp_max_failed_attempts": {
"default": 10,
"description": "Maximum number of consecutive failed attempts to verify TOTP codes",
"maximum": 100,
"minimum": 1,
"title": "Totp Max Failed Attempts",
"type": "integer"
},
"totp_secret_size": {
"default": 32,
"description": "Size of the Base32 encoded TOTP secrets",
"maximum": 256,
"minimum": 24,
"title": "Totp Secret Size",
"type": "integer"
},
"totp_encryption_key": {
"anyOf": [
{
"format": "password",
"type": "string",
"writeOnly": true
},
{
"type": "null"
}
],
"default": null,
"description": "Base64 encoded key used to encrypt TOTP secrets",
"title": "Totp Encryption Key"
},
"session_id_bytes": {
"default": 24,
"description": "Number of bytes to be used for a session ID.",
"title": "Session ID size",
"type": "integer"
},
"csrf_token_bytes": {
"default": 24,
"description": "Number of bytes to be used for a CSRF token.",
"title": "CSRF token size",
"type": "integer"
},
"session_timeout_seconds": {
"default": 3600,
"description": "Session timeout in seconds",
"title": "Session timeout",
"type": "integer"
},
"session_max_lifetime_seconds": {
"default": 43200,
"description": "Maximum lifetime of a session in seconds",
"title": "Max. session duration",
"type": "integer"
},
"auth_key": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "internal public key for user management (key pair for auth adapter)",
"title": "Auth Key"
},
"auth_algs": {
"default": [
"ES256"
],
"description": "A list of all algorithms used for signing GHGA internal tokens.",
"items": {
"type": "string"
},
"title": "Auth Algs",
"type": "array"
},
"auth_check_claims": {
"default": {
"id": null,
"name": null,
"email": null,
"iat": null,
"exp": null
},
"description": "A dict of all GHGA internal claims that shall be verified.",
"title": "Auth Check Claims",
"type": "object"
},
"auth_map_claims": {
"additionalProperties": {
"type": "string"
},
"default": {},
"description": "A mapping of claims to attributes in the GHGA auth context.",
"title": "Auth Map Claims",
"type": "object"
},
"host": {
"default": "127.0.0.1",
"description": "IP of the host.",
"title": "Host",
"type": "string"
},
"port": {
"default": 8080,
"description": "Port to expose the server on the specified host",
"title": "Port",
"type": "integer"
},
"auto_reload": {
"default": false,
"description": "A development feature. Set to `True` to automatically reload the server upon code changes",
"title": "Auto Reload",
"type": "boolean"
},
"workers": {
"default": 1,
"description": "Number of workers processes to run.",
"title": "Workers",
"type": "integer"
},
"api_root_path": {
"default": "",
"description": "Root path at which the API is reachable. This is relative to the specified host and port.",
"title": "Api Root Path",
"type": "string"
},
"openapi_url": {
"default": "/openapi.json",
"description": "Path to get the openapi specification in JSON format. This is relative to the specified host and port.",
"title": "Openapi Url",
"type": "string"
},
"docs_url": {
"default": "/docs",
"description": "Path to host the swagger documentation. This is relative to the specified host and port.",
"title": "Docs Url",
"type": "string"
},
"cors_allowed_origins": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "A list of origins that should be permitted to make cross-origin requests. By default, cross-origin requests are not allowed. You can use ['*'] to allow any origin.",
"examples": [
[
"https://example.org",
"https://www.example.org"
]
],
"title": "Cors Allowed Origins"
},
"cors_allow_credentials": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"description": "Indicate that cookies should be supported for cross-origin requests. Defaults to False. Also, cors_allowed_origins cannot be set to ['*'] for credentials to be allowed. The origins must be explicitly specified.",
"examples": [
[
"https://example.org",
"https://www.example.org"
]
],
"title": "Cors Allow Credentials"
},
"cors_allowed_methods": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "A list of HTTP methods that should be allowed for cross-origin requests. Defaults to ['GET']. You can use ['*'] to allow all standard methods.",
"examples": [
[
"*"
]
],
"title": "Cors Allowed Methods"
},
"cors_allowed_headers": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "A list of HTTP request headers that should be supported for cross-origin requests. Defaults to []. You can use ['*'] to allow all headers. The Accept, Accept-Language, Content-Language and Content-Type headers are always allowed for CORS requests.",
"examples": [
[]
],
"title": "Cors Allowed Headers"
},
"api_ext_path": {
"default": "/api/auth",
"description": "external API path for the auth related endpoints (user, session and TOTP management)",
"title": "Api Ext Path",
"type": "string"
},
"auth_ext_keys": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "external public key set for auth adapter (used only by the auth adapter, determined using OIDC discovery if None)",
"title": "Auth Ext Keys"
},
"auth_ext_algs": {
"default": [
"RS256",
"ES256"
],
"description": "allowed algorithms for signing external tokens",
"items": {
"type": "string"
},
"title": "Auth Ext Algs",
"type": "array"
},
"basic_auth_credentials": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "credentials for basic authentication, separated by whitespace",
"title": "Basic Auth Credentials"
},
"basic_auth_realm": {
"default": "GHGA Data Portal",
"description": "realm for basic authentication",
"title": "Basic Auth Realm",
"type": "string"
},
"allow_read_paths": {
"default": [
"/.well-known/*",
"/service-logo.png"
],
"description": "paths that are public or use their own authentication mechanism",
"items": {
"type": "string"
},
"title": "Allow Read Paths",
"type": "array"
},
"allow_write_paths": {
"default": [],
"description": "paths for writing that use their own authentication mechanism",
"items": {
"type": "string"
},
"title": "Allow Write Paths",
"type": "array"
},
"provide_apis": {
"default": [],
"description": "Which REST APIs should be provided.",
"examples": [
"[\"ext_auth\"]",
"[\"users\"]",
"[\"claims\"]"
],
"items": {
"enum": [
"ext_auth",
"users",
"claims"
],
"type": "string"
},
"title": "Provide APIs",
"type": "array"
},
"run_consumer": {
"default": false,
"description": "Whether the service should run as an event consumer",
"examples": [
"false",
"true"
],
"title": "Run Consumer",
"type": "boolean"
},
"add_as_data_stewards": {
"default": [],
"description": "A list of of data stewards to seed the claims repository with. All other data steward claims will be removed. This is only used with the claims API.",
"items": {
"$ref": "#/$defs/UserWithIVA"
},
"title": "Add As Data Stewards",
"type": "array"
},
"oidc_authority_url": {
"default": "https://login.aai.lifescience-ri.eu/oidc/",
"description": "external OIDC authority URL used by the auth adapter",
"format": "uri",
"maxLength": 2083,
"minLength": 1,
"title": "Oidc Authority Url",
"type": "string"
},
"oidc_issuer": {
"default": "https://login.aai.lifescience-ri.eu/oidc/",
"description": "external OIDC issuer for access tokens used by the auth adapter (URL format with or without end slash, determined using OIDC discovery if empty)",
"title": "Oidc Issuer",
"type": "string"
},
"oidc_userinfo_endpoint": {
"anyOf": [
{
"format": "uri",
"maxLength": 2083,
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"default": "https://login.aai.lifescience-ri.eu/oidc/userinfo",
"description": "external OIDC userinfo endpoint used by the auth adapter (determined using OIDC discovery if None)",
"title": "Oidc Userinfo Endpoint"
},
"oidc_client_id": {
"default": "ghga-data-portal",
"description": "the registered OIDC client ID",
"title": "Oidc Client Id",
"type": "string"
},
"organization_url": {
"default": "https://ghga.de",
"description": "the URL used as source for internal claims",
"format": "uri",
"maxLength": 2083,
"minLength": 1,
"title": "Organization Url",
"type": "string"
}
},
"required": [
"service_instance_id",
"kafka_servers",
"mongo_dsn"
],
"title": "ModSettings",
"type": "object"
}