Skip to content

Commit

Permalink
Merge branch 'master' into flexion/story/900/remove-oml-transformation
Browse files Browse the repository at this point in the history
  • Loading branch information
basiliskus authored Nov 5, 2024
2 parents 13cb0a1 + 9500375 commit dba0ba6
Show file tree
Hide file tree
Showing 32 changed files with 469 additions and 196 deletions.
67 changes: 29 additions & 38 deletions .environment/gitleaks/gitleaks-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,36 @@ title = "PRIME ReportStream Gitleaks Configuration"
# Global allowlist
[allowlist]
description = "Allow-list for files and paths"
files = [
'(.*?)(bin|doc|gif|iml|jar|jp(e)?g|pdf|png|xlsx)$',
'^\.?gitleaks-config.toml$',
'^\.?gitleaks.report.json$',
'^package-lock\.json$',
'cleanslate.sh.log',
'yarn\.lock$',
]
paths = [
'.environment/sftp-conf',
'.environment/soap_service/',
'.github/scripts/stale_items_report/',
'.idea/',
'.terraform/providers/',
'frontend/dist',
'frontend/node_modules/',
'frontend/src/assets',
'frontend-react/build/',
'frontend-react/node_modules/',
'frontend-react/src/components/ReportStreamHeader.tsx',
'prime-router/.gradle/',
'prime-router/.vault/env/',
'prime-router/build/',
'prime-router/build.gradle.kts',
'prime-router/docs/dependency-graph-full/dependency-graph-full.txt',
'prime-router/docs/schema_documentation/',
'prime-router/docs/design/design/auth/auth-design.md',
'prime-router/docs/getting_started.md',
'prime-router/frontend/src/assets/fonts',
'prime-router/frontend/src/assets/img',
'prime-router/frontend/src/assets/pdf',
'prime-router/frontend/src/assets/webfonts',
'prime-router/src/main/kotlin/cli/tests/TestKeys.kt',
'prime-router/src/test/csv_test_files/input/',
'prime-router/src/test/kotlin/credentials/CredentialTests',
'prime-router/src/test/',
'prime-router/src/main/resources/metadata',
'.environment/gitleaks/gitleaks-config.toml',
'exp/as2/keystore_steps.md',
# package manager files
'package-lock\.json$',
'yarn\.lock$',
# ide
'\.idea\/',
# misc
'(.*?)(bin|doc|gif|iml|jar|jp(e)?g|pdf|png|xlsx)$',
# devops
'\.terraform\/providers\/',
'^\.environment\/gitleaks\/gitleaks-config\.toml$',
'^\.environment\/sftp-conf\/',
'^\.environment\/soap_service\/',
'^\.github\/scripts\/stale_items_report\/',
# backend
'^prime-router\/\.gradle\/',
'^prime-router\/.vault\/env\/',
'^prime-router\/build\/',
'^prime-router\/build\.gradle\.kts',
'^prime-router\/docs\/dependency-graph-full/dependency-graph-full\.txt',
'^prime-router\/docs\/schema_documentation/',
'^prime-router\/docs\/design/design/auth/auth-design\.md',
'^prime-router\/docs\/getting_started\.md',
'^prime-router\/src\/main\/kotlin\/cli\/tests\/TestKeys\.kt',
'^prime-router\/src\/test\/csv_test_files\/input\/',
'^prime-router\/src\/test\/kotlin\/credentials\/CredentialTests',
'^prime-router\/src\/test\/',
'^prime-router\/src\/main\/resources\/metadata',
# frontend
'^frontend-react\/public\/assets\/',
]

[[rules]]
Expand Down
3 changes: 2 additions & 1 deletion .environment/gitleaks/run-gitleaks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ esac
if [[ ${RC?} != 0 ]]; then
error "(return code=${RC?}) Your code may contain secrets, consult the output above and/or one of the following files for more details:"
error " - ${REPO_ROOT?}/${REPORT_JSON?}"
error " - ${REPO_ROOT?}/${LOGFILE?}"
# no log file currently, check the output of whatever ran this
# error " - ${REPO_ROOT?}/${LOGFILE?}"
fi

