fhirsmith 0.14.0 → 0.14.2
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.
- package/CHANGELOG.md +64 -0
- package/README.md +3 -2
- package/config-template.json +20 -0
- package/library/fhir-openapi-schema.js +441 -0
- package/library/html-server.js +9 -3
- package/library/languages.js +15 -0
- package/library/npm-audit.js +265 -0
- package/library/openapi-doc.js +557 -0
- package/library/same-origin.js +62 -0
- package/library/utilities.js +21 -0
- package/nginx.md +17 -9
- package/package.json +10 -4
- package/packages/openapi.js +13 -0
- package/packages/openapi.yaml +603 -0
- package/packages/packages-template.html +4 -2
- package/packages/packages.js +286 -81
- package/packages/readme.md +120 -0
- package/publisher/publisher-template.html +1 -0
- package/publisher/publisher.js +95 -42
- package/registry/api.js +117 -41
- package/registry/crawler.js +24 -0
- package/registry/fhirsmith-releases.js +170 -0
- package/registry/model.js +10 -0
- package/registry/openapi.js +13 -0
- package/registry/openapi.yaml +311 -0
- package/registry/readme.md +107 -208
- package/registry/registry-template.html +4 -1
- package/registry/registry.js +183 -20
- package/server.js +25 -6
- package/testing/openapi-schemas.config.js +58 -0
- package/testing/openapi-schemas.json +1920 -0
- package/testing/openapi.js +15 -0
- package/testing/openapi.yaml +273 -0
- package/testing/readme.md +75 -1
- package/testing/render.js +270 -29
- package/testing/search.js +1 -1
- package/testing/store.js +152 -8
- package/testing/testing-template.html +2 -0
- package/testing/testing.js +307 -9
- package/translations/Messages.properties +1 -0
- package/tx/README.md +58 -0
- package/tx/cm/cm-database.js +10 -1
- package/tx/cm/cm-package.js +8 -1
- package/tx/cs/cs-rxnorm.js +23 -6
- package/tx/cs/cs-snomed.js +3 -72
- package/tx/html/tx-template.html +2 -0
- package/tx/library/canonical-resource.js +50 -1
- package/tx/library/codesystem.js +1 -0
- package/tx/library/conceptmap.js +1 -0
- package/tx/library/valueset.js +16 -0
- package/tx/library.js +17 -2
- package/tx/openapi-operations.js +363 -0
- package/tx/openapi-schemas.config.js +118 -0
- package/tx/openapi-schemas.json +7903 -0
- package/tx/openapi.js +289 -0
- package/tx/openapi.yaml +151 -0
- package/tx/operation-context.js +15 -0
- package/tx/params.js +3 -12
- package/tx/provider.js +10 -1
- package/tx/sct/editions.js +70 -0
- package/tx/tx-html.js +6 -0
- package/tx/tx.js +55 -0
- package/tx/vs/vs-database.js +14 -5
- package/tx/vs/vs-package.js +10 -0
- package/tx/workers/expand.js +37 -18
- package/tx/workers/metadata.js +0 -13
- package/tx/workers/translate.js +25 -1
- package/tx/workers/validate.js +74 -24
- package/tx/workers/worker.js +32 -43
- package/utilities/extract-schema-json.js +167 -0
- package/utilities/generate-openapi-schemas.js +49 -0
- package/utilities/submit-test-report.js +1 -1
- package/xig/xig.js +2 -4
package/nginx.md
CHANGED
|
@@ -13,13 +13,13 @@ public servers (tx.fhir.org, packages.fhir.org and so on) use.
|
|
|
13
13
|
|
|
14
14
|
### Headers to pass to the server
|
|
15
15
|
|
|
16
|
-
FHIRsmith runs Express with `trust proxy` enabled (`server.trustProxy` in config.json
|
|
17
|
-
default
|
|
18
|
-
`X-Forwarded-*` headers, so nginx has to set them:
|
|
16
|
+
FHIRsmith runs Express with `trust proxy` enabled (`server.trustProxy` in config.json; by
|
|
17
|
+
default it trusts proxies on the same host or a private network). That means it takes the
|
|
18
|
+
client address, scheme and host from the `X-Forwarded-*` headers, so nginx has to set them:
|
|
19
19
|
|
|
20
20
|
| Header | nginx value | What FHIRsmith uses it for |
|
|
21
21
|
|---|---|---|
|
|
22
|
-
| `Host` | `$host` | The base URL in the CapabilityStatement, TerminologyCapabilities and other self-references. It is taken from the host the client asked for |
|
|
22
|
+
| `Host` | `$host` | The base URL in the CapabilityStatement, TerminologyCapabilities and other self-references. It is taken from the host the client asked for. The publisher and testing modules also check the `Origin` of every form post against it, and refuse posts from anywhere else - so if nginx sends a different `Host` (e.g. `proxy_pass` with the default `$proxy_host`), every login and form fails with a 403 |
|
|
23
23
|
| `X-Forwarded-Proto` | `$scheme` | The scheme of those same base URLs, and the `Secure` session cookie used by the publisher and token modules. If this header is missing, an HTTPS server advertises `http://` URLs and publisher login fails silently: you are sent back to the login page, still logged out |
|
|
24
24
|
| `X-Forwarded-For` | `$proxy_add_x_forwarded_for` | The client IP address in audit and security logs (`req.ip`). If this header is missing, every request is logged as coming from `127.0.0.1` |
|
|
25
25
|
| `X-Request-Id` | `$request_id` | Optional. FHIRsmith echoes it back on the response, so a client's report can be matched to a line in the nginx log (add `$request_id` to your `log_format`) |
|
|
@@ -49,11 +49,19 @@ them:
|
|
|
49
49
|
|
|
50
50
|
### Trusting the proxy
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
By default FHIRsmith believes the `X-Forwarded-*` headers only when the request comes from
|
|
53
|
+
a loopback, link-local or private address (`"loopback, linklocal, uniquelocal"`) - nginx on
|
|
54
|
+
the same machine, or on the same docker or private network. A request straight from the
|
|
55
|
+
internet can't set its own client address, so it can't get round the rate limits on logins,
|
|
56
|
+
report submission and the publisher's task actions.
|
|
57
|
+
|
|
58
|
+
If your proxy is somewhere else (a cloud load balancer with a public address, say), set
|
|
59
|
+
`server.trustProxy` to its address, or to the number of proxy hops; any value Express's
|
|
60
|
+
`trust proxy` setting accepts will work. If you run FHIRsmith without a proxy, set it to
|
|
61
|
+
`false`. Avoid `true`: it believes any `X-Forwarded-For`, so anyone who can reach the
|
|
62
|
+
FHIRsmith port directly can name their own IP address, and express-rate-limit logs
|
|
63
|
+
`ERR_ERL_PERMISSIVE_TRUST_PROXY` to say so. Either way, firewalling the port so that only
|
|
64
|
+
nginx can reach it is still a good idea.
|
|
57
65
|
|
|
58
66
|
### Upstream connections
|
|
59
67
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fhirsmith",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.2",
|
|
4
4
|
"txVersion": "1.9.5-SNAPSHOT",
|
|
5
5
|
"description": "A Node.js server that provides a collection of tools to serve the FHIR ecosystem",
|
|
6
6
|
"main": "server.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"cli-progress": "^3.12.0",
|
|
42
42
|
"commander": "^14.0.3",
|
|
43
43
|
"commonmark": "^0.31.2",
|
|
44
|
-
"connect-sqlite3": "^0.9.
|
|
44
|
+
"connect-sqlite3": "^0.9.18",
|
|
45
45
|
"cors": "^2.8.6",
|
|
46
46
|
"express": "^5.2.1",
|
|
47
47
|
"express-rate-limit": "^7.4.1",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"properties-file": "^3.6.4",
|
|
65
65
|
"re2js": "^2.8.0",
|
|
66
66
|
"rimraf": "^5.0.10",
|
|
67
|
-
"sqlite3": "^
|
|
67
|
+
"sqlite3": "^6.0.1",
|
|
68
68
|
"tar": "^7.5.7",
|
|
69
69
|
"winston": "^3.19.0",
|
|
70
70
|
"winston-daily-rotate-file": "^4.7.1",
|
|
@@ -74,6 +74,7 @@
|
|
|
74
74
|
"@types/jest": "^29.5.8",
|
|
75
75
|
"@typescript-eslint/eslint-plugin": "^8.54.0",
|
|
76
76
|
"@typescript-eslint/parser": "^8.54.0",
|
|
77
|
+
"ajv": "^8.20.0",
|
|
77
78
|
"eslint": "^8.57.1",
|
|
78
79
|
"eslint-plugin-promise": "^7.2.1",
|
|
79
80
|
"jest": "^29.7.0",
|
|
@@ -111,7 +112,12 @@
|
|
|
111
112
|
"inquirer": {
|
|
112
113
|
"lodash": "4.18.1"
|
|
113
114
|
},
|
|
114
|
-
"brace-expansion": "^5.0.8"
|
|
115
|
+
"brace-expansion": "^5.0.8",
|
|
116
|
+
"csv-parse": "^7.0.3",
|
|
117
|
+
"uuid": "^11.1.1",
|
|
118
|
+
"connect-sqlite3": {
|
|
119
|
+
"sqlite3": "$sqlite3"
|
|
120
|
+
}
|
|
115
121
|
},
|
|
116
122
|
"bin": {
|
|
117
123
|
"tx-import": "./tx/importers/tx-import.js",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026, Health Intersections Pty Ltd (http://www.healthintersections.com.au)
|
|
3
|
+
//
|
|
4
|
+
// Licensed under BSD-3: https://opensource.org/license/bsd-3-clause
|
|
5
|
+
//
|
|
6
|
+
|
|
7
|
+
// The package server's OpenAPI description. openapi.yaml is the source of truth; see the
|
|
8
|
+
// comment at its top.
|
|
9
|
+
|
|
10
|
+
const path = require('path');
|
|
11
|
+
const { createOpenApiDoc } = require('../library/openapi-doc');
|
|
12
|
+
|
|
13
|
+
module.exports = createOpenApiDoc(path.join(__dirname, 'openapi.yaml'), '/packages');
|