@fixedwidthtable/fixedwidthtable 0.0.1-security → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of @fixedwidthtable/fixedwidthtable might be problematic. Click here for more details.

Files changed (69) hide show
  1. package/.eslintignore +2 -0
  2. package/.eslintrc.js +8 -0
  3. package/.github/dependabot.yml +24 -0
  4. package/.github/workflows/audit.yml +14 -0
  5. package/.github/workflows/ci.yml +53 -0
  6. package/.github/workflows/release.yml +31 -0
  7. package/.github/workflows/reusable-audit.yml +41 -0
  8. package/.github/workflows/reusable-lint.yml +33 -0
  9. package/CODEOWNERS +1 -0
  10. package/LICENSE.md +18 -0
  11. package/README.md +12 -3
  12. package/e2e/browser/test/e2e.playwright.ts +67 -0
  13. package/e2e/browser/test/globalSetup.ts +30 -0
  14. package/e2e/browser/test-app/.eslintrc.js +6 -0
  15. package/e2e/browser/test-app/README.md +46 -0
  16. package/e2e/browser/test-app/components/appContainer/index.tsx +109 -0
  17. package/e2e/browser/test-app/components/solidClient/index.tsx +149 -0
  18. package/e2e/browser/test-app/next-env.d.ts +5 -0
  19. package/e2e/browser/test-app/next.config.js +6 -0
  20. package/e2e/browser/test-app/package-lock.json +1982 -0
  21. package/e2e/browser/test-app/package.json +25 -0
  22. package/e2e/browser/test-app/pages/_app.tsx +28 -0
  23. package/e2e/browser/test-app/pages/index.tsx +36 -0
  24. package/e2e/browser/test-app/tsconfig.json +20 -0
  25. package/eslint-configs/README.md +75 -0
  26. package/eslint-configs/eslint-config-base/README.md +29 -0
  27. package/eslint-configs/eslint-config-base/index.js +159 -0
  28. package/eslint-configs/eslint-config-base/license-header.js +20 -0
  29. package/eslint-configs/eslint-config-base/package.json +41 -0
  30. package/eslint-configs/eslint-config-lib/README.md +51 -0
  31. package/eslint-configs/eslint-config-lib/index.js +83 -0
  32. package/eslint-configs/eslint-config-lib/package.json +29 -0
  33. package/eslint-configs/eslint-config-react/README.md +97 -0
  34. package/eslint-configs/eslint-config-react/index.js +75 -0
  35. package/eslint-configs/eslint-config-react/package.json +32 -0
  36. package/lerna.json +4 -0
  37. package/package.json +45 -3
  38. package/packages/base-rollup-config/README.md +22 -0
  39. package/packages/base-rollup-config/index.mjs +59 -0
  40. package/packages/base-rollup-config/package.json +25 -0
  41. package/packages/internal-playwright-helpers/README.md +30 -0
  42. package/packages/internal-playwright-helpers/package.json +29 -0
  43. package/packages/internal-playwright-helpers/rollup.config.mjs +57 -0
  44. package/packages/internal-playwright-helpers/src/fixtures.ts +51 -0
  45. package/packages/internal-playwright-helpers/src/flows/auth.ts +93 -0
  46. package/packages/internal-playwright-helpers/src/index.ts +26 -0
  47. package/packages/internal-playwright-helpers/src/pages/cognito.ts +48 -0
  48. package/packages/internal-playwright-helpers/src/pages/open-id.ts +56 -0
  49. package/packages/internal-playwright-helpers/src/pages/testPage.ts +74 -0
  50. package/packages/internal-playwright-helpers/tsconfig.json +8 -0
  51. package/packages/internal-playwright-testids/package.json +22 -0
  52. package/packages/internal-playwright-testids/rollup.config.mjs +56 -0
  53. package/packages/internal-playwright-testids/src/index.ts +35 -0
  54. package/packages/internal-playwright-testids/tsconfig.json +8 -0
  55. package/packages/internal-test-env/README.md +44 -0
  56. package/packages/internal-test-env/env/.env.example +36 -0
  57. package/packages/internal-test-env/index.ts +474 -0
  58. package/packages/internal-test-env/package.json +30 -0
  59. package/packages/internal-test-env/rollup.config.mjs +80 -0
  60. package/packages/internal-test-env/tsconfig.json +20 -0
  61. package/packages/internal-test-env/utils.ts +31 -0
  62. package/packages/jest-jsdom-polyfills/README.md +21 -0
  63. package/packages/jest-jsdom-polyfills/index.js +80 -0
  64. package/packages/jest-jsdom-polyfills/package.json +36 -0
  65. package/playwright.config.ts +76 -0
  66. package/scripts/index.js +1 -0
  67. package/scripts/prepare-release.sh +32 -0
  68. package/scripts/release.sh +36 -0
  69. package/tsconfig.base.json +17 -0