exit ${RC?}
163 changes: 122 additions & 41 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,64 +136,145 @@ updates:
timezone: "US/Eastern"
rebase-strategy: "disabled"
groups:
mdx:
project:
patterns:
- "*mdx*"
storybook:
patterns:
- "*storybook*"
testing-library:
patterns:
- "*testing-library/*"
eslint:
patterns:
- "eslint*"
exclude-patterns:
- "*prettier"
- "*vitest*"
- "*storybook"
- "*testing-library"
- "*playwright*"
vitest:
patterns:
- "*vitest*"
msw:
patterns:
- "*msw*"
prettier:
patterns:
- "*prettier*"
- "husky"
- "lint-staged"
- "dotenv-flow"
- "@types/dotenv-flow"
- "cross-env"
- "browserslist*"
- "@types/node"
- "npm-run-all"
- "patch-package"
typescript:
patterns:
- "typescript"
- "*typescript*"
- "tslib"
- "ts-node"
- "@typescript-eslint*"
- "tsx"
typescript-types:
patterns:
- "@types/*"
exclude-patterns:
- "*dotenv-flow"
- "*node"
- "*eslint__js"
- "*mdx"
- "@types/react"
- "@types/react-dom"
- "*react-router*"
- "*html-to-text"
- "*lodash"
- "*dompurify"
- "*sanitize-html"
- "*react-scroll-sync"
- "*downloadjs"
react:
patterns:
- "react"
- "react-dom"
react-router:
- "@types/react"
- "@types/react-dom"
- "eslint-plugin-react"
- "eslint-plugin-react-hooks"
- "eslint-plugin-react-refresh"
ui:
patterns:
- "*react-router*"
playwright:
- "@uswds/*"
- "@trussworks/react-uswds"
- "react-loader-spinner"
- "react-toastify"
- "react-scroll-sync"
- "@types/react-scroll-sync"
- "focus-trap-react"
- "react-error-boundary"
utils:
patterns:
- "*lodash*"
- "use-deep-compare-effect"
- "uuid"
- "p-limit"
- "history"
- "date-fns*"
- "export-to-csv-fix-source-map"
- "classnames"
sanitizers:
patterns:
- "*playwright*"
vite:
- "*sanitize-html"
- "*html-to-text"
- "*dompurify"
bundler:
patterns:
- "vite"
- "vite-plugin-*"
- "@vitejs/*"
linting-and-formatting:
patterns:
- "@eslint/*"
- "@types/eslint__js"
- "eslint"
- "*prettier*"
lint-plugins:
patterns:
- "vite*"
- "@vitejs*"
- "eslint-*"
exclude-patterns:
- "@storybook*"
- "vitest*"
okta:
- "*-plugin-jest-dom"
- "*-plugin-playwright"
- "*-plugin-react"
- "*-plugin-react-hooks"
- "*-plugin-react-refresh"
- "*-plugin-storybook"
- "*-plugin-testing-library"
- "*-plugin-vitest"
mocking:
patterns:
- "mockdate"
- "*msw*"
unit-testing:
patterns:
- "*vitest*"
- "eslint-plugin-jest-dom"
- "jsdom"
- "*testing-library/*"
- "undici"
- "globals"
e2e-testing:
patterns:
- "*playwright*"
- "otpauth"
storybook:
patterns:
- "@okta*"
applicationinsights:
- "chromatic"
- "storybook"
- "@storybook/*"
- "eslint-plugin-storybook"
css:
patterns:
- "sass"
- "postcss"
- "autoprefixer"
analytics:
patterns:
- "@microsoft/applicationinsights*"
react-query:
- "web-vitals"
markdown:
patterns:
- "@mdx-js/*"
- "@types/mdx"
- "remark-*"
- "rehype-*"
- "react-markdown"
router:
patterns:
- "*react-router*"
auth:
patterns:
- "@okta/*"
fetching:
patterns:
- "*downloadjs"
- "axios"
- "*react-query*"

# IAC
Expand Down
4 changes: 0 additions & 4 deletions frontend-react/e2e/helpers/internal-links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,4 @@ export const developerResourcesApiSideNav = [
name: "Responses from ReportStream",
path: "/developer-resources/api/documentation/responses-from-reportstream",
},
{
name: "Sample payloads and output",
path: "/developer-resources/api/documentation/sample-payloads-and-output",
},
];
30 changes: 16 additions & 14 deletions frontend-react/e2e/spec/all/idletimeout.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import process from "node:process";
import { OrganizationPage } from "../../pages/authenticated/admin/organization";
import { test as baseTest } from "../../test";

