From ae7793ba8eba52c654bbb7a7ba3243d6dbf93bb0 Mon Sep 17 00:00:00 2001 From: Mike Houston Date: Tue, 2 Jul 2024 11:38:15 +0100 Subject: [PATCH] CCM-5100: Update pre-commit hooks --- .gitignore | 1 + .idea/.gitignore | 8 -- .idea/misc.xml | 4 - .idea/modules.xml | 8 -- .idea/nhs-notify-iam.iml | 12 --- .idea/vcs.xml | 6 -- amplify/package.json | 2 +- components/Login.tsx | 14 ++-- .../adr/ADR-001_AuthN_implementation_notes.md | 26 ++----- scripts/config/pre-commit.yaml | 74 +++++++++---------- .../config/vale/styles/Vocab/words/accept.txt | 1 + scripts/git-repo/branch-protection.md | 4 +- 12 files changed, 56 insertions(+), 104 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/nhs-notify-iam.iml delete mode 100644 .idea/vcs.xml diff --git a/.gitignore b/.gitignore index a0ca516..be63102 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ amplifyconfiguration* .next .env +.idea diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 0a75641..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 1532194..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/nhs-notify-iam.iml b/.idea/nhs-notify-iam.iml deleted file mode 100644 index 24643cc..0000000 --- a/.idea/nhs-notify-iam.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1dd..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/amplify/package.json b/amplify/package.json index aead43d..3dbc1ca 100644 --- a/amplify/package.json +++ b/amplify/package.json @@ -1,3 +1,3 @@ { "type": "module" -} \ No newline at end of file +} diff --git a/components/Login.tsx b/components/Login.tsx index aa16dfc..da0c8d7 100644 --- a/components/Login.tsx +++ b/components/Login.tsx @@ -34,16 +34,18 @@ function components(redirectPath: string): DefaultComponents { > Sign in to your account -
+
-
+
or
diff --git a/docs/adr/ADR-001_AuthN_implementation_notes.md b/docs/adr/ADR-001_AuthN_implementation_notes.md index b882554..ef203c0 100644 --- a/docs/adr/ADR-001_AuthN_implementation_notes.md +++ b/docs/adr/ADR-001_AuthN_implementation_notes.md @@ -26,53 +26,43 @@ ## Context - - ## Decision ### Assumptions This decision is based on the following assumptions that are used to form a set of generic requirements for the implementation as a guide. -* A log-in form should be displayed within the web application layout -* The log-in form should allow configuration for OIDC federated +- A log-in form should be displayed within the web application layout +- The log-in form should allow configuration for OIDC federated identity providers -* The log-in credentials should be captured and made available to +- The log-in credentials should be captured and made available to other micro-frontends under the same domain ### Drivers - - ### Options - - ### Outcome -* The login and signout pages will be hosted as a micro-frontend +- The login and sign out pages will be hosted as a micro-frontend using Amplify -* The frontend will be implemented using Next.js -* The backend auth service will be Cognito -* Cognito will be configured independently of Amplify to allow +- The frontend will be implemented using Next.js +- The backend auth service will be Cognito +- Cognito will be configured independently of Amplify to allow later migration to an alternative hosting solution or login portal if necessary -* Amplify utility library for React will be used to provide the +- Amplify utility library for React will be used to provide the login form and manage the credentials cookie. This avoids maintaining our own implementation of a security feature ### Rationale - ## Consequences - ## Compliance - ## Notes - ## Actions ## Tags diff --git a/scripts/config/pre-commit.yaml b/scripts/config/pre-commit.yaml index 37ca637..1cc40e3 100644 --- a/scripts/config/pre-commit.yaml +++ b/scripts/config/pre-commit.yaml @@ -1,40 +1,36 @@ repos: -- repo: local - hooks: - - id: scan-secrets - name: Scan secrets - entry: ./scripts/githooks/scan-secrets.sh - args: ["check=staged-changes"] - language: script - pass_filenames: false -- repo: local - hooks: - - id: check-file-format - name: Check file format - entry: ./scripts/githooks/check-file-format.sh - args: ["check=staged-changes"] - language: script - pass_filenames: false -- repo: local - hooks: - - id: check-markdown-format - name: Check Markdown format - entry: ./scripts/githooks/check-markdown-format.sh - args: ["check=staged-changes"] - language: script - pass_filenames: false -- repo: local - hooks: - - id: check-english-usage - name: Check English usage - entry: ./scripts/githooks/check-english-usage.sh - args: ["check=staged-changes"] - language: script - pass_filenames: false -- repo: local - hooks: - - id: lint-terraform - name: Lint Terraform - entry: ./scripts/githooks/check-terraform-format.sh - language: script - pass_filenames: false + - repo: local + hooks: + - id: scan-secrets + name: Scan secrets + entry: /usr/bin/env check=whole-history ./scripts/githooks/scan-secrets.sh + language: script + pass_filenames: false + - repo: local + hooks: + - id: check-file-format + name: Check file format + entry: /usr/bin/env check=branch ./scripts/githooks/check-file-format.sh + language: script + pass_filenames: false + - repo: local + hooks: + - id: check-markdown-format + name: Check Markdown format + entry: /usr/bin/env check=branch ./scripts/githooks/check-markdown-format.sh + language: script + pass_filenames: false + - repo: local + hooks: + - id: check-english-usage + name: Check English usage + entry: /usr/bin/env check=branch ./scripts/githooks/check-english-usage.sh + language: script + pass_filenames: false + - repo: local + hooks: + - id: lint-terraform + name: Lint Terraform + entry: ./scripts/githooks/check-terraform-format.sh + language: script + pass_filenames: false diff --git a/scripts/config/vale/styles/Vocab/words/accept.txt b/scripts/config/vale/styles/Vocab/words/accept.txt index bf5939a..dc124c0 100644 --- a/scripts/config/vale/styles/Vocab/words/accept.txt +++ b/scripts/config/vale/styles/Vocab/words/accept.txt @@ -23,3 +23,4 @@ endfor drawio rawContent endcapture +Cognito diff --git a/scripts/git-repo/branch-protection.md b/scripts/git-repo/branch-protection.md index 1821a1c..0e513f8 100644 --- a/scripts/git-repo/branch-protection.md +++ b/scripts/git-repo/branch-protection.md @@ -1,8 +1,8 @@ -# Github +# GitHub ## Branch Protection Rules -This will create the default branch protection rules using Github API. +This will create the default branch protection rules using GitHub API. ```sh ./branch-protection.sh $reponame $PAT