@@ -0,0 +1,48 @@
1
+ //
2
+ // Copyright Inrupt Inc.
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal in
6
+ // the Software without restriction, including without limitation the rights to use,
7
+ // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
+ // Software, and to permit persons to whom the Software is furnished to do so,
9
+ // subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in
12
+ // all copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
+ // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16
+ // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
+ // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
+ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
+ // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ //
21
+
22
+ import type { Page } from "@playwright/test";
23
+
24
+ /**
25
+ * Login page exposed by Cognito, the OIDC Provider used for PodSpaces and other
26
+ * ESS deployments.
27
+ */
28
+ export class CognitoPage {
29
+ page: Page;
30
+
31
+ constructor(page: Page) {
32
+ this.page = page;
33
+ }
34
+
35
+ static isOnPage = (url: URL): boolean => url.hostname.includes("auth.");
36
+
37
+ async login(
38
+ username: string,
39
+ password: string,
40
+ options?: { timeout?: number },
41
+ ) {
42
+ await this.page
43
+ .getByRole("textbox", { name: "Username" })
44
+ .fill(username, options);
45
+ await this.page.getByRole("textbox", { name: "Password" }).fill(password);
46
+ return this.page.getByRole("button", { name: "submit" }).click();
47
+ }
48
+ }
@@ -0,0 +1,56 @@
1
+ //
2
+ // Copyright Inrupt Inc.
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal in
6
+ // the Software without restriction, including without limitation the rights to use,
7
+ // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
+ // Software, and to permit persons to whom the Software is furnished to do so,
9
+ // subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in
12
+ // all copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
+ // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16
+ // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
+ // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
+ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
+ // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ //
21
+
22
+ import { expect, type Page } from "@playwright/test";
23
+
24
+ /**
25
+ * The Solid-OIDC Broker exposed by ESS wrapped around an underlying OpenID Provider
26
+ */
27
+ export class OpenIdPage {
28
+ page: Page;
29
+
30
+ constructor(page: Page) {
31
+ this.page = page;
32
+ }
33
+
34
+ static isOnPage = (url: URL) => url.hostname.includes("inrupt.com");
35
+
36
+ async allow(options?: { timeout?: number }) {
37
+ // Class-based selector that will remain compatible with previous code
38
+ const classBasedSelector = this.page.locator(".allow-button");
39
+ // Testid-based selector that will be compatible with newer releases
40
+ const testidBasedSelector = this.page.getByTestId("prompt-continue");
41
+ // Once we no longer support ESS 2.1, we can remove the class-based selector and only use the testid-based one.
42
+ await expect(classBasedSelector.or(testidBasedSelector)).toBeVisible(
43
+ options,
44
+ );
45
+ // Fallback selector to support class attributes, until testid supports is fully deployed.
46
+ const correctSelector = (await testidBasedSelector.isVisible())
47
+ ? testidBasedSelector
48
+ : classBasedSelector;
49
+ return correctSelector.click();
50
+ }
51
+
52
+ // TODO: write the deny function
53
+ // async deny() {
54
+
55
+ // }
56
+ }
@@ -0,0 +1,74 @@
1
+ //
2
+ // Copyright Inrupt Inc.
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal in
6
+ // the Software without restriction, including without limitation the rights to use,
7
+ // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
+ // Software, and to permit persons to whom the Software is furnished to do so,
9
+ // subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in
12
+ // all copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
+ // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16
+ // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
+ // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
+ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
+ // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ //
21
+
22
+ import type { Page } from "@playwright/test";
23
+ import { TESTID_SELECTORS } from "@inrupt/internal-playwright-testids";
24
+
25
+ export class TestPage {
26
+ page: Page;
27
+
28
+ openidProvider: string;
29
+
30
+ constructor(page: Page, openidProvider: string) {
31
+ this.page = page;
32
+ this.openidProvider = openidProvider;
33
+ }
34
+
35
+ static isOnPage = (url: URL) => url.hostname === "localhost";
36
+
37
+ async start(options?: { timeout?: number }) {
38
+ await this.page.goto("/", options);
39
+ }
40
+
41
+ async startLogin(options?: { timeout?: number }) {
42
+ await this.page.fill(
43
+ TESTID_SELECTORS.OPENID_PROVIDER_INPUT,
44
+ this.openidProvider,
45
+ options,
46
+ );
47
+ return this.page.click(TESTID_SELECTORS.LOGIN_BUTTON, options);
48
+ }
49
+
50
+ async handleRedirect(options?: { timeout?: number }) {
51
+ // Wait for the backchannel exchange
52
+ await this.page.waitForRequest(
53
+ (request) =>
54
+ request.method() === "POST" && request.url().includes("/token"),
55
+ options,
56
+ );
57
+ await this.page.waitForResponse(
58
+ (response) => response.status() === 200,
59
+ options,
60
+ );
61
+ }
62
+
63
+ async getErrorStatus(options?: { timeout?: number }) {
64
+ return this.page
65
+ .locator(TESTID_SELECTORS.ERROR_MESSAGE)
66
+ .textContent(options);
67
+ }
68
+
69
+ async getSessionStatus(options?: { timeout?: number }) {
70
+ return this.page
71
+ .locator(TESTID_SELECTORS.SESSION_STATUS)
72
+ .textContent(options);
73
+ }
74
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "outDir": "./dist",
5
+ "rootDir": "./src"
6
+ },
7
+ "include": ["src/index.ts"],
8
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@inrupt/internal-playwright-testids",
3
+ "version": "2.4.0",
4
+ "description": "Shared identifiers between browser-based tests and test app.",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.es.js",
7
+ "publishConfig": {
8
+ "access": "public"
9
+ },
10
+ "scripts": {
11
+ "build": "rollup -c rollup.config.mjs",
12
+ "clean": "rimraf dist"
13
+ },
14
+ "author": "Inrupt <devtools-team@inrupt.com>",
15
+ "license": "MIT",
16
+ "exports": {
17
+ ".": {
18
+ "require": "./dist/index.js",
19
+ "import": "./dist/index.mjs"
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,56 @@
1
+ // The following is only possible from Node 18 onwards
2
+ // import pkg from "./package.json" assert { type: "json" };
3
+
4
+ // Until we only support Node 18+, this should be used instead
5
+ // (see https://rollupjs.org/guide/en/#importing-packagejson)
6
+ import { createRequire } from "node:module";
7
+ const require = createRequire(import.meta.url);
8
+ const pkg = require("./package.json");
9
+
10
+ import typescript from "rollup-plugin-typescript2";
11
+
12
+ const external = [
13
+ ...Object.keys(pkg.dependencies || {}),
14
+ ];
15
+
16
+ const plugins = [
17
+ typescript({
18
+ // Use our own version of TypeScript, rather than the one bundled with the plugin:
19
+ typescript: require("typescript"),
20
+ tsconfigOverride: {
21
+ compilerOptions: {
22
+ module: "esnext",
23
+ },
24
+ },
25
+ }),
26
+ ];
27
+
28
+ const rollupDefaultConfig = { external, plugins };
29
+
30
+ export default [
31
+ {
32
+ ...rollupDefaultConfig,
33
+ input: "src/index.ts",
34
+ output: [
35
+ {
36
+ file: pkg.main,
37
+ format: "cjs",
38
+ },
39
+ {
40
+ file: pkg.module,
41
+ entryFileNames: "[name].es.js",
42
+ format: "esm",
43
+ },
44
+ ],
45
+ },
46
+ {
47
+ ...rollupDefaultConfig,
48
+ input: ["src/index.ts"],
49
+ output: {
50
+ dir: "dist",
51
+ entryFileNames: "[name].mjs",
52
+ format: "esm",
53
+ preserveModules: true,
54
+ },
55
+ },
56
+ ];
@@ -0,0 +1,35 @@
1
+ //
2
+ // Copyright Inrupt Inc.
3
+ //
4
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ // of this software and associated documentation files (the "Software"), to deal in
6
+ // the Software without restriction, including without limitation the rights to use,
7
+ // copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8
+ // Software, and to permit persons to whom the Software is furnished to do so,
9
+ // subject to the following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included in
12
+ // all copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
+ // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16
+ // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
+ // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18
+ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19
+ // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ //
21
+ export const TESTID_OPENID_PROVIDER_INPUT = "identityProviderInput";
22
+ export const TESTID_LOGIN_BUTTON = "loginButton";
23
+ export const TESTID_LOGOUT_BUTTON = "logoutButton";
24
+ export const TESTID_ERROR_MESSAGE = "errorMessage";
25
+ export const TESTID_SESSION_STATUS = "loggedInMessage";
26
+
27
+ const buildSelector = (testid: string) => `[data-testid=${testid}]`;
28
+
29
+ export const TESTID_SELECTORS = {
30
+ OPENID_PROVIDER_INPUT: buildSelector(TESTID_OPENID_PROVIDER_INPUT),
31
+ LOGIN_BUTTON: buildSelector(TESTID_LOGIN_BUTTON),
32
+ LOGOUT_BUTTON: buildSelector(TESTID_LOGOUT_BUTTON),
33
+ ERROR_MESSAGE: buildSelector(TESTID_ERROR_MESSAGE),
34
+ SESSION_STATUS: buildSelector(TESTID_SESSION_STATUS),
35
+ };
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "outDir": "./dist",
5
+ "rootDir": "./src"
6
+ },
7
+ "include": ["src/index.ts"],
8
+ }
@@ -0,0 +1,44 @@
1
+ # @inrupt/internal-test-env
2
+
3
+ This package contains utilities to help setup automated testing environments.
4
+
5
+ ## Installation
6
+
7
+ 1. `npm install --save-dev @inrupt/internal-test-env`
8
+
9
+ ## Usage:
10
+
11
+ Add the function import as needed.
12
+
13
+ ```
14
+ import "@inrupt/internal-test-env"
15
+ ```
16
+
17
+ ## Features
18
+
19
+ This helper exposes the following:
20
+
21
+ - `getNodeTestingEnvironment`
22
+ - `getBrowserTestingEnvironment`
23
+
24
+ These two functions will load from the environment variables as follows:
25
+
26
+ - Some variables will always be loaded and validated if applicable
27
+ - `E2E_TEST_ENVIRONMENT`: name of the target environment, used for information purpose.
28
+ E.g., `ESS Dev-Next`
29
+ - `E2E_TEST_IDP`: IRI of the OpenID Provider where the test session will be retrieved.
30
+ - Any environment variable starting with the pattern `E2E_TEST_FEATURE_*` will be
31
+ made available in a feature flags dictionary keyed by `*`. E.g., `E2E_TEST_FEATURE_NOTIFICATIONS`
32
+ being defined will result in `features["NOTIFICATIONS"]` to capture the associated
33
+ value.
34
+ - Some variables will only be loaded and validated if explicitly requested as part
35
+ of the `get*TestingEnvironment` call:
36
+ - `E2E_TEST_NOTIFICATION_GATEWAY`
37
+ - `E2E_TEST_NOTIFICATION_PROTOCOL`
38
+ - `E2E_TEST_VC_PROVIDER`
39
+ - `E2E_TEST_OWNER_CLIENT_ID`
40
+ - `E2E_TEST_OWNER_CLIENT_SECRET`
41
+ - `E2E_TEST_REQUESTOR_CLIENT_ID`
42
+ - `E2E_TEST_REQUESTOR_CLIENT_SECRET`
43
+ - `E2E_TEST_USER`
44
+ - `E2E_TEST_PASSWORD`
@@ -0,0 +1,36 @@
1
+ # Copy-paste this example file into a .env.test.local and fill in the missing values.
2
+ # Note that you can have multiple local environments side by side, e.g. .env.dev.local
3
+ # and .env.nss.local, and select which should be loaded by setting the `NODE_ENV`
4
+ # environment variable. For instance, running `NODE_ENV=dev npm run test:e2e:node`
5
+ # will load .env.dev.local.
6
+
7
+ # See `availableEnvironment` in ../setup/getTestingEnvironment.ts for a list of
8
+ # available environments
9
+ E2E_TEST_ENVIRONMENT="ESS PodSpaces"
10
+ E2E_TEST_IDP=https://login.inrupt.com/
11
+ E2E_TEST_NOTIFICATION_GATEWAY=https://notification.inrupt.com
12
+ E2E_TEST_NOTIFICATION_PROTOCOL=ESS Notifications Protocol
13
+
14
+ # e.g. via https://login.inrupt.com/registration.html
15
+ E2E_TEST_VC_PROVIDER=https://vc.inrupt.com
16
+
17
+ # Obtain these credentials by registering an application with your identity
18
+ # provider (E2E_TEST_IDP)
19
+ #
20
+ # Client credentials for the access requestor
21
+ E2E_TEST_REQUESTOR_CLIENT_ID=
22
+ E2E_TEST_REQUESTOR_CLIENT_SECRET=
23
+
24
+ # Client credentials for the resource owner
25
+ E2E_TEST_OWNER_CLIENT_ID=
26
+ E2E_TEST_OWNER_CLIENT_SECRET=
27
+
28
+ # Obtain user credentials by signing up for a Pod, e.g., via
29
+ # https://start.inrupt.com/
30
+ E2E_TEST_USER=<username>
31
+ E2E_TEST_PASSWORD=<password>
32
+
33
+ # Library specific feature flags
34
+ E2E_TEST_FEATURE_FLAG_ACP="true"
35
+ E2E_TEST_FEATURE_FLAG_WAC="true"
36
+ E2E_TEST_FEATURE_FLAG_ACP_V3="true"