const timeout = parseInt(process.env.VITE_IDLE_TIMEOUT ?? "20000");
// Add/Sub 500 ms to account for variance
const timeoutLow = timeout - 500;
const timeoutHigh = timeout + 500;
const timeout = parseInt(process.env.VITE_IDLE_TIMEOUT ?? "900000");
const timeoutLow = timeout - 1000;
const timeoutHigh = timeout + 1000;

export interface OrganizationPageFixtures {
organizationPage: OrganizationPage;
Expand Down Expand Up @@ -37,27 +36,30 @@ const test = baseTest.extend<OrganizationPageFixtures>({
frontendWarningsLogPath,
isFrontendWarningsLog,
});
await page.page.clock.install();
await page.goto();
await use(page);
},
});

test.use({ storageState: "e2e/.auth/admin.json" });

test.skip("Does not trigger early", async ({ organizationPage }) => {
await expect(organizationPage.page.getByRole("banner").first()).toBeVisible();
await organizationPage.page.keyboard.down("Tab");
test.describe("Idle time out", () => {
test("Does not trigger early", async ({ organizationPage }) => {
await expect(organizationPage.page.getByRole("banner").first()).toBeVisible();
await organizationPage.page.keyboard.down("Tab");

const start = new Date();
await organizationPage.page.clock.fastForward(timeoutLow);

await organizationPage.page.waitForRequest(/\/oauth2\/default\/v1\/revoke/, {
timeout: timeoutHigh,
await expect(organizationPage.page.getByRole("banner").first()).toBeVisible();
});

const end = new Date();
test("Triggers on time", async ({ organizationPage }) => {
await expect(organizationPage.page.getByRole("banner").first()).toBeVisible();
await organizationPage.page.keyboard.down("Tab");

const idleTime = Math.abs(end.valueOf() - start.valueOf());
await organizationPage.page.clock.fastForward(timeoutHigh);

expect(idleTime).not.toBeLessThan(timeoutLow);
expect(idleTime).not.toBeGreaterThan(timeoutHigh);
await expect(organizationPage.page.getByRole("link", { name: "Login" })).toBeVisible();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ const test = baseTest.extend<SecurityPageFixtures>({
},
});

test.describe(
// Page currently archived
test.describe.skip(
"Developer Resources / API / Documentation / Sample payloads and output page",
{
tag: "@smoke",
Expand Down
Binary file not shown.
3 changes: 0 additions & 3 deletions frontend-react/public/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@
<url>
<loc>https://reportstream.cdc.gov/developer-resources/api/documentation/responses-from-reportstream</loc>
</url>
<url>
<loc>https://reportstream.cdc.gov/developer-resources/api/documentation/sample-payloads-and-output</loc>
</url>
<url>
<loc>https://reportstream.cdc.gov/support</loc>
</url>
Expand Down
10 changes: 6 additions & 4 deletions frontend-react/src/AppRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ const ManagingYourConnectionIndex = lazy(
lazyRouteMarkdown(() => import("./content/managing-your-connection/index.mdx")),
);
const SupportIndex = lazy(lazyRouteMarkdown(() => import("./content/support/index.mdx")));
const ReportStreamApiDocumentationPayloads = lazy(
// Page currently archived
/*const ReportStreamApiDocumentationPayloads = lazy(
lazyRouteMarkdown(
() => import("./content/developer-resources/reportstream-api/documentation/SamplePayloadsAndOutput.mdx"),
),
);
);*/

/* Public Pages */
const TermsOfService = lazy(() => import("./pages/TermsOfService"));
Expand Down Expand Up @@ -269,13 +270,14 @@ export const appRoutes: RouteObject[] = [
isContentPage: true,
},
},
{
// Page currently archived
/*{
path: "sample-payloads-and-output",
element: <ReportStreamApiDocumentationPayloads />,
handle: {
isContentPage: true,
},
},
},*/
],
},
],
Expand Down
Loading

0 comments on commit dba0ba6

Please sign in to comment.