diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 26edbf6c1..232b8f55e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -30,6 +30,38 @@ updates: open-pull-requests-limit: 10 commit-message: prefix: "web:" + # TODO: deduplicate these groups + groups: + sentry: + patterns: + - "@sentry/*" + babel: + patterns: + - "@babel/*" + - "babel-*" + eslint: + patterns: + - "@typescript-eslint/eslint-*" + - "eslint" + - "eslint-*" + storybook: + patterns: + - "@storybook/*" + - "*storybook*" + esbuild: + patterns: + - "@esbuild/*" + - package-ecosystem: npm + directory: "/tests/wdio" + schedule: + interval: daily + time: "04:00" + labels: + - dependencies + open-pull-requests-limit: 10 + commit-message: + prefix: "web:" + # TODO: deduplicate these groups groups: sentry: patterns: diff --git a/.github/workflows/ci-web.yml b/.github/workflows/ci-web.yml index f45b03715..c3659792f 100644 --- a/.github/workflows/ci-web.yml +++ b/.github/workflows/ci-web.yml @@ -13,19 +13,25 @@ on: jobs: lint-eslint: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + project: + - web + - tests/wdio steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: node-version: "20" cache: "npm" - cache-dependency-path: web/package-lock.json - - working-directory: web/ + cache-dependency-path: ${{ matrix.project }}/package-lock.json + - working-directory: ${{ matrix.project }}/ run: npm ci - name: Generate API run: make gen-client-ts - name: Eslint - working-directory: web/ + working-directory: ${{ matrix.project }}/ run: npm run lint lint-build: runs-on: ubuntu-latest @@ -45,19 +51,25 @@ jobs: run: npm run tsc lint-prettier: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + project: + - web + - tests/wdio steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: node-version: "20" cache: "npm" - cache-dependency-path: web/package-lock.json - - working-directory: web/ + cache-dependency-path: ${{ matrix.project }}/package-lock.json + - working-directory: ${{ matrix.project }}/ run: npm ci - name: Generate API run: make gen-client-ts - name: prettier - working-directory: web/ + working-directory: ${{ matrix.project }}/ run: npm run prettier-check lint-lit-analyse: runs-on: ubuntu-latest diff --git a/blueprints/schema.json b/blueprints/schema.json index 2ddec653d..784b5f597 100644 --- a/blueprints/schema.json +++ b/blueprints/schema.json @@ -7427,146 +7427,32 @@ "model_authentik_stages_invitation.invitation": { "type": "object", "properties": { + "name": { + "type": "string", + "maxLength": 50, + "minLength": 1, + "pattern": "^[-a-zA-Z0-9_]+$", + "title": "Name" + }, "expires": { "type": "string", "format": "date-time", "title": "Expires" }, - "user": { + "fixed_data": { "type": "object", - "properties": { - "username": { - "type": "string", - "maxLength": 150, - "minLength": 1, - "title": "Username" - }, - "name": { - "type": "string", - "title": "Name", - "description": "User's display name." - }, - "is_active": { - "type": "boolean", - "title": "Active", - "description": "Designates whether this user should be treated as active. Unselect this instead of deleting accounts." - }, - "last_login": { - "type": [ - "string", - "null" - ], - "format": "date-time", - "title": "Last login" - }, - "groups": { - "type": "array", - "items": { - "type": "integer" - }, - "title": "Groups" - }, - "email": { - "type": "string", - "format": "email", - "maxLength": 254, - "title": "Email address" - }, - "attributes": { - "type": "object", - "additionalProperties": true, - "title": "Attributes" - }, - "path": { - "type": "string", - "minLength": 1, - "title": "Path" - }, - "type": { - "type": "string", - "enum": [ - "internal", - "external", - "service_account", - "internal_service_account" - ], - "title": "Type" - } - }, - "required": [ - "username", - "name" - ], - "title": "User" + "additionalProperties": true, + "title": "Fixed data" }, - "application": { - "type": "object", - "properties": { - "name": { - "type": "string", - "minLength": 1, - "title": "Name", - "description": "Application's display Name." - }, - "slug": { - "type": "string", - "maxLength": 50, - "minLength": 1, - "pattern": "^[-a-zA-Z0-9_]+$", - "title": "Slug", - "description": "Internal application name, used in URLs." - }, - "provider": { - "type": "integer", - "title": "Provider" - }, - "backchannel_providers": { - "type": "array", - "items": { - "type": "integer" - }, - "title": "Backchannel providers" - }, - "open_in_new_tab": { - "type": "boolean", - "title": "Open in new tab", - "description": "Open launch URL in a new browser tab or window." - }, - "meta_launch_url": { - "type": "string", - "title": "Meta launch url" - }, - "meta_description": { - "type": "string", - "title": "Meta description" - }, - "meta_publisher": { - "type": "string", - "title": "Meta publisher" - }, - "policy_engine_mode": { - "type": "string", - "enum": [ - "all", - "any" - ], - "title": "Policy engine mode" - }, - "group": { - "type": "string", - "title": "Group" - } - }, - "required": [ - "name", - "slug" - ], - "title": "Application" + "single_use": { + "type": "boolean", + "title": "Single use", + "description": "When enabled, the invitation will be deleted after usage." }, - "permissions": { - "type": "string", - "minLength": 1, - "title": "Permissions" + "flow": { + "type": "integer", + "title": "Flow", + "description": "When set, only the configured flow can use this invitation." } }, "required": [] diff --git a/tests/wdio/blueprints/admin-user.yaml b/tests/wdio/blueprints/admin-user.yaml index 81d6bd82a..1a0e85e17 100644 --- a/tests/wdio/blueprints/admin-user.yaml +++ b/tests/wdio/blueprints/admin-user.yaml @@ -1,18 +1,16 @@ -context: {} +version: 1 entries: -- attrs: - attributes: {} - email: test-admin@goauthentik.io - is_active: true - name: authentik Default Admin - password: test-runner - path: users - type: internal - groups: - - !Find [authentik_core.group, [name, "authentik Admins"]] - conditions: [] - id: null - identifiers: - username: akadmin - model: authentik_core.user - state: present + - attrs: + email: test-admin@goauthentik.io + is_active: true + name: authentik Default Admin + password: test-runner + path: users + type: internal + groups: + - !Find [authentik_core.group, [name, "authentik Admins"]] + conditions: [] + identifiers: + username: akadmin + model: authentik_core.user + state: present diff --git a/tests/wdio/package-lock.json b/tests/wdio/package-lock.json index 549ebf765..2af2d939a 100644 --- a/tests/wdio/package-lock.json +++ b/tests/wdio/package-lock.json @@ -1,10 +1,10 @@ { - "name": "my-new-project", + "name": "@goauthentik/web-tests", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "my-new-project", + "name": "@goauthentik/web-tests", "devDependencies": { "@trivago/prettier-plugin-sort-imports": "^4.2.0", "@typescript-eslint/eslint-plugin": "^6.7.2", diff --git a/tests/wdio/package.json b/tests/wdio/package.json index 2cba7a235..2530d7ffd 100644 --- a/tests/wdio/package.json +++ b/tests/wdio/package.json @@ -1,5 +1,6 @@ { - "name": "my-new-project", + "name": "@goauthentik/web-tests", + "private": true, "type": "module", "devDependencies": { "@trivago/prettier-plugin-sort-imports": "^4.2.0", @@ -21,6 +22,7 @@ "scripts": { "wdio": "wdio run ./wdio.conf.ts", "lint:precommit": "eslint --max-warnings 0 --config ./.eslintrc.precommit.json $(git status --porcelain . | grep '^[AM?][M?]' | cut -d'/' -f3- | grep -E '\\.(ts|js|tsx|jsx)$')", + "lint": "eslint . --max-warnings 0 --fix", "lint:spelling": "codespell -D - -D $(git rev-parse --show-toplevel 2> /dev/null)/.github/codespell-dictionary.txt -I $(git rev-parse --show-toplevel 2> /dev/null)/.github/codespell-words.txt ./test -s", "precommit": "run-s lint:precommit lint:spelling prettier", "prettier-check": "prettier --check .", diff --git a/tests/wdio/test/pageobjects/applications-list.page.ts b/tests/wdio/test/pageobjects/applications-list.page.ts index 8324bb0b0..0f3d93e03 100644 --- a/tests/wdio/test/pageobjects/applications-list.page.ts +++ b/tests/wdio/test/pageobjects/applications-list.page.ts @@ -16,7 +16,6 @@ class ApplicationsListPage extends AdminPage { async open() { return await super.open("if/admin/#/core/applications"); } - } export default new ApplicationsListPage(); diff --git a/tests/wdio/test/specs/bad-logins.ts b/tests/wdio/test/specs/bad-logins.ts index bafd5842c..ca2547c49 100644 --- a/tests/wdio/test/specs/bad-logins.ts +++ b/tests/wdio/test/specs/bad-logins.ts @@ -1,8 +1,8 @@ import LoginPage from "../pageobjects/login.page.js"; import { BAD_PASSWORD, BAD_USERNAME, GOOD_USERNAME } from "../utils/constants.js"; import { expect } from "@wdio/globals"; - -describe("Log into Authentik", () => { + +describe("Log into authentik", () => { it("should fail on a bad username", async () => { await LoginPage.open(); await LoginPage.username(BAD_USERNAME); diff --git a/tests/wdio/test/specs/good-login.ts b/tests/wdio/test/specs/good-login.ts index 6469b014b..e045c541f 100644 --- a/tests/wdio/test/specs/good-login.ts +++ b/tests/wdio/test/specs/good-login.ts @@ -1,5 +1,5 @@ import { login } from "../utils/login.js"; -describe("Log into Authentik", () => { +describe("Log into authentik", () => { it("should login with valid credentials and reach the UserLibrary", login); }); diff --git a/tests/wdio/test/utils/constants.ts b/tests/wdio/test/utils/constants.ts index 158ee251b..3ca29f1de 100644 --- a/tests/wdio/test/utils/constants.ts +++ b/tests/wdio/test/utils/constants.ts @@ -2,6 +2,4 @@ export const BAD_USERNAME = process.env.AK_BAD_USERNAME ?? "bad-username@bad-log export const GOOD_USERNAME = process.env.AK_GOOD_USERNAME ?? "test-admin@goauthentik.io"; export const BAD_PASSWORD = process.env.AK_BAD_PASSWORD ?? "-this-is-a-bad-password-"; -export const GOOD_PASSWORD = process.env.AK_GOOD_PASSWORD ?? "test-runner" - - +export const GOOD_PASSWORD = process.env.AK_GOOD_PASSWORD ?? "test-runner"; diff --git a/tests/wdio/test/utils/login.ts b/tests/wdio/test/utils/login.ts index 5922f9248..59ff800fb 100644 --- a/tests/wdio/test/utils/login.ts +++ b/tests/wdio/test/utils/login.ts @@ -1,7 +1,7 @@ import LoginPage from "../pageobjects/login.page.js"; import UserLibraryPage from "../pageobjects/user-library.page.js"; -import { expect } from "@wdio/globals"; import { GOOD_PASSWORD, GOOD_USERNAME } from "./constants.js"; +import { expect } from "@wdio/globals"; export const login = async () => { await LoginPage.open(); diff --git a/tests/wdio/wdio.conf.ts b/tests/wdio/wdio.conf.ts index 2f6d51145..7a9f778d4 100644 --- a/tests/wdio/wdio.conf.ts +++ b/tests/wdio/wdio.conf.ts @@ -1,5 +1,4 @@ import type { Options } from "@wdio/types"; -import { browser } from "@wdio/globals"; export const config: Options.Testrunner = { // @@ -74,7 +73,7 @@ export const config: Options.Testrunner = { "--disable-dev-shm-usage", ] : []; - })() + })(), ), }, }, diff --git a/web/src/admin/applications/wizard/ak-application-wizard.ts b/web/src/admin/applications/wizard/ak-application-wizard.ts index 387fd82ce..0cc6ffc7f 100644 --- a/web/src/admin/applications/wizard/ak-application-wizard.ts +++ b/web/src/admin/applications/wizard/ak-application-wizard.ts @@ -30,7 +30,6 @@ export class ApplicationWizard extends CustomListenerElement( this.steps = newSteps(); } - /** * We're going to be managing the content of the forms by percolating all of the data up to this * class, which will ultimately transmit all of it to the server as a transaction. The