Skip to content

Commit

Permalink
Generalize web cert properties (#126)
Browse files Browse the repository at this point in the history
Signed-off-by: Angelica Ochoa <15623749+ao508@users.noreply.github.com>
  • Loading branch information
ao508 authored May 7, 2024
1 parent af8f380 commit ec2d408
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ nats_filter_subject=

[topics]
pub_validate_igo_sample_update=
pub_tempo_sample_billing=

[db]
neo4j_username=
Expand All @@ -20,3 +21,21 @@ neo4j_graphql_uri=

[smile]
smile_sample_endpoint=

[crdb]
oracle_user=
oracle_password=
oracle_connect_string=

[auth]
keycloak_client_id=
keycloak_client_secret=
keycloak_server_uri=
express_session_secret=

[log]
log_dir=

[web]
web_key_pem=
web_cert_pem=
3 changes: 3 additions & 0 deletions graphql-server/src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ export const props = {
express_session_secret: properties.get("auth.express_session_secret"),

log_dir: properties.get("log.log_dir"),

web_key_pem: properties.get("web.web_key_pem"),
web_cert_pem: properties.get("web.web_cert_pem"),
};

export const EXPRESS_SERVER_ORIGIN =
Expand Down
9 changes: 3 additions & 6 deletions graphql-server/src/utils/servers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Express } from "express";
import path from "path";
import fs from "fs";
import https from "https";
import { props } from "./constants";
import { buildNeo4jDbSchema } from "../schemas/neo4j";
import { mergeSchemas } from "@graphql-tools/schema";
import { oracleDbSchema } from "../schemas/oracle";
Expand All @@ -16,12 +17,8 @@ import { corsOptions } from "./constants";
export function initializeHttpsServer(app: Express) {
const httpsServer = https.createServer(
{
key: fs.readFileSync(
path.join(__dirname, "../../../.cert/smile-dashboard-web-key.pem")
),
cert: fs.readFileSync(
path.join(__dirname, "../../../.cert/smile-dashboard-web-cert.pem")
),
key: fs.readFileSync(props.web_key_pem),
cert: fs.readFileSync(props.web_cert_pem),
},
app
);
Expand Down

0 comments on commit ec2d408

Please sign in to comment.