|
4 | 4 | "description": "Authorization restrictions from an external authorization service.", |
5 | 5 | "type": "object", |
6 | 6 | "properties": { |
| 7 | + "version": { |
| 8 | + "description": "The version of the schema.", |
| 9 | + "type": "integer", |
| 10 | + "format": "uint32", |
| 11 | + "minimum": 1 |
| 12 | + }, |
7 | 13 | "htsgetAuth": { |
8 | 14 | "description": "The authorization rules.", |
9 | 15 | "type": "array", |
10 | 16 | "items": { |
11 | 17 | "$ref": "#/$defs/AuthorizationRule" |
12 | 18 | }, |
13 | 19 | "minItems": 1 |
14 | | - }, |
15 | | - "version": { |
16 | | - "description": "The version of the schema.", |
17 | | - "type": "integer", |
18 | | - "format": "uint32", |
19 | | - "minimum": 1 |
20 | 20 | } |
21 | 21 | }, |
22 | 22 | "additionalProperties": false, |
|
26 | 26 | "description": "Individual authorization rule defining access permissions.", |
27 | 27 | "type": "object", |
28 | 28 | "properties": { |
29 | | - "path": { |
30 | | - "description": "The path that the authorization applies to. This should not contain the `/reads` or `/variants` component of the path, and it can be a regex.", |
31 | | - "type": "string", |
32 | | - "minLength": 1 |
| 29 | + "location": { |
| 30 | + "description": "The location that the authorization applies to.", |
| 31 | + "$ref": "#/$defs/Location" |
33 | 32 | }, |
34 | | - "referenceNames": { |
| 33 | + "rules": { |
35 | 34 | "description": "The reference name restrictions to apply to this path.", |
36 | 35 | "type": ["array", "null"], |
37 | 36 | "items": { |
|
40 | 39 | } |
41 | 40 | }, |
42 | 41 | "additionalProperties": false, |
43 | | - "required": ["path"] |
| 42 | + "required": ["location"] |
44 | 43 | }, |
45 | | - "Format": { |
46 | | - "description": "An enumeration with all the possible formats.", |
| 44 | + "Location": { |
| 45 | + "description": "Either simple or regex based location.", |
| 46 | + "anyOf": [ |
| 47 | + { |
| 48 | + "description": "Use a simple location.", |
| 49 | + "$ref": "#/$defs/SimpleLocation" |
| 50 | + }, |
| 51 | + { |
| 52 | + "description": "Use a regex location.", |
| 53 | + "$ref": "#/$defs/RegexLocation" |
| 54 | + } |
| 55 | + ] |
| 56 | + }, |
| 57 | + "SimpleLocation": { |
| 58 | + "description": "A simple location config.", |
| 59 | + "anyOf": [ |
| 60 | + { |
| 61 | + "$ref": "#/$defs/StringLocation" |
| 62 | + } |
| 63 | + ] |
| 64 | + }, |
| 65 | + "StringLocation": { |
| 66 | + "description": "Deserialize the location from a string with a protocol and either a prefix or exact id match logic.", |
| 67 | + "type": "object", |
| 68 | + "properties": { |
| 69 | + "location": { |
| 70 | + "description": "The location, which should start with `file://`, `s3://`, `http://` or `https://`.", |
| 71 | + "type": ["string", "null"], |
| 72 | + "default": null |
| 73 | + } |
| 74 | + }, |
| 75 | + "unevaluatedProperties": false, |
| 76 | + "oneOf": [ |
| 77 | + { |
| 78 | + "description": "Use prefix matching logic, where the requested id should start with the prefix.", |
| 79 | + "type": "object", |
| 80 | + "properties": { |
| 81 | + "prefix": { |
| 82 | + "type": "string" |
| 83 | + } |
| 84 | + }, |
| 85 | + "required": ["prefix"] |
| 86 | + }, |
| 87 | + { |
| 88 | + "description": "Use exact id matching logic, where the requested id should be equal to this id.", |
| 89 | + "type": "object", |
| 90 | + "properties": { |
| 91 | + "id": { |
| 92 | + "type": "string" |
| 93 | + } |
| 94 | + }, |
| 95 | + "required": ["id"] |
| 96 | + } |
| 97 | + ] |
| 98 | + }, |
| 99 | + "RegexLocation": { |
| 100 | + "description": "Specify that the location is a regex location that can arbitrarily map IDs using regex strings.", |
| 101 | + "type": "object", |
| 102 | + "properties": { |
| 103 | + "regex": { |
| 104 | + "description": "The regex to match the id against.", |
| 105 | + "type": ["string", "null"] |
| 106 | + }, |
| 107 | + "substitution_string": { |
| 108 | + "description": "A substitution string to find the data when using a location.", |
| 109 | + "type": ["string", "null"], |
| 110 | + "default": null |
| 111 | + }, |
| 112 | + "backend": { |
| 113 | + "description": "The backend of the location if configured.", |
| 114 | + "anyOf": [ |
| 115 | + { |
| 116 | + "$ref": "#/$defs/Backend" |
| 117 | + }, |
| 118 | + { |
| 119 | + "type": "null" |
| 120 | + } |
| 121 | + ], |
| 122 | + "default": null |
| 123 | + } |
| 124 | + }, |
| 125 | + "additionalProperties": false |
| 126 | + }, |
| 127 | + "Backend": { |
| 128 | + "description": "Specify the storage backend to use as config values.", |
| 129 | + "oneOf": [ |
| 130 | + { |
| 131 | + "description": "Configure the server to fetch data and return tickets from a local filesystem.", |
| 132 | + "type": "object", |
| 133 | + "properties": { |
| 134 | + "scheme": { |
| 135 | + "description": "The ticket response scheme to the data server.", |
| 136 | + "$ref": "#/$defs/Scheme", |
| 137 | + "default": "HTTP" |
| 138 | + }, |
| 139 | + "authority": { |
| 140 | + "description": "The authority of the data server.", |
| 141 | + "type": "string", |
| 142 | + "default": "127.0.0.1:8081" |
| 143 | + }, |
| 144 | + "local_path": { |
| 145 | + "description": "The local path to serve files from.", |
| 146 | + "type": "string", |
| 147 | + "default": "./" |
| 148 | + }, |
| 149 | + "keys": { |
| 150 | + "description": "Configure the server to fetch data and return tickets from S3.", |
| 151 | + "anyOf": [ |
| 152 | + { |
| 153 | + "$ref": "#/$defs/C4GHKeys" |
| 154 | + }, |
| 155 | + { |
| 156 | + "type": "null" |
| 157 | + } |
| 158 | + ], |
| 159 | + "writeOnly": true |
| 160 | + }, |
| 161 | + "ticket_origin": { |
| 162 | + "description": "The origin of the tickets, which can be different to the data server address.", |
| 163 | + "type": ["string", "null"], |
| 164 | + "default": null |
| 165 | + }, |
| 166 | + "kind": { |
| 167 | + "type": "string", |
| 168 | + "const": "File" |
| 169 | + } |
| 170 | + }, |
| 171 | + "additionalProperties": false, |
| 172 | + "required": ["kind"] |
| 173 | + }, |
| 174 | + { |
| 175 | + "description": "Configure the server to fetch data and return tickets from S3.", |
| 176 | + "type": "object", |
| 177 | + "properties": { |
| 178 | + "bucket": { |
| 179 | + "description": "The bucket to use.", |
| 180 | + "type": "string", |
| 181 | + "default": "" |
| 182 | + }, |
| 183 | + "endpoint": { |
| 184 | + "description": "The S3 endpoint to use.", |
| 185 | + "type": ["string", "null"], |
| 186 | + "default": null |
| 187 | + }, |
| 188 | + "path_style": { |
| 189 | + "description": "Whether path style or virtual host addressing should be used.", |
| 190 | + "type": "boolean", |
| 191 | + "default": false |
| 192 | + }, |
| 193 | + "keys": { |
| 194 | + "description": "Optional Crypt4GH keys to use when decrypting data.", |
| 195 | + "anyOf": [ |
| 196 | + { |
| 197 | + "$ref": "#/$defs/C4GHKeys" |
| 198 | + }, |
| 199 | + { |
| 200 | + "type": "null" |
| 201 | + } |
| 202 | + ], |
| 203 | + "writeOnly": true |
| 204 | + }, |
| 205 | + "kind": { |
| 206 | + "type": "string", |
| 207 | + "const": "S3" |
| 208 | + } |
| 209 | + }, |
| 210 | + "additionalProperties": false, |
| 211 | + "required": ["kind"] |
| 212 | + }, |
| 213 | + { |
| 214 | + "description": "Configure the server to reach out to a remote URL to fetch data.", |
| 215 | + "type": "object", |
| 216 | + "properties": { |
| 217 | + "url": { |
| 218 | + "type": "string", |
| 219 | + "default": "/" |
| 220 | + }, |
| 221 | + "response_url": { |
| 222 | + "type": ["string", "null"], |
| 223 | + "default": null |
| 224 | + }, |
| 225 | + "forward_headers": { |
| 226 | + "type": "boolean", |
| 227 | + "default": true |
| 228 | + }, |
| 229 | + "header_blacklist": { |
| 230 | + "type": "array", |
| 231 | + "items": { |
| 232 | + "type": "string" |
| 233 | + }, |
| 234 | + "default": [] |
| 235 | + }, |
| 236 | + "keys": { |
| 237 | + "anyOf": [ |
| 238 | + { |
| 239 | + "$ref": "#/$defs/C4GHKeys" |
| 240 | + }, |
| 241 | + { |
| 242 | + "type": "null" |
| 243 | + } |
| 244 | + ], |
| 245 | + "writeOnly": true |
| 246 | + }, |
| 247 | + "kind": { |
| 248 | + "type": "string", |
| 249 | + "const": "Url" |
| 250 | + } |
| 251 | + }, |
| 252 | + "additionalProperties": false, |
| 253 | + "required": ["kind"] |
| 254 | + } |
| 255 | + ] |
| 256 | + }, |
| 257 | + "Scheme": { |
| 258 | + "description": "Schemes that can be used with htsget.", |
47 | 259 | "type": "string", |
48 | | - "enum": ["Bam", "Cram", "Vcf", "Bcf"] |
| 260 | + "enum": ["HTTP", "HTTPS"] |
| 261 | + }, |
| 262 | + "C4GHKeys": { |
| 263 | + "description": "Specifies the location of a Crypt4GH key.", |
| 264 | + "oneOf": [ |
| 265 | + { |
| 266 | + "description": "Obtain keys from a local file.", |
| 267 | + "type": "object", |
| 268 | + "properties": { |
| 269 | + "private": { |
| 270 | + "description": "The path to the private key.", |
| 271 | + "type": "string" |
| 272 | + }, |
| 273 | + "public": { |
| 274 | + "description": "The path to the public key.", |
| 275 | + "type": "string" |
| 276 | + }, |
| 277 | + "kind": { |
| 278 | + "type": "string", |
| 279 | + "const": "File" |
| 280 | + } |
| 281 | + }, |
| 282 | + "additionalProperties": false, |
| 283 | + "required": ["kind", "private", "public"] |
| 284 | + }, |
| 285 | + { |
| 286 | + "description": "Obtain keys from AWS secrets manager.", |
| 287 | + "type": "object", |
| 288 | + "properties": { |
| 289 | + "private": { |
| 290 | + "description": "The ARN or name of the secret holding the private key.", |
| 291 | + "type": "string" |
| 292 | + }, |
| 293 | + "public": { |
| 294 | + "description": "The ARN or name of the secret holding the public key.", |
| 295 | + "type": "string" |
| 296 | + }, |
| 297 | + "kind": { |
| 298 | + "type": "string", |
| 299 | + "const": "SecretsManager" |
| 300 | + } |
| 301 | + }, |
| 302 | + "additionalProperties": false, |
| 303 | + "required": ["kind", "private", "public"] |
| 304 | + } |
| 305 | + ] |
49 | 306 | }, |
50 | 307 | "ReferenceNameRestriction": { |
51 | 308 | "description": "Restriction on genomic reference names and coordinate ranges.", |
52 | 309 | "type": "object", |
53 | 310 | "properties": { |
54 | | - "end": { |
55 | | - "description": "The end interval (0-based, exclusive).", |
56 | | - "type": ["integer", "null"], |
57 | | - "format": "uint32", |
58 | | - "minimum": 0 |
| 311 | + "referenceName": { |
| 312 | + "description": "The reference name to allow. Allows all reference names if unspecified.", |
| 313 | + "type": ["string", "null"] |
59 | 314 | }, |
60 | 315 | "format": { |
61 | 316 | "description": "The format to allow. Allows all formats if unspecified.", |
|
68 | 323 | } |
69 | 324 | ] |
70 | 325 | }, |
71 | | - "name": { |
72 | | - "description": "The reference name to allow.", |
73 | | - "type": "string", |
74 | | - "minLength": 1 |
75 | | - }, |
76 | 326 | "start": { |
77 | 327 | "description": "The start interval (0-based, inclusive).", |
78 | 328 | "type": ["integer", "null"], |
79 | 329 | "format": "uint32", |
80 | 330 | "minimum": 0 |
| 331 | + }, |
| 332 | + "end": { |
| 333 | + "description": "The end interval (0-based, exclusive).", |
| 334 | + "type": ["integer", "null"], |
| 335 | + "format": "uint32", |
| 336 | + "minimum": 0 |
81 | 337 | } |
82 | 338 | }, |
83 | | - "additionalProperties": false, |
84 | | - "required": ["name"] |
| 339 | + "additionalProperties": false |
| 340 | + }, |
| 341 | + "Format": { |
| 342 | + "description": "An enumeration with all the possible formats.", |
| 343 | + "type": "string", |
| 344 | + "enum": ["Bam", "Cram", "Vcf", "Bcf"] |
85 | 345 | } |
86 | 346 | } |
87 | 347 | } |
0 commit comments