Skip to content

Commit 68161f0

Browse files
committed
Migrate to new @fhirstarter/backend
1 parent cb8f8eb commit 68161f0

10 files changed

Lines changed: 646 additions & 1296 deletions

File tree

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
FHIR_BASE_URL=https://fhir.example.org # Base FHIR URL. Derives server -> <base>/api/FHIR/<version> and token -> <base>/oauth2/token
66
# Optional if FHIR_SERVER_URL is set (and FHIR_TOKEN_URL for smart auth)
77
FHIR_CLIENT_ID=your-client-id # SMART Backend Services client ID
8-
FHIR_ACTIVE_KEY=your-base64-encoded-key # Base64-encoded RSA PKCS#8 PEM private key
8+
FHIR_ACTIVE_KEY=your-base64-encoded-key # Base64-encoded PKCS#8 PEM private key (RSA or EC P-384)
99

1010
# ═══════════════════════════════════════════════════════════════════════════
1111
# Server & Transport

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ be expanded, trimmed, or replaced through config files without source changes.
4848
- Node.js >= 24
4949
- A supported FHIR server
5050
- For SMART auth (default): a SMART Backend Services client registration and an
51-
RSA-2048 private key whose public key is available through JWKS
51+
RSA-2048 or EC P-384 private key whose public key is available through JWKS
5252

5353
To run against a public, unauthenticated FHIR test server, set `FHIR_AUTH=none`
5454
and skip the client and key entirely (see [Unauthenticated Access](#unauthenticated-access)).
@@ -97,9 +97,9 @@ For desktop MCP clients, stdio is usually the simplest transport:
9797
}
9898
```
9999

100-
`FHIR_ACTIVE_KEY` is your RSA PKCS#8 private key, base64-encoded. The `kid` is
101-
derived automatically at startup via a truncated JWK Thumbprint and logged to
102-
the console.
100+
`FHIR_ACTIVE_KEY` is your PKCS#8 private key (RSA or EC P-384), base64-encoded.
101+
The `kid` is derived automatically at startup via a truncated JWK Thumbprint and
102+
logged to the console.
103103

104104
#### Unauthenticated Access
105105

@@ -354,14 +354,15 @@ fhirHydrant uses SMART Backend Services: client credentials plus a signed JWT
354354
assertion. This is backend FHIR access, not browser-based SMART standalone
355355
launch; there is no interactive redirect/login flow in the MCP path.
356356

357-
`FHIR_ACTIVE_KEY` holds the raw RSA PKCS#8 signing key. In HTTP mode, the
358-
built-in `/jwks` endpoint exposes public keys for the active key plus any
359-
retired keys when `FHIR_JWKS_URL` is unset. The `kid` for each key is derived
360-
automatically via a truncated RFC 7638 JWK Thumbprint (first 12 base64url chars
361-
of SHA-256 over canonical RSA public JWK members) and logged at startup.
357+
`FHIR_ACTIVE_KEY` holds the raw PKCS#8 signing key (RSA, signed RS384, or EC
358+
P-384, signed ES384). In HTTP mode, the built-in `/jwks` endpoint exposes public
359+
keys for the active key plus any retired keys when `FHIR_JWKS_URL` is unset. The
360+
`kid` for each key is derived automatically via a truncated RFC 7638 JWK
361+
Thumbprint (first 12 base64url chars of SHA-256 over the canonical public JWK
362+
members) and logged at startup.
362363

363364
Key rotation workflow:
364-
1. Generate a new RSA key.
365+
1. Generate a new key (RSA-2048 or EC P-384).
365366
2. Add the new PEM to `FHIR_RETIRED_KEYS` and redeploy so JWKS includes both.
366367
3. Register the new kid (logged at startup) with your auth server.
367368
4. Move the new PEM to `FHIR_ACTIVE_KEY` and move the old PEM to
@@ -381,7 +382,7 @@ See [.env.example](.env.example) for a complete sample.
381382
| --- | --- |
382383
| `FHIR_BASE_URL` | Base URL used to derive the FHIR server URL and token URL. Optional when `FHIR_SERVER_URL` is set (and, for smart auth, `FHIR_TOKEN_URL`) |
383384
| `FHIR_CLIENT_ID` | SMART Backend Services client ID (not needed when `FHIR_AUTH=none`) |
384-
| `FHIR_ACTIVE_KEY` | Base64-encoded RSA PKCS#8 PEM signing key (not needed when `FHIR_AUTH=none`) |
385+
| `FHIR_ACTIVE_KEY` | Base64-encoded PKCS#8 PEM signing key, RSA or EC P-384 (not needed when `FHIR_AUTH=none`) |
385386

386387
### Optional
387388

0 commit comments

Comments
 (0)