From d00f30314f94b69587e9a373c1be27c6be86d528 Mon Sep 17 00:00:00 2001 From: Daniele Manni Date: Wed, 4 Mar 2020 10:55:30 +0100 Subject: [PATCH] [#171550422] Add ENV var for CIE metadata download (#589) --- .circleci/config.yml | 1 + .env.example | 1 + README.md | 1 + package.json | 2 +- src/config.ts | 2 ++ yarn.lock | 8 ++++---- 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d8092bfd3..44330d272 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -117,6 +117,7 @@ jobs: PAGOPA_API_URL: "https://pagopa-proxy" PAGOPA_API_URL_TEST: "https://pagopa-proxy-test" PAGOPA_BASE_PATH: "/pagopa/api/v1" + CIE_METADATA_URL: https://idserver.servizicie.interno.gov.it:8443/idp/shibboleth IDP_METADATA_URL: "https://raw.githubusercontent.com/teamdigitale/io-backend/164984224-download-idp-metadata/test_idps/spid-entities-idps.xml" REDIS_URL: redis://localhost - run: 'bash <(curl -s https://codecov.io/bash)' diff --git a/.env.example b/.env.example index 34e4044fb..7dcfc8311 100644 --- a/.env.example +++ b/.env.example @@ -23,6 +23,7 @@ PAGOPA_API_URL="https://pagopa-proxy" PAGOPA_API_URL_TEST="https://pagopa-proxy-test" SPID_AUTOLOGIN=lussoluca SPID_TESTENV_URL=https://spid-testenv2:8088 +CIE_METADATA_URL=https://idserver.servizicie.interno.gov.it:8443/idp/shibboleth IDP_METADATA_URL=https://registry.spid.gov.it/metadata/idp/spid-entities-idps.xml SHUTDOWN_SIGNALS="SIGINT SIGTERM" SHUTDOWN_TIMEOUT_MILLIS=30000 diff --git a/README.md b/README.md index dbe6a3de3..93ec689dc 100644 --- a/README.md +++ b/README.md @@ -153,6 +153,7 @@ Those are all Environment variables needed by the application: | PAGOPA_API_URL_TEST | The url for the PagoPA api endpoints in test mode | string | | PAGOPA_BASE_PATH | The root path for the PagoPA endpoints | string | | SPID_AUTOLOGIN | The user used in the autologin feature, omit this to disable autologin | string | +| CIE_METADATA_URL | Url to download CIE metadata from | string | | IDP_METADATA_URL | Url to download IDP metadata from | string | | IDP_METADATA_REFRESH_INTERVAL_SECONDS | The number of seconds when the IDPs Metadata are refreshed | int | | CACHE_MAX_AGE_SECONDS | The value in seconds for duration of in-memory api cache | int | diff --git a/package.json b/package.json index 3d4ce12c7..57ed149db 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ }, "homepage": "https://github.com/pagopa/io-backend#readme", "dependencies": { - "@pagopa/io-spid-commons": "^2.5.0", + "@pagopa/io-spid-commons": "^2.6.0", "apicache": "^1.4.0", "applicationinsights": "^1.4.2", "azure-sb": "^0.10.6", diff --git a/src/config.ts b/src/config.ts index 3c43f603f..5c8d3d517 100644 --- a/src/config.ts +++ b/src/config.ts @@ -102,6 +102,7 @@ const SPID_TESTENV_URL = // Register the spidStrategy. export const IDP_METADATA_URL = getRequiredENVVar("IDP_METADATA_URL"); +const CIE_METADATA_URL = getRequiredENVVar("CIE_METADATA_URL"); export const CLIENT_ERROR_REDIRECTION_URL = process.env.CLIENT_ERROR_REDIRECTION_URL || "/error.html"; @@ -142,6 +143,7 @@ export const serviceProviderConfig: IServiceProviderConfig = { ], name: "Required attributes" }, + spidCieUrl: CIE_METADATA_URL, spidTestEnvUrl: SPID_TESTENV_URL, spidValidatorUrl: process.env.SPID_VALIDATOR_URL, strictResponseValidation: { diff --git a/yarn.lock b/yarn.lock index e51784a89..cdf3c6ad5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -155,10 +155,10 @@ dependencies: "@types/node" ">= 8" -"@pagopa/io-spid-commons@^2.5.0": - version "2.5.0" - resolved "https://npm.pkg.github.com/download/@pagopa/io-spid-commons/2.5.0/96a31352060eb5882f0a52e45b157eb13dc2001303beed13dbcddbf10fa57b8a#8805bdd8ce218c66e56ae8ba222d06d65bc0eb66" - integrity sha512-hYItaXs9hSTYLugW3yOR02HVSjFYnKVJj5VsONTgTr7rY+yd6GQ197HPw9MIuUqqNvWQ8Y970hF2Bfcu+xisig== +"@pagopa/io-spid-commons@^2.6.0": + version "2.6.0" + resolved "https://npm.pkg.github.com/download/@pagopa/io-spid-commons/2.6.0/f454e6b0cd8a10f331ae88dc8123e0ea59c8a05233729194a3f1bfe460d12faa#05dc7697c8e3891f7a4dbe0a00ab760471c2c232" + integrity sha512-Acv8dpHETbWs/v8bOKKlO3AO58uvx/ad99uUfk6CKUheSi4mKapU2kuOw1/JiWjjSJa6jU5kgxnqfaoYRoePDg== dependencies: "@types/redis" "^2.8.14" date-fns "^1.30.1"