jskos-server 2.4.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.
Files changed (112) hide show
  1. package/.dockerignore +20 -0
  2. package/.editorconfig +9 -0
  3. package/.github/workflows/docker.yml +59 -0
  4. package/.github/workflows/gh-pages.yml +23 -0
  5. package/.github/workflows/gh-release.yml +19 -0
  6. package/.github/workflows/test.yml +39 -0
  7. package/.husky/pre-commit +1 -0
  8. package/CHANGELOG.md +18 -0
  9. package/LICENSE +21 -0
  10. package/README.md +2710 -0
  11. package/bin/extra.js +81 -0
  12. package/bin/import.js +438 -0
  13. package/bin/mongodb.js +21 -0
  14. package/bin/reset.js +257 -0
  15. package/bin/upgrade.js +34 -0
  16. package/config/config.default.json +88 -0
  17. package/config/config.schema.json +877 -0
  18. package/config/config.test.json +107 -0
  19. package/config/index.js +77 -0
  20. package/config/setup.js +212 -0
  21. package/depdendencies.png +0 -0
  22. package/docker/.env +1 -0
  23. package/docker/Dockerfile +20 -0
  24. package/docker/README.md +175 -0
  25. package/docker/docker-compose.yml +29 -0
  26. package/docker/docker-entrypoint.sh +8 -0
  27. package/docker/mongo-initdb.d/mongo_setup.sh +22 -0
  28. package/ecosystem.example.json +7 -0
  29. package/errors/index.js +94 -0
  30. package/eslint.config.js +17 -0
  31. package/index.js +10 -0
  32. package/models/annotations.js +13 -0
  33. package/models/concepts.js +12 -0
  34. package/models/concordances.js +12 -0
  35. package/models/index.js +33 -0
  36. package/models/mappings.js +20 -0
  37. package/models/meta.js +21 -0
  38. package/models/registries.js +12 -0
  39. package/models/schemes.js +12 -0
  40. package/package.json +91 -0
  41. package/routes/annotations.js +83 -0
  42. package/routes/common.js +86 -0
  43. package/routes/concepts.js +64 -0
  44. package/routes/concordances.js +86 -0
  45. package/routes/data.js +19 -0
  46. package/routes/mappings.js +108 -0
  47. package/routes/registries.js +24 -0
  48. package/routes/schemes.js +72 -0
  49. package/routes/validate.js +37 -0
  50. package/server.js +190 -0
  51. package/services/abstract.js +328 -0
  52. package/services/annotations.js +237 -0
  53. package/services/concepts.js +459 -0
  54. package/services/concordances.js +264 -0
  55. package/services/data.js +30 -0
  56. package/services/index.js +34 -0
  57. package/services/mappings.js +978 -0
  58. package/services/registries.js +319 -0
  59. package/services/schemes.js +318 -0
  60. package/services/validate.js +39 -0
  61. package/status.schema.json +145 -0
  62. package/test/abstract-service.js +36 -0
  63. package/test/annotations/annotation.json +13 -0
  64. package/test/api.js +2481 -0
  65. package/test/chai.js +14 -0
  66. package/test/changes.js +179 -0
  67. package/test/concepts/conceptNoFileEnding +4 -0
  68. package/test/concepts/concepts-ddc-6-60-61-62.json +123 -0
  69. package/test/concordances/concordances.ndjson +2 -0
  70. package/test/config.js +26 -0
  71. package/test/configs/complex-config.json +90 -0
  72. package/test/configs/empty-object.json +1 -0
  73. package/test/configs/fail-array.json +1 -0
  74. package/test/configs/fail-empty.json +0 -0
  75. package/test/configs/fail-mapping-only-props1.json +5 -0
  76. package/test/configs/fail-mapping-only-props2.json +5 -0
  77. package/test/configs/fail-mapping-only-props3.json +5 -0
  78. package/test/configs/fail-mapping-only-props4.json +5 -0
  79. package/test/configs/fail-nonexisting-prop.json +3 -0
  80. package/test/configs/fail-port-string.json +3 -0
  81. package/test/configs/fail-registry-types.json +16 -0
  82. package/test/configs/registry-types.json +16 -0
  83. package/test/data-write.js +784 -0
  84. package/test/eslint.js +22 -0
  85. package/test/import-reset.js +287 -0
  86. package/test/infer-mappings.js +340 -0
  87. package/test/ipcheck.js +287 -0
  88. package/test/mappings/README.md +1 -0
  89. package/test/mappings/ddc-gnd-1.mapping.json +33 -0
  90. package/test/mappings/ddc-gnd-2.mapping.json +67 -0
  91. package/test/mappings/mapping-ddc-gnd-noScheme.json +145 -0
  92. package/test/mappings/mapping-ddc-gnd.json +175 -0
  93. package/test/mappings/mappings-ddc.json +214 -0
  94. package/test/registries/registries.ndjson +2 -0
  95. package/test/services.js +557 -0
  96. package/test/terminologies/terminologies.json +94 -0
  97. package/test/test-utils.js +182 -0
  98. package/test/utils.js +425 -0
  99. package/test/validate.js +226 -0
  100. package/utils/adjust.js +206 -0
  101. package/utils/auth.js +154 -0
  102. package/utils/changes.js +88 -0
  103. package/utils/db.js +106 -0
  104. package/utils/ipcheck.js +76 -0
  105. package/utils/middleware.js +636 -0
  106. package/utils/searchHelper.js +153 -0
  107. package/utils/status.js +77 -0
  108. package/utils/users.js +7 -0
  109. package/utils/utils.js +114 -0
  110. package/utils/uuid.js +6 -0
  111. package/utils/version.js +324 -0
  112. package/views/base.ejs +172 -0
