Skip to content

Commit

Permalink
Merge dev to main sprint Nanaimo (#232)
Browse files Browse the repository at this point in the history
* created AEM queries

* conected banners to AEM queries

* french translations for countdown

* commented out testing buttons

* fixed default content bug

* updated unit testing for modals

* fix: upgrade @apollo/client from 3.7.2 to 3.7.3

Snyk has created this PR to upgrade @apollo/client from 3.7.2 to 3.7.3.

See this package in npm:
https://www.npmjs.com/package/@apollo/client

See this project in Snyk:
https://app.snyk.io/org/p0nder0sa/project/60ffc669-57aa-416f-923d-9c5e8c2c64de?utm_source=github&utm_medium=referral&page=upgrade-pr

* reinstated previous tests

* dashboard test

* removed data files

* merged auth modal queries

* 1

* fixed link localization

* removed console logs

* updated test links

* updated contact us mobile view

* updated test

* skip test for now

* added scripts

* 96037 map base url to aem link (#183)

* mapped links

* mapped profile links

* Added comments

* updated security settings

* removed white space

* spacing

* updated exception link

* updated tests to include contact us link

* added timer

* tested

* fix: upgrade @opentelemetry/auto-instrumentations-node from 0.35.0 to 0.36.0

Snyk has created this PR to upgrade @opentelemetry/auto-instrumentations-node from 0.35.0 to 0.36.0.

See this package in npm:
https://www.npmjs.com/package/@opentelemetry/auto-instrumentations-node

See this project in Snyk:
https://app.snyk.io/org/p0nder0sa/project/60ffc669-57aa-416f-923d-9c5e8c2c64de?utm_source=github&utm_medium=referral&page=upgrade-pr

* updated chevron icon

* added to load icon in case it is needed

* default locale undefined

* Altered meta tags

* Auth dev (#176)

* initial next-auth checkin

* CSP rule for ecas added

* Added auth docker envs

* test

* revert test

* added public jwk

* update csp form action

* remove unused csp

* disabling ssl to test

* removed ssl workaround

* Add cert for srv113

* copy cert file to container

* moved certs directory

* typo for folder

* add ecas base url to build

* hardcoded CSP for srv

* fixed package lock

* added home changes to my-dashboard

* added logout

* added signout callback

* update proxystart namespace

* scrubbing profile sub

* updated package lock

* mcoked lib auth

* disable auth for cypress tests

* added secrets for auth to cypress

* fixed dockerfile typo

* added ut links with env control (#189)

* requested fixes

* New tcs for Contact Us CPP Page

* upgraded Script tag

* async Script tag

* Updated Script tag

* added getStaticProps, kept font swap

* fixed unit test

* removed profile page bug

* .

* removed legacy maps

* .

* updated security policy

* test wihtout adobe

* upt tracking code back in

* alternate script

* async

* synchronoous code added back

* lint exception

* lint exception

* checked bannerBoldText

* added banner content to index

* Added changes to Profile page.

Signed-off-by: Benoit Cloutier <benoit.bc.cloutier@gmail.com>

* fixing tests.

Signed-off-by: Benoit Cloutier <benoit.bc.cloutier@gmail.com>

* fixed e2e

* fixed jest

* .

* .

* -

* -

* Applying requests PR requests.

Signed-off-by: Benoit Cloutier <benoit.bc.cloutier@gmail.com>

* Fixed tests.

Signed-off-by: Benoit Cloutier <benoit.bc.cloutier@gmail.com>

* Unit test fix.

Signed-off-by: Benoit Cloutier <benoit.bc.cloutier@gmail.com>

* Quick fix?

Signed-off-by: Benoit Cloutier <benoit.bc.cloutier@gmail.com>

* Hello

Signed-off-by: Benoit Cloutier <benoit.bc.cloutier@gmail.com>

* skipped one french test

* Update CPPContactUsPO.cy.js

* Update ContactUsCPP.cy.js

* applied recommended changes

* added dynamic data

* 87201 login redirect (#193)

* initial next-auth checkin

* CSP rule for ecas added

* Added auth docker envs

* test

* revert test

* added public jwk

* update csp form action

* remove unused csp

* disabling ssl to test

* removed ssl workaround

* Add cert for srv113

* copy cert file to container

* moved certs directory

* typo for folder

* add ecas base url to build

* hardcoded CSP for srv

* fixed package lock

* added home changes to my-dashboard

* added logout

* added signout callback

* update proxystart namespace

* scrubbing profile sub

* updated package lock

* mcoked lib auth

* disable auth for cypress tests

* added secrets for auth to cypress

* implemented changes

* removed design elements

* added test

* modified test

* fixed dashboard test

* fixed dockerfile typo

* repaired unit test

* removed extra code from mapper

* added requested changes

* removed singout test

---------

Co-authored-by: Thomas Dacey <daceytom2@gmail.com>

* cleanup

* changed static props to server side (#198)

* bug fix

* removed signout from testing

* setup

* updated DS version

* examined each page

* purged orphaned imports

* purged orphaned imports

* updated security

* Using DS error pages.

Signed-off-by: Benoit Cloutier <benoit.bc.cloutier@gmail.com>

* removed lang

* x

* default locale

* fix: upgrade @apollo/client from 3.7.3 to 3.7.4

Snyk has created this PR to upgrade @apollo/client from 3.7.3 to 3.7.4.

See this package in npm:
https://www.npmjs.com/package/@apollo/client

See this project in Snyk:
https://app.snyk.io/org/p0nder0sa/project/60ffc669-57aa-416f-923d-9c5e8c2c64de?utm_source=github&utm_medium=referral&page=upgrade-pr

* fix: upgrade @opentelemetry/sdk-node from 0.34.0 to 0.35.0

Snyk has created this PR to upgrade @opentelemetry/sdk-node from 0.34.0 to 0.35.0.

See this package in npm:
https://www.npmjs.com/package/@opentelemetry/sdk-node

See this project in Snyk:
https://app.snyk.io/org/p0nder0sa/project/60ffc669-57aa-416f-923d-9c5e8c2c64de?utm_source=github&utm_medium=referral&page=upgrade-pr

* added contact-us buttons

* fix build error with getServerSideProps

* Fixed lang toggle.

Signed-off-by: Benoit Cloutier <benoit.bc.cloutier@gmail.com>

* Fixed failing tests.

Signed-off-by: Benoit Cloutier <benoit.bc.cloutier@gmail.com>

* changed AA script url as per request

* fixed permission issue

* updated footer links for authenticated space

* fixed blue highlight

* removed commented out text

* change h to div

* reorder the contact us page links

* feat!: added gh action for changelog generation

* Removed 500.js temporarily.

Signed-off-by: Benoit Cloutier <benoit.bc.cloutier@gmail.com>

* Fixing tests?

Signed-off-by: Benoit Cloutier <benoit.bc.cloutier@gmail.com>

* added id to the button for a11y

* Revert DS error pages.

Signed-off-by: Benoit Cloutier <benoit.bc.cloutier@gmail.com>

* fix: Dockerfile to reduce vulnerabilities

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-ALPINE316-OPENSSL-3314623
- https://snyk.io/vuln/SNYK-ALPINE316-OPENSSL-3314624
- https://snyk.io/vuln/SNYK-ALPINE316-OPENSSL-3314641
- https://snyk.io/vuln/SNYK-ALPINE316-OPENSSL-3314643
- https://snyk.io/vuln/SNYK-ALPINE316-OPENSSL-3314643

* fix: upgrade next-auth from 4.18.8 to 4.18.10

Snyk has created this PR to upgrade next-auth from 4.18.8 to 4.18.10.

See this package in npm:
https://www.npmjs.com/package/next-auth

See this project in Snyk:
https://app.snyk.io/org/p0nder0sa/project/60ffc669-57aa-416f-923d-9c5e8c2c64de?utm_source=github&utm_medium=referral&page=upgrade-pr

* fix so doens't fail if there is no content

* adusted styling for the province info heading

* fix: updated design system

* updated the spacing slightly

* fixed test

---------

Signed-off-by: Benoit Cloutier <benoit.bc.cloutier@gmail.com>
Co-authored-by: “Patrick“ <p@rickjobin.com>
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Co-authored-by: shewood <28784886+shewood@users.noreply.github.com>
Co-authored-by: CurtisUnderwood <curtisund@gmail.com>
Co-authored-by: Curtis Underwood <53541292+CurtisUnderwood@users.noreply.github.com>
Co-authored-by: shewood <shewood01@gmail.com>
Co-authored-by: Manisha <manisha.sharma@hrsdc-rhdcc.gc.ca>
Co-authored-by: Benoit Cloutier <benoit.bc.cloutier@gmail.com>
Co-authored-by: Benoit Cloutier <77116011+nibivi77@users.noreply.github.com>
Co-authored-by: Kris Charbonneau <71025360+krischarbonneau@users.noreply.github.com>
  • Loading branch information
11 people authored Feb 17, 2023
1 parent 3b6813b commit efb03d3
Show file tree
Hide file tree
Showing 95 changed files with 5,169 additions and 21,466 deletions.
15 changes: 14 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
NEXT_PUBLIC_BUILD_DATE = 12345
AEM_GRAPHQL_ENDPOINT = "test.com"
LOGGING_LEVEL = " info or debug"

MSCA_BASE_URL = "MSCA base url"
MSCA_EQ_BASE_URL = "MSCA base url with eq extension"
MSCA_ECAS_RASC_BASE_URL = "MSCA base url with ecas extension"
NEXTAUTH_SECRET= openssl rand -base64 32
NEXTAUTH_URL="http://localhost:3000"
CLIENT_SECRET="Client Secret from IDP"
CLIENT_ID="Client ID registered at the IDP"
AUTH_ECAS_BASE_URL="ECAS base URL"
AUTH_ECAS_WELL_KNOWN="ECAS well known endpoint"
AUTH_ECAS_AUTHORIZATION="ECAS authorization endpoint"
AUTH_ECAS_USERINFO="ECAS userinfo endpoint"
AUTH_PRIVATE={ "kty": "RSA", "n": "example private key" }
AUTH_DISABLED="set to 'true' to disable authentiation"
SWAP_USER_TESTING_LINKS = "Set true to use UT links"
2 changes: 1 addition & 1 deletion .github/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Secure Client Hub
# Secure Client Hub.

Secure Client Hub for Service Canada users accessing benefit details in a unified and consistent experience.

Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/default-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,25 @@ jobs:
env:
CI: true
AEM_GRAPHQL_ENDPOINT: ${{secrets.AEM_GRAPHQL_ENDPOINT}}
AUTH_DISABLED: true

- name: Cypress end-to-end 🧪
uses: cypress-io/github-action@v4
env:
CI: true
NODE_ENV: production
AEM_GRAPHQL_ENDPOINT: ${{secrets.AEM_GRAPHQL_ENDPOINT}}
NEXTAUTH_SECRET: ${{secrets.NEXTAUTH_SECRET}}
NEXTAUTH_URL: ${{secrets.NEXTAUTH_URL}}
CLIENT_SECRET: ${{secrets.CLIENT_SECRET}}
CLIENT_ID: ${{secrets.CLIENT_ID}}
AUTH_ECAS_BASE_URL: ${{secrets.AUTH_ECAS_BASE_URL}}
AUTH_ECAS_WELL_KNOWN: ${{secrets.AUTH_ECAS_WELL_KNOWN}}
AUTH_ECAS_AUTHORIZATION: ${{secrets.AUTH_ECAS_AUTHORIZATION}}
AUTH_ECAS_USERINFO: ${{secrets.AUTH_ECAS_USERINFO}}
AUTH_PRIVATE: ${{secrets.AUTH_PRIVATE}}
AUTH_ECAS_GLOBAL_LOGOUT_URL: ${{secrets.AUTH_ECAS_GLOBAL_LOGOUT_URL}}
AUTH_DISABLED: true
with:
install: false
start: npm run start:next
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
on:
push:
branches:
- main
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3.1.2
with:
release-type: node
package-name: release-please-action
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
# misc
.DS_Store
*.pem
!/certs/srv113-i-lab-hrdc-drhc-gc-ca-chain.pem

# debug
npm-debug.log*
Expand Down
54 changes: 52 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.12-alpine3.16 AS base
FROM node:18-alpine3.16 AS base
WORKDIR /base
COPY package*.json ./
RUN npm ci
Expand All @@ -11,24 +11,74 @@ ARG BUILD_DATE
ENV BUILD_DATE=$BUILD_DATE
ARG AEM_GRAPHQL_ENDPOINT
ENV AEM_GRAPHQL_ENDPOINT=$AEM_GRAPHQL_ENDPOINT
ARG AUTH_ECAS_BASE_URL
ENV AUTH_ECAS_BASE_URL=$AUTH_ECAS_BASE_URL
ARG MSCA_BASE_URL
ENV MSCA_BASE_URL=$MSCA_BASE_URL
ARG MSCA_EQ_BASE_URL
ENV MSCA_EQ_BASE_URL=$MSCA_EQ_BASE_URL
ARG MSCA_ECAS_RASC_BASE_URL
ENV MSCA_ECAS_RASC_BASE_URL=$MSCA_ECAS_RASC_BASE_URL

ENV NODE_ENV=production
WORKDIR /build
COPY --from=base /base ./
RUN npm run build

FROM node:18.12-alpine3.16 AS production
FROM node:18-alpine3.16 AS production
ENV NODE_ENV=production
WORKDIR /app
COPY --from=build /build/next.config.js ./
COPY --from=build /build/package*.json ./
COPY --from=build /build/.next ./.next
COPY --from=build /build/public ./public
COPY --from=build /build/tracing.js ./
COPY --from=build /build/certs/srv113-i-lab-hrdc-drhc-gc-ca-chain.pem ./certs/
RUN VERSION_NEXT=`node -p -e "require('./package.json').dependencies.next"`&& npm install --no-package-lock --no-save next@"$VERSION_NEXT"

# Runtime envs -- will default to build args if no env values are specified at docker run
ARG AEM_GRAPHQL_ENDPOINT
ENV AEM_GRAPHQL_ENDPOINT=$AEM_GRAPHQL_ENDPOINT
ARG MSCA_BASE_URL
ENV MSCA_BASE_URL=$MSCA_BASE_URL
ARG MSCA_EQ_BASE_URL
ENV MSCA_EQ_BASE_URL=$MSCA_EQ_BASE_URL
ARG MSCA_ECAS_RASC_BASE_URL
ENV MSCA_ECAS_RASC_BASE_URL=$MSCA_ECAS_RASC_BASE_URL

# ECAS/next-auth env start
ARG NEXTAUTH_SECRET
ENV NEXTAUTH_SECRET=$NEXTAUTH_SECRET

ARG NEXTAUTH_URL
ENV NEXTAUTH_URL=$NEXTAUTH_URL

ARG CLIENT_SECRET
ENV CLIENT_SECRET=$CLIENT_SECRET

ARG CLIENT_ID
ENV CLIENT_ID=$CLIENT_ID

ARG AUTH_ECAS_BASE_URL
ENV AUTH_ECAS_BASE_URL=$AUTH_ECAS_BASE_URL

ARG AUTH_ECAS_WELL_KNOWN
ENV AUTH_ECAS_WELL_KNOWN=$AUTH_ECAS_WELL_KNOWN

ARG AUTH_ECAS_AUTHORIZATION
ENV AUTH_ECAS_AUTHORIZATION=$AUTH_ECAS_AUTHORIZATION

ARG AUTH_ECAS_TOKEN
ENV AUTH_ECAS_TOKEN=$AUTH_ECAS_TOKEN

ARG AUTH_ECAS_USERINFO
ENV AUTH_ECAS_USERINFO=$AUTH_ECAS_USERINFO

ARG AUTH_PRIVATE
ENV AUTH_PRIVATE=$AUTH_PRIVATE

ARG AUTH_DISABLED
ENV AUTH_DISABLED=$AUTH_DISABLED
# ECAS/next-auth env end

CMD npm run start
12 changes: 6 additions & 6 deletions __tests__/components/Layout.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { render, screen } from '@testing-library/react'
import '@testing-library/jest-dom/extend-expect'
import { axe, toHaveNoViolations } from 'jest-axe'

import Layout from '../../components/Layout'
import { useRouter } from 'next/router'

Expand All @@ -28,12 +27,18 @@ describe('Layout with default text', () => {
desc: 'English',
author: 'Service Canada',
keywords: '',
service: 'ESDC-EDSC_MSCA-MSDC',
creator: 'Employment and Social Development Canada',
accessRights: '1',
},
data_fr: {
title: 'Mon dossier Service Canada - Canada.ca',
desc: 'Français',
author: 'Service Canada',
keywords: '',
service: 'ESDC-EDSC_MSCA-MSDC',
creator: 'Emploi et Développement social Canada',
accessRights: '1',
},
}
const display = { hideBanner: true }
Expand All @@ -48,11 +53,6 @@ describe('Layout with default text', () => {
expect(screen.getByAltText('Government of Canada')).toBeInTheDocument()
})

it('Layout contains "Skip to content" link', () => {
render(<Layout locale="fr" meta={meta} display={display} />)
expect(screen.getByText('Passer au contenu principal')).toBeInTheDocument()
})

it('Layout contains a Main tag', () => {
render(<Layout locale="en" meta={meta} display={display} />)
expect(screen.getByRole('main')).toBeInTheDocument()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { render, screen } from '@testing-library/react'
import '@testing-library/jest-dom/extend-expect'
import { axe, toHaveNoViolations } from 'jest-axe'
import PhaseBanner from './PhaseBanner'
import PhaseBanner from '../../components/PhaseBanner'

expect.extend(toHaveNoViolations)

Expand Down
20 changes: 20 additions & 0 deletions __tests__/components/sessionModals/CountDown.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ import CountDown from '../../../components/sessionModals/CountDown'

expect.extend(toHaveNoViolations)

const fallbackContent = {
en: {
bannerHeading: '',
signOutLinkText: '',
staySignedInLinktext: '',
bannerContent: '',
bannerMinutesAnd: 'minutes and',
bannerSeconds: 'seconds',
},
fr: {
bannerHeading: '',
signOutLinkText: '',
staySignedInLinktext: '',
bannerContent: '',
bannerMinutesAnd: 'minutes et',
bannerSeconds: 'secondes',
},
}

describe('CountDownModal', () => {
it('renders countDown', () => {
const primary = render(
Expand All @@ -14,6 +33,7 @@ describe('CountDownModal', () => {
onStay={() => console.log('Stay Signed In Clicked')}
id="CountDown"
deadline="January, 31, 2023"
{...fallbackContent.en}
/>
)
expect(primary).toBeTruthy()
Expand Down
16 changes: 16 additions & 0 deletions __tests__/components/sessionModals/SignedOut.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,29 @@ import SignedOut from '../../../components/sessionModals/SignedOut'

expect.extend(toHaveNoViolations)

const fallbackContent = {
en: {
scHeading: '',
signOutLinkText: '',
staySignedInLinktext: '',
scContent: ['', ''],
},
fr: {
scHeading: '',
signOutLinkText: '',
staySignedInLinktext: '',
scContent: ['', ''],
},
}

describe('SignedOutModal', () => {
it('renders signedOut', () => {
const primary = render(
<SignedOut
closeModal={() => console.log('Close Modal')}
onContinue={() => console.log('Continue Clicked')}
id="SignedOut"
{...fallbackContent.en}
/>
)
expect(primary).toBeTruthy()
Expand Down
1 change: 0 additions & 1 deletion __tests__/components/skeletons/Dashboard.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ describe('Dashboard', () => {
render(<Dashboard sections={1} />)

const box = screen.getByTestId('dashboard-skeleton')
console.log(box)
expect(box).toBeTruthy()
})
})
48 changes: 0 additions & 48 deletions __tests__/pages/404.test.js

This file was deleted.

Loading

0 comments on commit efb03d3

Please sign in to comment.