From 9f949cf525888d40d6e4dccf125e807bde8f8321 Mon Sep 17 00:00:00 2001 From: Daniel DeGroff Date: Fri, 27 Oct 2023 11:47:23 -0500 Subject: [PATCH 1/5] update release notes to remove EAP notes and update release date. --- astro/src/content/docs/release-notes/index.mdx | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/astro/src/content/docs/release-notes/index.mdx b/astro/src/content/docs/release-notes/index.mdx index 020249ee5b..6bf0a8bf2e 100644 --- a/astro/src/content/docs/release-notes/index.mdx +++ b/astro/src/content/docs/release-notes/index.mdx @@ -17,15 +17,7 @@ import ReleaseNoteHeading from 'src/components/docs/release-notes/ReleaseNoteHea Looking for release notes older than 1.23.0? Look in the [release notes archive](/docs/release-notes/archive). Looking to be [notified of new releases?](/docs/operate/roadmap/releases#release-notifications) - - - - -
+ From d88a6df811c728c5539c45acff231efe8e9e5fe0 Mon Sep 17 00:00:00 2001 From: John Jeffers Date: Fri, 27 Oct 2023 10:47:42 -0600 Subject: [PATCH 2/5] Redirect lambda (#2614) * add terraform module to manage the lambda * reduce the repo checkout size --- .../lambda-site-origin-request-handler.yaml | 60 +++++++++++++ .../publish-site-redirect-rules.yaml | 6 +- .gitignore | 3 + .../README.md | 2 +- .../data/redirects.json | 0 .../package-lock.json | 84 +++++++++--------- .../package.json | 4 +- .../src/index.mjs | 2 +- .../terraform/.terraform.lock.hcl | 85 +++++++++++++++++++ .../terraform/main.tf | 35 ++++++++ .../terraform/providers.tf | 44 ++++++++++ .../test/index.test.mjs | 0 12 files changed, 276 insertions(+), 49 deletions(-) create mode 100644 .github/workflows/lambda-site-origin-request-handler.yaml rename src/lambdas/{fusionauth-site-origin-handler => site-origin-request-handler}/README.md (91%) rename src/lambdas/{fusionauth-site-origin-handler => site-origin-request-handler}/data/redirects.json (100%) rename src/lambdas/{fusionauth-site-origin-handler => site-origin-request-handler}/package-lock.json (97%) rename src/lambdas/{fusionauth-site-origin-handler => site-origin-request-handler}/package.json (83%) rename src/lambdas/{fusionauth-site-origin-handler => site-origin-request-handler}/src/index.mjs (98%) create mode 100644 src/lambdas/site-origin-request-handler/terraform/.terraform.lock.hcl create mode 100644 src/lambdas/site-origin-request-handler/terraform/main.tf create mode 100644 src/lambdas/site-origin-request-handler/terraform/providers.tf rename src/lambdas/{fusionauth-site-origin-handler => site-origin-request-handler}/test/index.test.mjs (100%) diff --git a/.github/workflows/lambda-site-origin-request-handler.yaml b/.github/workflows/lambda-site-origin-request-handler.yaml new file mode 100644 index 0000000000..d2ebe6e387 --- /dev/null +++ b/.github/workflows/lambda-site-origin-request-handler.yaml @@ -0,0 +1,60 @@ +--- +name: lambda-site-origin-request-handler + +env: + AWS_REGION: us-east-1 + +on: + push: + branches: + - development + paths: + - 'src/lambdas/site-origin-request-handler/src/index.mjs' + - 'src/lambdas/site-origin-request-handler/terraform/**' + pull_request: + branches: + - development + paths: + - 'src/lambdas/site-origin-request-handler/src/index.mjs' + - 'src/lambdas/site-origin-request-handler/terraform/**' + +permissions: + id-token: write + contents: read + +jobs: + deploy: + runs-on: fusionauth-standard + container: 752443094709.dkr.ecr.us-west-2.amazonaws.com/gha-runner-ubuntu-22.04:bootstrap-05 + steps: + + - name: checkout + uses: actions/checkout@v4 + with: + sparse-checkout: | + src + + - name: set aws credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-chaining: true + role-to-assume: arn:aws:iam::752443094709:role/github-actions + role-session-name: github-actions + aws-region: ${{ env.AWS_REGION }} + + - name: setup terraform + uses: hashicorp/setup-terraform@v2 + with: + terraform_version: 1.6.2 + + - name: terraform plan + if: github.event_name == 'pull_request' + working-directory: src/lambdas/site-origin-request-handler/terraform + shell: bash + run: terraform init && terraform plan + + - name: terraform apply + if: github.event_name == 'push' + working-directory: src/lambdas/site-origin-request-handler/terraform + shell: bash + run: terraform init && terraform apply -auto-approve diff --git a/.github/workflows/publish-site-redirect-rules.yaml b/.github/workflows/publish-site-redirect-rules.yaml index 5889d5637d..7d63b5564c 100644 --- a/.github/workflows/publish-site-redirect-rules.yaml +++ b/.github/workflows/publish-site-redirect-rules.yaml @@ -10,7 +10,7 @@ on: branches: - development paths: - - 'src/lambdas/fusionauth-site-origin-handler/data/redirects.json' + - 'src/lambdas/site-origin-request-handler/data/redirects.json' permissions: id-token: write @@ -34,6 +34,6 @@ jobs: aws-region: ${{ env.AWS_REGION }} - name: upload file to s3 - working-directory: src/lambdas/fusionauth-site-origin-handler/data + working-directory: src/lambdas/site-origin-request-handler/data run: | - aws s3 cp ./redirects.json s3://fusionauth-dev-us-east-1-artifacts/lambda/fusionauth-site-origin-handler/redirects.json + aws s3 cp ./redirects.json s3://fusionauth-dev-us-east-1-artifacts/lambda/site-origin-request-handler/redirects.json diff --git a/.gitignore b/.gitignore index 536ea73e7c..01c579d456 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,6 @@ node_modules .savant/cache astro/.astro + +# Local .terraform directories +**/.terraform/* diff --git a/src/lambdas/fusionauth-site-origin-handler/README.md b/src/lambdas/site-origin-request-handler/README.md similarity index 91% rename from src/lambdas/fusionauth-site-origin-handler/README.md rename to src/lambdas/site-origin-request-handler/README.md index 2ee26bb016..a9994b8b87 100644 --- a/src/lambdas/fusionauth-site-origin-handler/README.md +++ b/src/lambdas/site-origin-request-handler/README.md @@ -1,4 +1,4 @@ -# fusionauth-site-origin-handler +# site-origin-request-handler This is a Lambda@Edge function that handles redirects for fusionauth.dev. diff --git a/src/lambdas/fusionauth-site-origin-handler/data/redirects.json b/src/lambdas/site-origin-request-handler/data/redirects.json similarity index 100% rename from src/lambdas/fusionauth-site-origin-handler/data/redirects.json rename to src/lambdas/site-origin-request-handler/data/redirects.json diff --git a/src/lambdas/fusionauth-site-origin-handler/package-lock.json b/src/lambdas/site-origin-request-handler/package-lock.json similarity index 97% rename from src/lambdas/fusionauth-site-origin-handler/package-lock.json rename to src/lambdas/site-origin-request-handler/package-lock.json index 29f7a1201c..f9817af6a4 100644 --- a/src/lambdas/fusionauth-site-origin-handler/package-lock.json +++ b/src/lambdas/site-origin-request-handler/package-lock.json @@ -1,11 +1,11 @@ { - "name": "fusionauth-site-origin-handler", + "name": "site-origin-request-handler", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "fusionauth-site-origin-handler", + "name": "site-origin-request-handler", "version": "1.0.0", "license": "Apache-2.0", "dependencies": { @@ -142,16 +142,16 @@ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" }, "node_modules/@aws-sdk/client-s3": { - "version": "3.436.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-s3/-/client-s3-3.436.0.tgz", - "integrity": "sha512-4F/eg9caxUxRU9za+nppiq4VnjTy+QKc4V2A7bI+7N4GBXl/Ye8Q9zBjbEDpGBmZBHbuO/RtBtyf/ZyrYntEvA==", + "version": "3.437.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-s3/-/client-s3-3.437.0.tgz", + "integrity": "sha512-KCocXvRH3pCTJNeNivDJN9mygK0B4Uvp5POWlCXgOj5iQU2U/sEpr+LqAwQZiZZjE7crcsAf0FPKMyk6/oMXHQ==", "dependencies": { "@aws-crypto/sha1-browser": "3.0.0", "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", - "@aws-sdk/client-sts": "3.436.0", + "@aws-sdk/client-sts": "3.437.0", "@aws-sdk/core": "3.436.0", - "@aws-sdk/credential-provider-node": "3.436.0", + "@aws-sdk/credential-provider-node": "3.437.0", "@aws-sdk/middleware-bucket-endpoint": "3.433.0", "@aws-sdk/middleware-expect-continue": "3.433.0", "@aws-sdk/middleware-flexible-checksums": "3.433.0", @@ -164,11 +164,11 @@ "@aws-sdk/middleware-ssec": "3.433.0", "@aws-sdk/middleware-user-agent": "3.433.0", "@aws-sdk/region-config-resolver": "3.433.0", - "@aws-sdk/signature-v4-multi-region": "3.433.0", + "@aws-sdk/signature-v4-multi-region": "3.437.0", "@aws-sdk/types": "3.433.0", "@aws-sdk/util-endpoints": "3.433.0", "@aws-sdk/util-user-agent-browser": "3.433.0", - "@aws-sdk/util-user-agent-node": "3.433.0", + "@aws-sdk/util-user-agent-node": "3.437.0", "@aws-sdk/xml-builder": "3.310.0", "@smithy/config-resolver": "^2.0.16", "@smithy/eventstream-serde-browser": "^2.0.12", @@ -208,9 +208,9 @@ } }, "node_modules/@aws-sdk/client-sso": { - "version": "3.436.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.436.0.tgz", - "integrity": "sha512-MM59VTikuehbN/iLz0rH0MhvUb9ngG9rB129darJkNBWNBQDNnQHox/31dm/Hyfq++YUf6GREsfW8r9HMMfLdg==", + "version": "3.437.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.437.0.tgz", + "integrity": "sha512-AxlLWz9ec3b8Bt+RqRb2Q1ucGQtKrLdKDna+UTjz7AouB/jpoMiegV9NHXVX64N6YFnQnvB0UEGigXiOQE+y/g==", "dependencies": { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", @@ -223,7 +223,7 @@ "@aws-sdk/types": "3.433.0", "@aws-sdk/util-endpoints": "3.433.0", "@aws-sdk/util-user-agent-browser": "3.433.0", - "@aws-sdk/util-user-agent-node": "3.433.0", + "@aws-sdk/util-user-agent-node": "3.437.0", "@smithy/config-resolver": "^2.0.16", "@smithy/fetch-http-handler": "^2.2.4", "@smithy/hash-node": "^2.0.12", @@ -253,14 +253,14 @@ } }, "node_modules/@aws-sdk/client-sts": { - "version": "3.436.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.436.0.tgz", - "integrity": "sha512-DJKvvtcjIziD8FMGIURwesrKdZcfTx0dZ3juBg8I0q2Y+kQYx1xFqy4dl9V/lQLBRWk1hku0iM+J/TI1YjlOrQ==", + "version": "3.437.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.437.0.tgz", + "integrity": "sha512-ilLcrCVwH81UbKNpB9Vax1Fw/mNx2d/bWXkCNXPvrExO+K39VFGS/VijOuSrru2iBq844NlG3uQV8DL/nbiKdA==", "dependencies": { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", "@aws-sdk/core": "3.436.0", - "@aws-sdk/credential-provider-node": "3.436.0", + "@aws-sdk/credential-provider-node": "3.437.0", "@aws-sdk/middleware-host-header": "3.433.0", "@aws-sdk/middleware-logger": "3.433.0", "@aws-sdk/middleware-recursion-detection": "3.433.0", @@ -271,7 +271,7 @@ "@aws-sdk/types": "3.433.0", "@aws-sdk/util-endpoints": "3.433.0", "@aws-sdk/util-user-agent-browser": "3.433.0", - "@aws-sdk/util-user-agent-node": "3.433.0", + "@aws-sdk/util-user-agent-node": "3.437.0", "@smithy/config-resolver": "^2.0.16", "@smithy/fetch-http-handler": "^2.2.4", "@smithy/hash-node": "^2.0.12", @@ -327,13 +327,13 @@ } }, "node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.436.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.436.0.tgz", - "integrity": "sha512-VWemmELcB+WSvP+hPk5CTlIYZMZdjcPFeoWrv11tpVqQ4be33AM1LEC1sTSU8fXKSgIL/tz7ilqp11fWm0MQwA==", + "version": "3.437.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.437.0.tgz", + "integrity": "sha512-UybiJxYPvdwok5OcI9LakaHmaWZBdkX0gY8yU2n7TomYgWOwDJ88MpQgjXUJJ249PH+9/+How5H3vnFp0xJ0uQ==", "dependencies": { "@aws-sdk/credential-provider-env": "3.433.0", "@aws-sdk/credential-provider-process": "3.433.0", - "@aws-sdk/credential-provider-sso": "3.436.0", + "@aws-sdk/credential-provider-sso": "3.437.0", "@aws-sdk/credential-provider-web-identity": "3.433.0", "@aws-sdk/types": "3.433.0", "@smithy/credential-provider-imds": "^2.0.0", @@ -347,14 +347,14 @@ } }, "node_modules/@aws-sdk/credential-provider-node": { - "version": "3.436.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.436.0.tgz", - "integrity": "sha512-ZQIqR11TPU03RGI/eynOCMmH8FK4J+IxdDEsv2FBcxkuFl990CangoeEziRhVsw+a68TWVZA65kVv+oUX2u8Sw==", + "version": "3.437.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.437.0.tgz", + "integrity": "sha512-FMtgEe/me68xZQsymEpMcw7OuuiHaHx/Tp5EqZP5FC0Yv1yX3qr/ncIWU2zY3a9K0iLERmzQI1g3CMd8r4sy8A==", "dependencies": { "@aws-sdk/credential-provider-env": "3.433.0", - "@aws-sdk/credential-provider-ini": "3.436.0", + "@aws-sdk/credential-provider-ini": "3.437.0", "@aws-sdk/credential-provider-process": "3.433.0", - "@aws-sdk/credential-provider-sso": "3.436.0", + "@aws-sdk/credential-provider-sso": "3.437.0", "@aws-sdk/credential-provider-web-identity": "3.433.0", "@aws-sdk/types": "3.433.0", "@smithy/credential-provider-imds": "^2.0.0", @@ -383,12 +383,12 @@ } }, "node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.436.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.436.0.tgz", - "integrity": "sha512-40exwlz6Xfc/28e1dfpHP7vwK04gATWEQ1dBb30d0zXASpn0Z0PWyNgAO2owcGsw4TdceSREV1mj8HwYkl8+BA==", + "version": "3.437.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.437.0.tgz", + "integrity": "sha512-kijtnyyA6/+ipOef4KACsLDUTFWDZ97DSWKU0hJFyGEfelaon6o7NNVufuVOWrBNyklNWZqvPLuwWWQCxb6fuQ==", "dependencies": { - "@aws-sdk/client-sso": "3.436.0", - "@aws-sdk/token-providers": "3.435.0", + "@aws-sdk/client-sso": "3.437.0", + "@aws-sdk/token-providers": "3.437.0", "@aws-sdk/types": "3.433.0", "@smithy/property-provider": "^2.0.0", "@smithy/shared-ini-file-loader": "^2.0.6", @@ -607,9 +607,9 @@ } }, "node_modules/@aws-sdk/signature-v4-multi-region": { - "version": "3.433.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.433.0.tgz", - "integrity": "sha512-wl2j1dos4VOKFawbapPm/0CNa3cIgpJXbEx+sp+DI3G8tSuP3c5UGtm0pXjM85egxZulhHVK1RVde0iD8j63pQ==", + "version": "3.437.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.437.0.tgz", + "integrity": "sha512-MmrqudssOs87JgVg7HGVdvJws/t4kcOrJJd+975ki+DPeSoyK2U4zBDfDkJ+n0tFuZBs3sLwLh0QXE7BV28rRA==", "dependencies": { "@aws-sdk/types": "3.433.0", "@smithy/protocol-http": "^3.0.8", @@ -622,9 +622,9 @@ } }, "node_modules/@aws-sdk/token-providers": { - "version": "3.435.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.435.0.tgz", - "integrity": "sha512-JZKqsuoK321ozp2ufGmjfpbAqtK1tYnLn0PaePWjvDL48B5A5jGNqFyP3/tg7LFP7vTp9O3pJ7ln0QLh8FpsjQ==", + "version": "3.437.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.437.0.tgz", + "integrity": "sha512-nV9qIuG0+6XJb7hWpCC+/K7RoY3PZUWndP8BRQv7PQhhpd8tG/I5Kxb0V83h2XFBXyyjnv0aOHO8ehz3Kfcv2Q==", "dependencies": { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", @@ -636,7 +636,7 @@ "@aws-sdk/types": "3.433.0", "@aws-sdk/util-endpoints": "3.433.0", "@aws-sdk/util-user-agent-browser": "3.433.0", - "@aws-sdk/util-user-agent-node": "3.433.0", + "@aws-sdk/util-user-agent-node": "3.437.0", "@smithy/config-resolver": "^2.0.16", "@smithy/fetch-http-handler": "^2.2.4", "@smithy/hash-node": "^2.0.12", @@ -725,9 +725,9 @@ } }, "node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.433.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.433.0.tgz", - "integrity": "sha512-yT1tO4MbbsUBLl5+S+jVv8wxiAtP5TKjKib9B2KQ2x0OtWWTrIf2o+IZK8va+zQqdV4MVMjezdxdE20hOdB4yQ==", + "version": "3.437.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.437.0.tgz", + "integrity": "sha512-JVEcvWaniamtYVPem4UthtCNoTBCfFTwYj7Y3CrWZ2Qic4TqrwLkAfaBGtI2TGrhIClVr77uzLI6exqMTN7orA==", "dependencies": { "@aws-sdk/types": "3.433.0", "@smithy/node-config-provider": "^2.1.3", diff --git a/src/lambdas/fusionauth-site-origin-handler/package.json b/src/lambdas/site-origin-request-handler/package.json similarity index 83% rename from src/lambdas/fusionauth-site-origin-handler/package.json rename to src/lambdas/site-origin-request-handler/package.json index b53929a453..ccabd80c5b 100644 --- a/src/lambdas/fusionauth-site-origin-handler/package.json +++ b/src/lambdas/site-origin-request-handler/package.json @@ -1,7 +1,7 @@ { - "name": "fusionauth-site-origin-handler", + "name": "site-origin-request-handler", "version": "1.0.0", - "description": "Cloudfront origin handler for fusionauth-site", + "description": "Cloudfront origin request handler for fusionauth-site", "main": "index.mjs", "scripts": { "test": "mocha --require mocha-suppress-logs" diff --git a/src/lambdas/fusionauth-site-origin-handler/src/index.mjs b/src/lambdas/site-origin-request-handler/src/index.mjs similarity index 98% rename from src/lambdas/fusionauth-site-origin-handler/src/index.mjs rename to src/lambdas/site-origin-request-handler/src/index.mjs index 498687f33b..404130d995 100644 --- a/src/lambdas/fusionauth-site-origin-handler/src/index.mjs +++ b/src/lambdas/site-origin-request-handler/src/index.mjs @@ -3,7 +3,7 @@ const s3 = new S3Client({ region: 'us-east-1' }); // Location of the file containing the redirect rules. const fileBucket = 'fusionauth-dev-us-east-1-artifacts'; -const fileKey = 'lambda/fusionauth-site-origin-handler/redirects.json'; +const fileKey = 'lambda/site-origin-request-handler/redirects.json'; let redirectRules = null; diff --git a/src/lambdas/site-origin-request-handler/terraform/.terraform.lock.hcl b/src/lambdas/site-origin-request-handler/terraform/.terraform.lock.hcl new file mode 100644 index 0000000000..3f1637b952 --- /dev/null +++ b/src/lambdas/site-origin-request-handler/terraform/.terraform.lock.hcl @@ -0,0 +1,85 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/hashicorp/aws" { + version = "5.22.0" + constraints = ">= 4.63.0, ~> 5.22.0" + hashes = [ + "h1:XuU3tsGzElMt4Ti8SsM05pFllNMwSC4ScUxcfsOS140=", + "zh:09b8475cd519c945423b1e1183b71a4209dd2927e0d289a88c5abeecb53c1753", + "zh:2448e0c3ce9b991a5dd70f6a42d842366a6a2460cf63b31fb9bc5d2cc92ced19", + "zh:3b9fc2bf6714a9a9ab25eae3e56cead3d3917bc1b6d8b9fb3111c4198a790c72", + "zh:4fbd28ad5380529a36c54d7a96c9768df1288c625d28b8fa3a50d4fc2176ef0f", + "zh:54d550f190702a7edc2d459952d025e259a8c0b0ff7df3f15bbcc148539214bf", + "zh:638f406d084ac96f3a0b0a5ce8aa71a5a2a781a56ba96e3a235d3982b89eef0d", + "zh:69d4c175b13b6916b5c9398172cc384e7af46cb737b45870ab9907f12e82a28a", + "zh:81edec181a67255d25caf5e7ffe6d5e8f9373849b9e8f5e0705f277640abb18e", + "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", + "zh:a66efb2b3cf7be8116728ae5782d7550f23f3719da2ed3c10228d29c44b7dc84", + "zh:ae754478d0bfa42195d16cf46091fab7c1c075ebc965d919338e36aed45add78", + "zh:e0603ad0061c43aa1cb52740b1e700b8afb55667d7ee01c1cc1ceb6f983d4c9d", + "zh:e4cb701d0185884eed0492a66eff17251f5b4971d30e81acd5e0a55627059fc8", + "zh:f7db2fcf69679925dde1ae326526242fd61ba1f83f614b1f6d9d68c925417e51", + "zh:fef331b9b62bc26d900ae937cc662281ff30794edf48aebfe8997d0e16835f6d", + ] +} + +provider "registry.terraform.io/hashicorp/external" { + version = "2.3.1" + constraints = ">= 1.0.0" + hashes = [ + "h1:gznGscVJ0USxy4CdihpjRKPsKvyGr/zqPvBoFLJTQDc=", + "zh:001e2886dc81fc98cf17cf34c0d53cb2dae1e869464792576e11b0f34ee92f54", + "zh:2eeac58dd75b1abdf91945ac4284c9ccb2bfb17fa9bdb5f5d408148ff553b3ee", + "zh:2fc39079ba61411a737df2908942e6970cb67ed2f4fb19090cd44ce2082903dd", + "zh:472a71c624952cff7aa98a7b967f6c7bb53153dbd2b8f356ceb286e6743bb4e2", + "zh:4cff06d31272aac8bc35e9b7faec42cf4554cbcbae1092eaab6ab7f643c215d9", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:7ed16ccd2049fa089616b98c0bd57219f407958f318f3c697843e2397ddf70df", + "zh:842696362c92bf2645eb85c739410fd51376be6c488733efae44f4ce688da50e", + "zh:8985129f2eccfd7f1841ce06f3bf2bbede6352ec9e9f926fbaa6b1a05313b326", + "zh:a5f0602d8ec991a5411ef42f872aa90f6347e93886ce67905c53cfea37278e05", + "zh:bf4ab82cbe5256dcef16949973bf6aa1a98c2c73a98d6a44ee7bc40809d002b8", + "zh:e70770be62aa70198fa899526d671643ff99eecf265bf1a50e798fc3480bd417", + ] +} + +provider "registry.terraform.io/hashicorp/local" { + version = "2.4.0" + constraints = ">= 1.0.0" + hashes = [ + "h1:ZUEYUmm2t4vxwzxy1BvN1wL6SDWrDxfH7pxtzX8c6d0=", + "zh:53604cd29cb92538668fe09565c739358dc53ca56f9f11312b9d7de81e48fab9", + "zh:66a46e9c508716a1c98efbf793092f03d50049fa4a83cd6b2251e9a06aca2acf", + "zh:70a6f6a852dd83768d0778ce9817d81d4b3f073fab8fa570bff92dcb0824f732", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:82a803f2f484c8b766e2e9c32343e9c89b91997b9f8d2697f9f3837f62926b35", + "zh:9708a4e40d6cc4b8afd1352e5186e6e1502f6ae599867c120967aebe9d90ed04", + "zh:973f65ce0d67c585f4ec250c1e634c9b22d9c4288b484ee2a871d7fa1e317406", + "zh:c8fa0f98f9316e4cfef082aa9b785ba16e36ff754d6aba8b456dab9500e671c6", + "zh:cfa5342a5f5188b20db246c73ac823918c189468e1382cb3c48a9c0c08fc5bf7", + "zh:e0e2b477c7e899c63b06b38cd8684a893d834d6d0b5e9b033cedc06dd7ffe9e2", + "zh:f62d7d05ea1ee566f732505200ab38d94315a4add27947a60afa29860822d3fc", + "zh:fa7ce69dde358e172bd719014ad637634bbdabc49363104f4fca759b4b73f2ce", + ] +} + +provider "registry.terraform.io/hashicorp/null" { + version = "3.2.1" + constraints = ">= 2.0.0" + hashes = [ + "h1:ydA0/SNRVB1o95btfshvYsmxA+jZFRZcvKzZSB+4S1M=", + "zh:58ed64389620cc7b82f01332e27723856422820cfd302e304b5f6c3436fb9840", + "zh:62a5cc82c3b2ddef7ef3a6f2fedb7b9b3deff4ab7b414938b08e51d6e8be87cb", + "zh:63cff4de03af983175a7e37e52d4bd89d990be256b16b5c7f919aff5ad485aa5", + "zh:74cb22c6700e48486b7cabefa10b33b801dfcab56f1a6ac9b6624531f3d36ea3", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:79e553aff77f1cfa9012a2218b8238dd672ea5e1b2924775ac9ac24d2a75c238", + "zh:a1e06ddda0b5ac48f7e7c7d59e1ab5a4073bbcf876c73c0299e4610ed53859dc", + "zh:c37a97090f1a82222925d45d84483b2aa702ef7ab66532af6cbcfb567818b970", + "zh:e4453fbebf90c53ca3323a92e7ca0f9961427d2f0ce0d2b65523cc04d5d999c2", + "zh:e80a746921946d8b6761e77305b752ad188da60688cfd2059322875d363be5f5", + "zh:fbdb892d9822ed0e4cb60f2fedbdbb556e4da0d88d3b942ae963ed6ff091e48f", + "zh:fca01a623d90d0cad0843102f9b8b9fe0d3ff8244593bd817f126582b52dd694", + ] +} diff --git a/src/lambdas/site-origin-request-handler/terraform/main.tf b/src/lambdas/site-origin-request-handler/terraform/main.tf new file mode 100644 index 0000000000..6316bdf8a6 --- /dev/null +++ b/src/lambdas/site-origin-request-handler/terraform/main.tf @@ -0,0 +1,35 @@ +resource "aws_iam_policy" "lambda_execution_policy" { + name = "site-origin-request-handler-s3" + policy = jsonencode({ + Version = "2012-10-17" + Statement = [ + { + Effect = "Allow", + Action = [ + "s3:GetObject" + ] + Resource = [ + "arn:aws:s3:::fusionauth-dev-us-east-1-artifacts/*", + ] + } + ] + }) +} + +module "lambda" { + source = "terraform-aws-modules/lambda/aws" + version = "6.0.1" + + lambda_at_edge = true + + function_name = "site-origin-request-handler" + description = "origin-request handler for fusionauth-site cloudfront behaviors" + handler = "index.handler" + runtime = "nodejs18.x" + architectures = ["x86_64"] + + source_path = "../src/index.mjs" + + attach_policy = true + policy = aws_iam_policy.lambda_execution_policy.arn +} diff --git a/src/lambdas/site-origin-request-handler/terraform/providers.tf b/src/lambdas/site-origin-request-handler/terraform/providers.tf new file mode 100644 index 0000000000..9faa66e4c3 --- /dev/null +++ b/src/lambdas/site-origin-request-handler/terraform/providers.tf @@ -0,0 +1,44 @@ +# +# Terraform provider configuration +# +terraform { + required_version = "~> 1.6.2" + + backend "s3" { + bucket = "fusionauth-svc-terraform-state" + region = "us-west-2" + dynamodb_table = "terraform-state" + encrypt = true + key = "fusionauth-site/172023253951-us-east-1/lambdas/site-origin-request-handler/terraform.tfstate" + role_arn = "arn:aws:iam::752443094709:role/github-actions" + } + + required_providers { + aws = { + source = "hashicorp/aws" + version = "~> 5.22.0" + } + } +} + +# +# Define the AWS Provider +# +provider "aws" { + region = "us-east-1" + assume_role { + role_arn = "arn:aws:iam::172023253951:role/github-actions" + session_name = "fusionauth-site" + } + + default_tags { + tags = { + managedBy = "terraform" + terraformRepo = "fusionauth-site" + terraformConfig = "src/lambdas/site-origin-request-handler/terraform" + environment = "dev" + team = "support" + service = "fusionauth-site" + } + } +} diff --git a/src/lambdas/fusionauth-site-origin-handler/test/index.test.mjs b/src/lambdas/site-origin-request-handler/test/index.test.mjs similarity index 100% rename from src/lambdas/fusionauth-site-origin-handler/test/index.test.mjs rename to src/lambdas/site-origin-request-handler/test/index.test.mjs From df1ceef2810fa828f47059da1b35aeae69474fe0 Mon Sep 17 00:00:00 2001 From: Lyle Schemmerling Date: Fri, 27 Oct 2023 12:05:50 -0600 Subject: [PATCH 3/5] various cosmetic fixes --- .../components/api/APIAuthentication.astro | 4 +- astro/src/components/nav/ArticleNav.astro | 6 +- astro/src/components/nav/BlogNav.astro | 6 +- astro/src/components/nav/ComposableNav.astro | 38 +- astro/src/components/nav/DevToolsNav.astro | 6 +- .../_shared/_premium-edition-blurb-api.astro | 4 +- .../src/content/docs/apis/actioning-users.mdx | 2 +- astro/src/content/docs/apis/audit-logs.mdx | 2 +- .../lambdas/self-service-registration.mdx | 6 +- .../content/docs/release-notes/archive.mdx | 913 +++++++++--------- .../src/content/docs/release-notes/index.mdx | 1 + astro/src/layouts/Default.astro | 3 +- 12 files changed, 501 insertions(+), 490 deletions(-) diff --git a/astro/src/components/api/APIAuthentication.astro b/astro/src/components/api/APIAuthentication.astro index f1f3893c69..db96e41366 100644 --- a/astro/src/components/api/APIAuthentication.astro +++ b/astro/src/components/api/APIAuthentication.astro @@ -14,9 +14,9 @@ const hrefMap = { } ---
-
+
{ icons.map(i => - + )} diff --git a/astro/src/components/nav/ArticleNav.astro b/astro/src/components/nav/ArticleNav.astro index 6ab077cf70..7b081e9a32 100644 --- a/astro/src/components/nav/ArticleNav.astro +++ b/astro/src/components/nav/ArticleNav.astro @@ -14,11 +14,11 @@ const categoryItems = [ const moreItems = [ {name: 'Quickstarts', href: '/docs/quickstarts'}, - {name: 'SDKs', href: '/docs/v1/tech/client-libraries'}, + {name: 'SDKs', href: '/docs/sdks'}, {name: 'Downloads', href: '/download'}, {name: 'Docs', href: '/docs/'}, - {name: 'API Docs', href: '/docs/v1/tech/apis/'}, - {name: 'Release Notes', href: '/docs/v1/tech/release-notes'}, + {name: 'API Docs', href: '/docs/apis'}, + {name: 'Release Notes', href: '/docs/release-notes'}, {name: 'Blog', href: '/blog/'}, {name: 'Developer Tools', href: '/dev-tools/'}, ]; diff --git a/astro/src/components/nav/BlogNav.astro b/astro/src/components/nav/BlogNav.astro index ff9f16c0d8..cadf32999e 100644 --- a/astro/src/components/nav/BlogNav.astro +++ b/astro/src/components/nav/BlogNav.astro @@ -14,11 +14,11 @@ const categoryItems = [ const moreItems = [ {name: 'Quickstarts', href: '/docs/quickstarts'}, - {name: 'SDKs', href: '/docs/v1/tech/client-libraries'}, + {name: 'SDKs', href: '/docs/sdks'}, {name: 'Downloads', href: '/download'}, {name: 'Docs', href: '/docs/'}, - {name: 'API Docs', href: '/docs/v1/tech/apis/'}, - {name: 'Release Notes', href: '/docs/v1/tech/release-notes'}, + {name: 'API Docs', href: '/docs/apis'}, + {name: 'Release Notes', href: '/docs/release-notes'}, {name: 'Articles', href: '/articles/'}, {name: 'Developer Tools', href: '/dev-tools/'}, ]; diff --git a/astro/src/components/nav/ComposableNav.astro b/astro/src/components/nav/ComposableNav.astro index cad31a7a76..dc1984de6f 100644 --- a/astro/src/components/nav/ComposableNav.astro +++ b/astro/src/components/nav/ComposableNav.astro @@ -38,9 +38,9 @@ const {sectionTitle, breadcrumbs, sectionTitleHref, categoryItems, moreItems, ca