Update dependency oidc-client-ts to v3 (#12223)

* Mock subtle crypto in OIDC test

To unblock upgrade to oidc-client-ts

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update dependency oidc-client-ts to v3

* delint

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Ensure oidc-client-ts 3.0.1 to drop crypto-js

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
renovate[bot] 2024-02-19 16:58:59 +00:00 committed by GitHub
parent 618462ba06
commit 300f30eca9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 31 additions and 22 deletions

View file

@ -19,6 +19,8 @@ import { completeAuthorizationCodeGrant } from "matrix-js-sdk/src/oidc/authorize
import * as randomStringUtils from "matrix-js-sdk/src/randomstring";
import { BearerTokenResponse } from "matrix-js-sdk/src/oidc/validate";
import { mocked } from "jest-mock";
import { Crypto } from "@peculiar/webcrypto";
import { getRandomValues } from "node:crypto";
import { completeOidcLogin, startOidcLogin } from "../../../src/utils/oidc/authorize";
import { makeDelegatedAuthConfig } from "../../test-utils/oidc";
@ -32,6 +34,8 @@ jest.mock("matrix-js-sdk/src/oidc/authorize", () => ({
completeAuthorizationCodeGrant: jest.fn(),
}));
const webCrypto = new Crypto();
describe("OIDC authorization", () => {
const issuer = "https://auth.com/";
const homeserverUrl = "https://matrix.org";
@ -55,6 +59,13 @@ describe("OIDC authorization", () => {
jest.spyOn(randomStringUtils, "randomString").mockRestore();
mockPlatformPeg();
Object.defineProperty(window, "crypto", {
value: {
getRandomValues,
randomUUID: jest.fn().mockReturnValue("not-random-uuid"),
subtle: webCrypto.subtle,
},
});
});
beforeAll(() => {