Skip to content

Commit

Permalink
Merge pull request #32 from smart-on-fhir/add-associated-endpoints
Browse files Browse the repository at this point in the history
Add support for discovering associated_endpoints
  • Loading branch information
vlad-ignatov authored Jul 5, 2023
2 parents c0506e8 + aac9857 commit 3c79b50
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 7 additions & 1 deletion backend/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,11 @@ export default {
/**
* Our private key as PEM (used to generate the JWKS at /keys)
*/
privateKeyAsPem: FS.readFileSync(__dirname + "/../private-key.pem", "utf8")
privateKeyAsPem: FS.readFileSync(__dirname + "/../private-key.pem", "utf8"),

/**
* Associated endpoints for imaging, etc
*/
associatedEndpoints: JSON.parse(env.ASSOCIATED_ENDPOINTS || "[]")

}
5 changes: 3 additions & 2 deletions backend/routes/fhir/.well-known/smart-configuration.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Request, Response } from "express"
import { getRequestBaseURL } from "../../../lib"

import config from "../../../config";

export default function getWellKnownSmartConfig(req: Request, res: Response) {

Expand Down Expand Up @@ -173,7 +173,8 @@ export default function getWellKnownSmartConfig(req: Request, res: Response) {

// support for POST-based authorization
"authorize-post"
]
],
associated_endpoints: config?.associatedEndpoints?.length ? config.associatedEndpoints : undefined
};

res.json(json);
Expand Down

0 comments on commit 3c79b50

Please sign in to comment.