From 67d6c0e8af19e9bf039d6eedb0f871504da131f8 Mon Sep 17 00:00:00 2001 From: Ken Sternberg <133134217+kensternberg-authentik@users.noreply.github.com> Date: Tue, 7 Nov 2023 08:03:07 -0800 Subject: [PATCH 1/2] web: rollback dependabot context (#7479) * web: break circular dependency between AKElement & Interface. This commit changes the way the root node of the web application shell is discovered by child components, such that the base class shared by both no longer results in a circular dependency between the two models. I've run this in isolation and have seen no failures of discovery; the identity token exists as soon as the Interface is constructed and is found by every item on the page. * web: fix broken typescript references This built... and then it didn't? Anyway, the current fix is to provide type information the AkInterface for the data that consumers require. * web: rollback dependabot's upgrade of context The most frustrating part of this is that I RAN THIS, dammit, with the updated context and the current Wizard, and it finished the End-to-End tests without complaint. --- web/package-lock.json | 19 ++++++------------- web/package.json | 2 +- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/web/package-lock.json b/web/package-lock.json index e0d4725f8..b54982c22 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -18,7 +18,7 @@ "@formatjs/intl-listformat": "^7.5.0", "@fortawesome/fontawesome-free": "^6.4.2", "@goauthentik/api": "^2023.10.2-1698526374", - "@lit-labs/context": "^0.5.1", + "@lit-labs/context": "^0.4.0", "@lit-labs/task": "^3.1.0", "@lit/localize": "^0.11.4", "@open-wc/lit-helpers": "^0.6.0", @@ -3436,11 +3436,12 @@ } }, "node_modules/@lit-labs/context": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/@lit-labs/context/-/context-0.5.1.tgz", - "integrity": "sha512-ELR50iyIFb0mOTkzR7bSUamipLY8QzbiXzTElJr+fInBhUpUbe4bx7Z2ekPO+WbunQRB2Bc3z/V7lIPTN+tbVQ==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@lit-labs/context/-/context-0.4.1.tgz", + "integrity": "sha512-o+uKepgEPoYAVaPvSASoDiUWKdcf7neyhFcm9dvtiLgptKoINZD1vW7GbbH/2hPtxLxgcmVfZ9NDCXNDQeHTHQ==", "dependencies": { - "@lit/context": "^1.0.0" + "@lit/reactive-element": "^1.5.0", + "lit": "^2.7.0" } }, "node_modules/@lit-labs/ssr-dom-shim": { @@ -3456,14 +3457,6 @@ "@lit/task": "^1.0.0" } }, - "node_modules/@lit/context": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@lit/context/-/context-1.0.1.tgz", - "integrity": "sha512-ujQEV42vRjhNzCu/YNc+dy8eq48cEYO2SvEl7iCmMzt8X7ixUYcDt8DPV1UBr58FJ7EUe9vTLPv/0soAi9bfRw==", - "dependencies": { - "@lit/reactive-element": "^1.6.2 || ^2.0.0" - } - }, "node_modules/@lit/localize": { "version": "0.11.4", "resolved": "https://registry.npmjs.org/@lit/localize/-/localize-0.11.4.tgz", diff --git a/web/package.json b/web/package.json index 94dc45a3d..aad758618 100644 --- a/web/package.json +++ b/web/package.json @@ -39,7 +39,7 @@ "@formatjs/intl-listformat": "^7.5.0", "@fortawesome/fontawesome-free": "^6.4.2", "@goauthentik/api": "^2023.10.2-1698526374", - "@lit-labs/context": "^0.5.1", + "@lit-labs/context": "^0.4.0", "@lit-labs/task": "^3.1.0", "@lit/localize": "^0.11.4", "@open-wc/lit-helpers": "^0.6.0", From cc1c66aa13e43016670dcf50c5e9a524e3213f07 Mon Sep 17 00:00:00 2001 From: Ken Sternberg <133134217+kensternberg-authentik@users.noreply.github.com> Date: Tue, 7 Nov 2023 10:10:43 -0800 Subject: [PATCH 2/2] Web: bugfix: broken backchannel selector (#7480) * web: break circular dependency between AKElement & Interface. This commit changes the way the root node of the web application shell is discovered by child components, such that the base class shared by both no longer results in a circular dependency between the two models. I've run this in isolation and have seen no failures of discovery; the identity token exists as soon as the Interface is constructed and is found by every item on the page. * web: fix broken typescript references This built... and then it didn't? Anyway, the current fix is to provide type information the AkInterface for the data that consumers require. * web: rollback dependabot's upgrade of context The most frustrating part of this is that I RAN THIS, dammit, with the updated context and the current Wizard, and it finished the End-to-End tests without complaint. * web: bugfix: broken backchannel selector There were two bugs here, both of them introduced by me because I didn't understand the system well enough the first time through, and because I didn't test thoroughly enough. The first is that I was calling the wrong confirmation code; the resulting syntax survived because `confirm()` is actually a legitimate function call in the context of the DOM Window, a legacy survivor similar to `alert()` but with a yes/no return value. Bleah. The second is that the confirm code doesn't appear to pass back a dictionary with the `{ items: Array }` list, it passes back just the `items` as an Array. --- web/src/admin/applications/ApplicationForm.ts | 2 +- web/src/admin/applications/components/ak-backchannel-input.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/admin/applications/ApplicationForm.ts b/web/src/admin/applications/ApplicationForm.ts index 42489f9f3..3401b1d6d 100644 --- a/web/src/admin/applications/ApplicationForm.ts +++ b/web/src/admin/applications/ApplicationForm.ts @@ -116,7 +116,7 @@ export class ApplicationForm extends ModelForm { return app; } - handleConfirmBackchannelProviders({ items }: { items: Provider[] }) { + handleConfirmBackchannelProviders(items: Provider[]) { this.backchannelProviders = items; this.requestUpdate(); return Promise.resolve(); diff --git a/web/src/admin/applications/components/ak-backchannel-input.ts b/web/src/admin/applications/components/ak-backchannel-input.ts index 5150b16ca..06fccc32b 100644 --- a/web/src/admin/applications/components/ak-backchannel-input.ts +++ b/web/src/admin/applications/components/ak-backchannel-input.ts @@ -63,7 +63,7 @@ export class AkBackchannelProvidersInput extends AKElement { return html`
- +