@@ -0,0 +1,877 @@
1
+ {
2
+ "$id": "https://gbv.github.io/jskos-server/config.schema.json",
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "title": "JSKOS Server Config",
5
+ "description": "Configuration file for JSKOS Server",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "properties": {
9
+ "baseUrl": {
10
+ "description": "The baseUrl of the API",
11
+ "anyOf": [
12
+ {
13
+ "type": "null"
14
+ },
15
+ {
16
+ "$ref": "#/definitions/uri"
17
+ }
18
+ ]
19
+ },
20
+ "title": {
21
+ "description": "A custom title of the JSKOS API instance",
22
+ "type": "string"
23
+ },
24
+ "env": {
25
+ "description": "The environment the server is run in",
26
+ "type": "string",
27
+ "enum": [
28
+ "production",
29
+ "development",
30
+ "test"
31
+ ]
32
+ },
33
+ "version": {
34
+ "description": "The version of the JSKOS API specification that is used; do not set manually (uses `apiVersion` field from package.json)",
35
+ "anyOf": [
36
+ {
37
+ "type": "null"
38
+ },
39
+ {
40
+ "type": "string",
41
+ "pattern": "^\\d+\\.\\d+$"
42
+ }
43
+ ]
44
+ },
45
+ "serverVersion": {
46
+ "description": "The version of JSKOS server that a particular instance is running; do not set manually (uses `version` field from package.json)",
47
+ "anyOf": [
48
+ {
49
+ "type": "null"
50
+ },
51
+ {
52
+ "type": "string",
53
+ "pattern": "^\\d+\\.\\d+\\.\\d+$"
54
+ }
55
+ ]
56
+ },
57
+ "closedWorldAssumption": {
58
+ "description": "If false, empty JSKOS closed world statements (see specs) will be removed from returned entities",
59
+ "type": "boolean"
60
+ },
61
+ "namespace": {
62
+ "description": "A namespace string that is used for generating unique URIs.",
63
+ "type": "string"
64
+ },
65
+ "verbosity": {
66
+ "description": "Sets the verbosity level for console output (log/warn/error, default: warn)",
67
+ "anyOf": [
68
+ {
69
+ "type": "boolean"
70
+ },
71
+ {
72
+ "type": "string",
73
+ "enum": [
74
+ "log",
75
+ "warn",
76
+ "error"
77
+ ]
78
+ }
79
+ ]
80
+ },
81
+ "port": {
82
+ "description": "The port under which JSKOS Server is listening",
83
+ "type": "integer",
84
+ "minimum": 0,
85
+ "maximum": 65535
86
+ },
87
+ "changesApi": {
88
+ "description": "Ignored but allowed for backwards compatibility"
89
+ },
90
+ "changes" : {
91
+ "description": "Configuration of change stream endpoints",
92
+ "anyOf": [
93
+ {
94
+ "type": "boolean"
95
+ },
96
+ {
97
+ "type": "object",
98
+ "additionalProperties": false,
99
+ "properties": {
100
+ "retries": {
101
+ "description": "Maximum number of retries",
102
+ "type": "number"
103
+ },
104
+ "interval": {
105
+ "description": "Retry interval in milliseconds",
106
+ "type": "number"
107
+ }
108
+ }
109
+ }
110
+ ]
111
+ },
112
+ "proxies": {
113
+ "description": "A list of proxy IP addresses or ranges",
114
+ "$ref": "#/definitions/ips"
115
+ },
116
+ "mongo": {
117
+ "description": "MongDB Configuration",
118
+ "type": "object",
119
+ "additionalProperties": false,
120
+ "properties": {
121
+ "user": {
122
+ "type": "string"
123
+ },
124
+ "pass": {
125
+ "type": "string"
126
+ },
127
+ "host": {
128
+ "type": "string"
129
+ },
130
+ "port": {
131
+ "type": "number"
132
+ },
133
+ "db": {
134
+ "type": "string"
135
+ },
136
+ "options": {
137
+ "type": "object"
138
+ }
139
+ }
140
+ },
141
+ "auth": {
142
+ "description": "Describes authentication capabilities and groups of identities",
143
+ "type": "object",
144
+ "additionalProperties": false,
145
+ "properties": {
146
+ "algorithm": {
147
+ "description": "The encryption algorithm used by the login-server that provides the JWTs that are used for authenticaton",
148
+ "type": "string"
149
+ },
150
+ "key": {
151
+ "description": "The public key or symmetric secret of the login-server that is used for authentication",
152
+ "anyOf": [
153
+ {
154
+ "type": "null"
155
+ },
156
+ {
157
+ "type": "string"
158
+ }
159
+ ]
160
+ }
161
+ }
162
+ },
163
+ "identityProviders": {
164
+ "$ref": "#/definitions/identityProviders"
165
+ },
166
+ "identityGroups": {
167
+ "description": "Groups of identities",
168
+ "type": "object",
169
+ "patternProperties": {
170
+ "^([a-z0-9+.-]+):.*": {
171
+ "type": "object",
172
+ "properties": {
173
+ "identities": {
174
+ "$ref": "#/definitions/identities"
175
+ },
176
+ "claims": {
177
+ "type": "array",
178
+ "items": {
179
+ "type": "object",
180
+ "patternProperties": {
181
+ "^.*$": {
182
+ "type": "string"
183
+ }
184
+ }
185
+ }
186
+ }
187
+ }
188
+ }
189
+ },
190
+ "additionalProperties": false
191
+ },
192
+ "identities": {
193
+ "$ref": "#/definitions/identities"
194
+ },
195
+ "ips": {
196
+ "$ref": "#/definitions/ips"
197
+ },
198
+ "anonymous": {
199
+ "$ref": "#/definitions/anonymous"
200
+ },
201
+ "schemes": {
202
+ "$ref": "#/definitions/capabilityAndForbidMappingAndAnnotationOnlyProperties"
203
+ },
204
+ "concepts": {
205
+ "$ref": "#/definitions/capabilityAndForbidMappingAndAnnotationOnlyProperties"
206
+ },
207
+ "concordances": {
208
+ "$ref": "#/definitions/capabilityAndForbidMappingAndAnnotationOnlyProperties"
209
+ },
210
+ "mappings": {
211
+ "$ref": "#/definitions/capabilityAndForbidAnnotationOnlyProperties"
212
+ },
213
+ "annotations": {
214
+ "$ref": "#/definitions/capabilityAndForbidMappingOnlyProperties"
215
+ },
216
+ "registries": {
217
+ "$ref": "#/definitions/registries"
218
+ }
219
+ },
220
+ "definitions": {
221
+ "uri": {
222
+ "type": "string",
223
+ "format": "uri"
224
+ },
225
+ "uriList": {
226
+ "type": "array",
227
+ "items": {
228
+ }
229
+ },
230
+ "capabilityAndForbidMappingOnlyProperties": {
231
+ "anyOf": [
232
+ {
233
+ "type": "boolean"
234
+ },
235
+ {
236
+ "allOf": [
237
+ {
238
+ "$ref": "#/definitions/capability"
239
+ },
240
+ {
241
+ "$ref": "#/definitions/forbidMappingOnlyProperties"
242
+ }
243
+ ]
244
+ }
245
+ ]
246
+ },
247
+ "capabilityAndForbidAnnotationOnlyProperties": {
248
+ "anyOf": [
249
+ {
250
+ "type": "boolean"
251
+ },
252
+ {
253
+ "allOf": [
254
+ {
255
+ "$ref": "#/definitions/capability"
256
+ },
257
+ {
258
+ "$ref": "#/definitions/forbidAnnotationOnlyProperties"
259
+ }
260
+ ]
261
+ }
262
+ ]
263
+ },
264
+ "capabilityAndForbidMappingAndAnnotationOnlyProperties": {
265
+ "anyOf": [
266
+ {
267
+ "type": "boolean"
268
+ },
269
+ {
270
+ "allOf": [
271
+ {
272
+ "$ref": "#/definitions/capability"
273
+ },
274
+ {
275
+ "$ref": "#/definitions/forbidMappingOnlyProperties"
276
+ },
277
+ {
278
+ "$ref": "#/definitions/forbidAnnotationOnlyProperties"
279
+ }
280
+ ]
281
+ }
282
+ ]
283
+ },
284
+ "registries": {
285
+ "anyOf": [
286
+ {
287
+ "type": "boolean"
288
+ },
289
+ {
290
+ "allOf": [
291
+ {
292
+ "$ref": "#/definitions/registriesCapability"
293
+ },
294
+ {
295
+ "$ref": "#/definitions/forbidMappingOnlyProperties"
296
+ },
297
+ {
298
+ "$ref": "#/definitions/forbidAnnotationOnlyProperties"
299
+ }
300
+ ]
301
+ }
302
+ ]
303
+ },
304
+ "registriesCapability": {
305
+ "description": "Describes capabilities for registries with additional registry-specific options.",
306
+ "additionalProperties": false,
307
+ "type": "object",
308
+ "definitions": {
309
+ "registryTypeConfig": {
310
+ "anyOf": [
311
+ { "type": "boolean" },
312
+ {
313
+ "type": "object",
314
+ "additionalProperties": false,
315
+ "properties": {
316
+ "uriRequired": {
317
+ "type": "boolean"
318
+ },
319
+ "mustExist": {
320
+ "type": "boolean"
321
+ },
322
+ "skipInvalid": {
323
+ "type": "boolean"
324
+ }
325
+ }
326
+ }
327
+ ]
328
+ }
329
+ },
330
+ "properties": {
331
+ "read": {
332
+ "anyOf": [
333
+ {
334
+ "type": "boolean"
335
+ },
336
+ {
337
+ "type": "object",
338
+ "properties": {
339
+ "auth": {
340
+ "$ref": "#/definitions/capability/definitions/auth"
341
+ },
342
+ "identityProviders": {
343
+ "$ref": "#/definitions/identityProviders"
344
+ },
345
+ "identities": {
346
+ "$ref": "#/definitions/identities"
347
+ },
348
+ "ips": {
349
+ "$ref": "#/definitions/ips"
350
+ }
351
+ },
352
+ "additionalProperties": false
353
+ }
354
+ ]
355
+ },
356
+ "create": {
357
+ "anyOf": [
358
+ {
359
+ "type": "boolean"
360
+ },
361
+ {
362
+ "type": "object",
363
+ "properties": {
364
+ "auth": {
365
+ "$ref": "#/definitions/capability/definitions/auth"
366
+ },
367
+ "anonymous": {
368
+ "$ref": "#/definitions/anonymous"
369
+ },
370
+ "identityProviders": {
371
+ "$ref": "#/definitions/identityProviders"
372
+ },
373
+ "identities": {
374
+ "$ref": "#/definitions/identities"
375
+ },
376
+ "ips": {
377
+ "$ref": "#/definitions/ips"
378
+ },
379
+ "uriBase": {
380
+ "$ref": "#/definitions/uri"
381
+ },
382
+ "uriOrigin": {
383
+ "type": "string",
384
+ "enum": [
385
+ "external",
386
+ "uuid"
387
+ ]
388
+ }
389
+ },
390
+ "additionalProperties": false
391
+ }
392
+ ]
393
+ },
394
+ "update": {
395
+ "anyOf": [
396
+ {
397
+ "type": "boolean"
398
+ },
399
+ {
400
+ "type": "object",
401
+ "properties": {
402
+ "auth": {
403
+ "$ref": "#/definitions/capability/definitions/auth"
404
+ },
405
+ "crossUser": {
406
+ "$ref": "#/definitions/capability/definitions/crossUser"
407
+ },
408
+ "anonymous": {
409
+ "$ref": "#/definitions/anonymous"
410
+ },
411
+ "identityProviders": {
412
+ "$ref": "#/definitions/identityProviders"
413
+ },
414
+ "identities": {
415
+ "$ref": "#/definitions/identities"
416
+ },
417
+ "ips": {
418
+ "$ref": "#/definitions/ips"
419
+ }
420
+ },
421
+ "additionalProperties": false
422
+ }
423
+ ]
424
+ },
425
+ "delete": {
426
+ "anyOf": [
427
+ {
428
+ "type": "boolean"
429
+ },
430
+ {
431
+ "type": "object",
432
+ "properties": {
433
+ "auth": {
434
+ "$ref": "#/definitions/capability/definitions/auth"
435
+ },
436
+ "crossUser": {
437
+ "$ref": "#/definitions/capability/definitions/crossUser"
438
+ },
439
+ "anonymous": {
440
+ "$ref": "#/definitions/anonymous"
441
+ },
442
+ "identityProviders": {
443
+ "$ref": "#/definitions/identityProviders"
444
+ },
445
+ "identities": {
446
+ "$ref": "#/definitions/identities"
447
+ },
448
+ "ips": {
449
+ "$ref": "#/definitions/ips"
450
+ }
451
+ },
452
+ "additionalProperties": false
453
+ }
454
+ ]
455
+ },
456
+ "identityProviders": {
457
+ "$ref": "#/definitions/identityProviders"
458
+ },
459
+ "identities": {
460
+ "$ref": "#/definitions/identities"
461
+ },
462
+ "ips": {
463
+ "$ref": "#/definitions/ips"
464
+ },
465
+ "moderatingIdentities": {
466
+ "$ref": "#/definitions/identities"
467
+ },
468
+ "anonymous": {
469
+ "$ref": "#/definitions/anonymous"
470
+ },
471
+ "cardinality": {
472
+ "type": "string",
473
+ "enum": [
474
+ "1-to-1",
475
+ "1-to-n"
476
+ ]
477
+ },
478
+ "fromSchemeWhitelist": {
479
+ "anyOf": [
480
+ {
481
+ "type": "null"
482
+ },
483
+ {
484
+ "type": "array",
485
+ "items": {
486
+ "type": "object",
487
+ "required": [
488
+ "uri"
489
+ ],
490
+ "properties": {
491
+ "uri": {
492
+ "$ref": "#/definitions/uri"
493
+ },
494
+ "identifier": {
495
+ "$ref": "#/definitions/uriList"
496
+ }
497
+ }
498
+ }
499
+ }
500
+ ]
501
+ },
502
+ "toSchemeWhitelist": {
503
+ "anyOf": [
504
+ {
505
+ "type": "null"
506
+ },
507
+ {
508
+ "type": "array",
509
+ "items": {
510
+ "type": "object",
511
+ "required": [
512
+ "uri"
513
+ ],
514
+ "properties": {
515
+ "uri": {
516
+ "$ref": "#/definitions/uri"
517
+ },
518
+ "identifier": {
519
+ "$ref": "#/definitions/uriList"
520
+ }
521
+ }
522
+ }
523
+ }
524
+ ]
525
+ },
526
+ "mismatchTagVocabulary": {
527
+ "anyOf": [
528
+ {
529
+ "type": "null"
530
+ },
531
+ {
532
+ "type": "object"
533
+ }
534
+ ]
535
+ },
536
+ "types": {
537
+ "type": "object",
538
+ "additionalProperties": false,
539
+ "properties": {
540
+ "concepts": {
541
+ "$ref": "#/definitions/registriesCapability/definitions/registryTypeConfig"
542
+ },
543
+ "schemes": {
544
+ "$ref": "#/definitions/registriesCapability/definitions/registryTypeConfig"
545
+ },
546
+ "concordances": {
547
+ "$ref": "#/definitions/registriesCapability/definitions/registryTypeConfig"
548
+ },
549
+ "registries": {
550
+ "$ref": "#/definitions/registriesCapability/definitions/registryTypeConfig"
551
+ },
552
+ "mappings": {
553
+ "$ref": "#/definitions/registriesCapability/definitions/registryTypeConfig"
554
+ },
555
+ "annotations": {
556
+ "$ref": "#/definitions/registriesCapability/definitions/registryTypeConfig"
557
+ }
558
+ }
559
+ },
560
+ "mixedTypes": {
561
+ "type": "boolean"
562
+ }
563
+ }
564
+ },
565
+ "capability": {
566
+ "description": "Describes capabilities for a certain item type.",
567
+ "additionalProperties": false,
568
+ "type": "object",
569
+ "definitions": {
570
+ "auth": {
571
+ "description": "Indicates whether a certain action requires authentication.",
572
+ "type": "boolean"
573
+ },
574
+ "crossUser": {
575
+ "description": "Indicates whether a certain action can be performed on items that were created by a different user (boolean or list of user URIs).",
576
+ "anyOf": [
577
+ {
578
+ "type": "boolean"
579
+ },
580
+ {
581
+ "$ref": "#/definitions/uriList"
582
+ }
583
+ ]
584
+ }
585
+ },
586
+ "properties": {
587
+ "read": {
588
+ "anyOf": [
589
+ {
590
+ "type": "boolean"
591
+ },
592
+ {
593
+ "type": "object",
594
+ "properties": {
595
+ "auth": {
596
+ "$ref": "#/definitions/capability/definitions/auth"
597
+ },
598
+ "identityProviders": {
599
+ "$ref": "#/definitions/identityProviders"
600
+ },
601
+ "identities": {
602
+ "$ref": "#/definitions/identities"
603
+ },
604
+ "ips": {
605
+ "$ref": "#/definitions/ips"
606
+ }
607
+ },
608
+ "additionalProperties": false
609
+ }
610
+ ]
611
+ },
612
+ "create": {
613
+ "anyOf": [
614
+ {
615
+ "type": "boolean"
616
+ },
617
+ {
618
+ "type": "object",
619
+ "properties": {
620
+ "auth": {
621
+ "$ref": "#/definitions/capability/definitions/auth"
622
+ },
623
+ "anonymous": {
624
+ "$ref": "#/definitions/anonymous"
625
+ },
626
+ "identityProviders": {
627
+ "$ref": "#/definitions/identityProviders"
628
+ },
629
+ "identities": {
630
+ "$ref": "#/definitions/identities"
631
+ },
632
+ "ips": {
633
+ "$ref": "#/definitions/ips"
634
+ },
635
+ "uriBase": {
636
+ "$ref": "#/definitions/uri"
637
+ },
638
+ "uriOrigin": {
639
+ "type": "string",
640
+ "enum": [
641
+ "external",
642
+ "uuid"
643
+ ]
644
+ }
645
+ },
646
+ "additionalProperties": false
647
+ }
648
+ ]
649
+ },
650
+ "update": {
651
+ "anyOf": [
652
+ {
653
+ "type": "boolean"
654
+ },
655
+ {
656
+ "type": "object",
657
+ "properties": {
658
+ "auth": {
659
+ "$ref": "#/definitions/capability/definitions/auth"
660
+ },
661
+ "crossUser": {
662
+ "$ref": "#/definitions/capability/definitions/crossUser"
663
+ },
664
+ "anonymous": {
665
+ "$ref": "#/definitions/anonymous"
666
+ },
667
+ "identityProviders": {
668
+ "$ref": "#/definitions/identityProviders"
669
+ },
670
+ "identities": {
671
+ "$ref": "#/definitions/identities"
672
+ },
673
+ "ips": {
674
+ "$ref": "#/definitions/ips"
675
+ }
676
+ },
677
+ "additionalProperties": false
678
+ }
679
+ ]
680
+ },
681
+ "delete": {
682
+ "anyOf": [
683
+ {
684
+ "type": "boolean"
685
+ },
686
+ {
687
+ "type": "object",
688
+ "properties": {
689
+ "auth": {
690
+ "$ref": "#/definitions/capability/definitions/auth"
691
+ },
692
+ "crossUser": {
693
+ "$ref": "#/definitions/capability/definitions/crossUser"
694
+ },
695
+ "anonymous": {
696
+ "$ref": "#/definitions/anonymous"
697
+ },
698
+ "identityProviders": {
699
+ "$ref": "#/definitions/identityProviders"
700
+ },
701
+ "identities": {
702
+ "$ref": "#/definitions/identities"
703
+ },
704
+ "ips": {
705
+ "$ref": "#/definitions/ips"
706
+ }
707
+ },
708
+ "additionalProperties": false
709
+ }
710
+ ]
711
+ },
712
+ "identityProviders": {
713
+ "$ref": "#/definitions/identityProviders"
714
+ },
715
+ "identities": {
716
+ "$ref": "#/definitions/identities"
717
+ },
718
+ "ips": {
719
+ "$ref": "#/definitions/ips"
720
+ },
721
+ "moderatingIdentities": {
722
+ "$ref": "#/definitions/identities"
723
+ },
724
+ "anonymous": {
725
+ "$ref": "#/definitions/anonymous"
726
+ },
727
+ "cardinality": {
728
+ "type": "string",
729
+ "enum": [
730
+ "1-to-1",
731
+ "1-to-n"
732
+ ]
733
+ },
734
+ "fromSchemeWhitelist": {
735
+ "anyOf": [
736
+ {
737
+ "type": "null"
738
+ },
739
+ {
740
+ "type": "array",
741
+ "items": {
742
+ "type": "object",
743
+ "required": [
744
+ "uri"
745
+ ],
746
+ "properties": {
747
+ "uri": {
748
+ "$ref": "#/definitions/uri"
749
+ },
750
+ "identifier": {
751
+ "$ref": "#/definitions/uriList"
752
+ }
753
+ }
754
+ }
755
+ }
756
+ ]
757
+ },
758
+ "toSchemeWhitelist": {
759
+ "anyOf": [
760
+ {
761
+ "type": "null"
762
+ },
763
+ {
764
+ "type": "array",
765
+ "items": {
766
+ "type": "object",
767
+ "required": [
768
+ "uri"
769
+ ],
770
+ "properties": {
771
+ "uri": {
772
+ "$ref": "#/definitions/uri"
773
+ },
774
+ "identifier": {
775
+ "$ref": "#/definitions/uriList"
776
+ }
777
+ }
778
+ }
779
+ }
780
+ ]
781
+ },
782
+ "mismatchTagVocabulary": {
783
+ "anyOf": [
784
+ {
785
+ "type": "null"
786
+ },
787
+ {
788
+ "type": "object"
789
+ }
790
+ ]
791
+ }
792
+ }
793
+ },
794
+ "identityProviders": {
795
+ "description": "A list of identity providers, one of which is required to perform a certain action. `null` if not applicable.",
796
+ "anyOf": [
797
+ {
798
+ "type": "null"
799
+ },
800
+ {
801
+ "type": "array",
802
+ "items": {
803
+ "type": "string"
804
+ }
805
+ }
806
+ ]
807
+ },
808
+ "identities": {
809
+ "description": "A list of identity URIs that are allowed to perform a certain action. `null` if not applicable.",
810
+ "anyOf": [
811
+ {
812
+ "type": "null"
813
+ },
814
+ {
815
+ "$ref": "#/definitions/uriList"
816
+ }
817
+ ]
818
+ },
819
+ "ips": {
820
+ "description": "A list of IP addresses or IP ranges that are allowed to perform a certain action. `null` if not applicable.",
821
+ "anyOf": [
822
+ {
823
+ "type": "null"
824
+ },
825
+ {
826
+ "type": "array",
827
+ "items": {
828
+ "type": "string",
829
+ "pattern": "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(?:\/(?:3[0-2]|[0-2]?[0-9]))?$"
830
+ }
831
+ }
832
+ ]
833
+ },
834
+ "anonymous": {
835
+ "description": "Indicates whether a certain action can be performed anonymously (i.e. no creator/contributor will be saved).",
836
+ "type": "boolean"
837
+ },
838
+ "forbidMappingOnlyProperties": {
839
+ "$comment": "Use in non-mapping definitions. Needed to ensure that no additional properties are allowed.",
840
+ "not": {
841
+ "anyOf": [
842
+ {
843
+ "type": "object",
844
+ "required": [
845
+ "cardinality"
846
+ ]
847
+ },
848
+ {
849
+ "type": "object",
850
+ "required": [
851
+ "fromSchemeWhitelist"
852
+ ]
853
+ },
854
+ {
855
+ "type": "object",
856
+ "required": [
857
+ "toSchemeWhitelist"
858
+ ]
859
+ }
860
+ ]
861
+ }
862
+ },
863
+ "forbidAnnotationOnlyProperties": {
864
+ "$comment": "Use in non-annotation definitions. Needed to ensure that no additional properties are allowed.",
865
+ "not": {
866
+ "anyOf": [
867
+ {
868
+ "type": "object",
869
+ "required": [
870
+ "mismatchTagVocabulary"
871
+ ]
872
+ }
873
+ ]
874
+ }
875
+ }
876
+ }
877
+ }