diff --git a/example.env b/example.env index 4d1de3e199ca8336a74b0e706603fa6e69ca8eb5..422403a3488c38fab084aa5e8e5a513a7f4818a0 100644 --- a/example.env +++ b/example.env @@ -17,7 +17,8 @@ BASE_URL="http://localhost:5173" # Private (for connected users) HTTP(S) URL of LexImpact Socio-Fiscal Budget server # BUDGET_API_URL="https://SECRET.DOMAIN.NAME/state_simulation" -# Public HTTP(S) URL of LexImpact Socio-Fiscal Budget server +# URL of GitLab pipeline to run when a non-authentication user requests a budget simulation +# BUDGET_DEMAND_PIPELINE_URL="https://GITLAB.DOMAIN.NAME/api/v4/projects/PROJECT_ID/pipeline?ref=main" # Secret key used to sign JSON web tokens sent to Budget API # BUDGET_JWT_SECRET="SECRET" diff --git a/src/lib/server/auditors/config.ts b/src/lib/server/auditors/config.ts index 4603fec64e45cb3dd112ed6f4b29c977167153b0..913dca17a2e6e3eab3cdcd5ba772a16baeafe52f 100644 --- a/src/lib/server/auditors/config.ts +++ b/src/lib/server/auditors/config.ts @@ -65,14 +65,9 @@ export function auditConfig( auditRequire, ) } - audit.attribute( - data, - "budgetApiUrl", - true, - errors, - remainingKeys, - auditHttpUrl, - ) + for (const key of ["budgetApiUrl", "budgetDemandPipelineUrl"]) { + audit.attribute(data, key, true, errors, remainingKeys, auditHttpUrl) + } for (const key of [ "childrenKey", "familyEntityKey", diff --git a/src/lib/server/config.ts b/src/lib/server/config.ts index 2abbd37ae9edc7920c0810336271713d75857dad..c23d480b08ef892e7cfb345c8351991723616b94 100644 --- a/src/lib/server/config.ts +++ b/src/lib/server/config.ts @@ -10,6 +10,7 @@ export interface Config { apiWebSocketBaseUrls: string[] baseUrl: string budgetApiUrl?: string + budgetDemandPipelineUrl?: string budgetJwtSecret?: string childrenKey: string familyEntityKey: string @@ -48,6 +49,7 @@ const [validConfig, error] = validateConfig({ apiBaseUrls: process.env["API_BASE_URLS"], baseUrl: process.env["BASE_URL"], budgetApiUrl: process.env["BUDGET_API_URL"], + budgetDemandPipelineUrl: process.env["BUDGET_DEMAND_PIPELINE_URL"], budgetJwtSecret: process.env["BUDGET_JWT_SECRET"], childrenKey: process.env["CHILDREN_KEY"], familyEntityKey: process.env["FAMILY_KEY"],