forked from baron/baron-sso
액션 러너 캐시 정리
This commit is contained in:
@@ -14,13 +14,6 @@ import {
|
|||||||
import { useEffect, useRef, useState } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
import { useAuth } from "react-oidc-context";
|
import { useAuth } from "react-oidc-context";
|
||||||
import { NavLink, Outlet, useLocation, useNavigate } from "react-router-dom";
|
import { NavLink, Outlet, useLocation, useNavigate } from "react-router-dom";
|
||||||
import { fetchMe } from "../../features/auth/authApi";
|
|
||||||
import { t } from "../../lib/i18n";
|
|
||||||
import { resolveProfileRole } from "../../lib/role";
|
|
||||||
import {
|
|
||||||
shouldAttemptSlidingSessionRenew,
|
|
||||||
shouldAttemptUnlimitedSessionRenew,
|
|
||||||
} from "../../lib/sessionSliding";
|
|
||||||
import {
|
import {
|
||||||
applyShellTheme,
|
applyShellTheme,
|
||||||
buildShellProfileSummary,
|
buildShellProfileSummary,
|
||||||
@@ -30,6 +23,13 @@ import {
|
|||||||
shellLayoutClasses,
|
shellLayoutClasses,
|
||||||
writeShellSessionExpiryEnabled,
|
writeShellSessionExpiryEnabled,
|
||||||
} from "../../../../common/shell";
|
} from "../../../../common/shell";
|
||||||
|
import { fetchMe } from "../../features/auth/authApi";
|
||||||
|
import { t } from "../../lib/i18n";
|
||||||
|
import { resolveProfileRole } from "../../lib/role";
|
||||||
|
import {
|
||||||
|
shouldAttemptSlidingSessionRenew,
|
||||||
|
shouldAttemptUnlimitedSessionRenew,
|
||||||
|
} from "../../lib/sessionSliding";
|
||||||
import LanguageSelector from "../common/LanguageSelector";
|
import LanguageSelector from "../common/LanguageSelector";
|
||||||
import { Toaster } from "../ui/toaster";
|
import { Toaster } from "../ui/toaster";
|
||||||
|
|
||||||
|
|||||||
@@ -14,10 +14,10 @@ import { useEffect, useMemo, useState } from "react";
|
|||||||
import { useAuth } from "react-oidc-context";
|
import { useAuth } from "react-oidc-context";
|
||||||
import { Link, useNavigate } from "react-router-dom";
|
import { Link, useNavigate } from "react-router-dom";
|
||||||
import {
|
import {
|
||||||
sortItems,
|
|
||||||
toggleSort,
|
|
||||||
type SortConfig,
|
type SortConfig,
|
||||||
type SortResolverMap,
|
type SortResolverMap,
|
||||||
|
sortItems,
|
||||||
|
toggleSort,
|
||||||
} from "../../../../common/core/utils";
|
} from "../../../../common/core/utils";
|
||||||
import { ForbiddenMessage } from "../../components/common/ForbiddenMessage";
|
import { ForbiddenMessage } from "../../components/common/ForbiddenMessage";
|
||||||
import {
|
import {
|
||||||
@@ -47,12 +47,12 @@ import {
|
|||||||
} from "../../components/ui/table";
|
} from "../../components/ui/table";
|
||||||
import { Textarea } from "../../components/ui/textarea";
|
import { Textarea } from "../../components/ui/textarea";
|
||||||
import {
|
import {
|
||||||
|
type ClientSummary,
|
||||||
fetchClients,
|
fetchClients,
|
||||||
fetchDevStats,
|
fetchDevStats,
|
||||||
fetchDeveloperRequestStatus,
|
fetchDeveloperRequestStatus,
|
||||||
fetchMyTenants,
|
fetchMyTenants,
|
||||||
requestDeveloperAccess,
|
requestDeveloperAccess,
|
||||||
type ClientSummary,
|
|
||||||
} from "../../lib/devApi";
|
} from "../../lib/devApi";
|
||||||
import { t } from "../../lib/i18n";
|
import { t } from "../../lib/i18n";
|
||||||
import { resolveProfileRole } from "../../lib/role";
|
import { resolveProfileRole } from "../../lib/role";
|
||||||
|
|||||||
@@ -13,12 +13,12 @@ import { useAuth } from "react-oidc-context";
|
|||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import {
|
import {
|
||||||
type ClientSummary,
|
type ClientSummary,
|
||||||
fetchClients,
|
|
||||||
fetchDeveloperRequestStatus,
|
|
||||||
fetchDevRPUsageDaily,
|
|
||||||
fetchDevStats,
|
|
||||||
type RPUsageDailyMetric,
|
type RPUsageDailyMetric,
|
||||||
type RPUsagePeriod,
|
type RPUsagePeriod,
|
||||||
|
fetchClients,
|
||||||
|
fetchDevRPUsageDaily,
|
||||||
|
fetchDevStats,
|
||||||
|
fetchDeveloperRequestStatus,
|
||||||
} from "../../lib/devApi";
|
} from "../../lib/devApi";
|
||||||
import { t } from "../../lib/i18n";
|
import { t } from "../../lib/i18n";
|
||||||
import { resolveProfileRole } from "../../lib/role";
|
import { resolveProfileRole } from "../../lib/role";
|
||||||
|
|||||||
@@ -29,6 +29,13 @@ describe("devfront auth config", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("blocks browser PKCE login in an insecure context", () => {
|
it("blocks browser PKCE login in an insecure context", () => {
|
||||||
|
expect(
|
||||||
|
canStartBrowserPkceLogin({
|
||||||
|
isSecureContext: false,
|
||||||
|
origin: "http://localhost:5174",
|
||||||
|
cryptoSubtleAvailable: false,
|
||||||
|
}),
|
||||||
|
).toBe(false);
|
||||||
expect(
|
expect(
|
||||||
canStartBrowserPkceLogin({
|
canStartBrowserPkceLogin({
|
||||||
isSecureContext: false,
|
isSecureContext: false,
|
||||||
|
|||||||
@@ -9,31 +9,39 @@ test.describe("DevFront login", () => {
|
|||||||
configurable: true,
|
configurable: true,
|
||||||
value: false,
|
value: false,
|
||||||
});
|
});
|
||||||
|
Object.defineProperty(window.crypto, "subtle", {
|
||||||
|
configurable: true,
|
||||||
|
value: undefined,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
let authorizeRequested = false;
|
let authorizeRequested = false;
|
||||||
await page.route("**/oidc/.well-known/openid-configuration", async (route) => {
|
await page.route(
|
||||||
await route.fulfill({
|
"**/oidc/.well-known/openid-configuration",
|
||||||
json: {
|
async (route) => {
|
||||||
issuer: "http://localhost:5000/oidc",
|
await route.fulfill({
|
||||||
authorization_endpoint: "http://localhost:5000/oidc/oauth2/auth",
|
json: {
|
||||||
token_endpoint: "http://localhost:5000/oidc/oauth2/token",
|
issuer: "http://localhost:5000/oidc",
|
||||||
jwks_uri: "http://localhost:5000/oidc/.well-known/jwks.json",
|
authorization_endpoint: "http://localhost:5000/oidc/oauth2/auth",
|
||||||
},
|
token_endpoint: "http://localhost:5000/oidc/oauth2/token",
|
||||||
headers: { "Access-Control-Allow-Origin": "*" },
|
jwks_uri: "http://localhost:5000/oidc/.well-known/jwks.json",
|
||||||
});
|
},
|
||||||
});
|
headers: { "Access-Control-Allow-Origin": "*" },
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
await page.route("**/oidc/oauth2/auth**", async (route) => {
|
await page.route("**/oidc/oauth2/auth**", async (route) => {
|
||||||
authorizeRequested = true;
|
authorizeRequested = true;
|
||||||
await route.fulfill({ status: 500, body: "unexpected authorize request" });
|
await route.fulfill({
|
||||||
|
status: 500,
|
||||||
|
body: "unexpected authorize request",
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
await page.goto("/login");
|
await page.goto("/login");
|
||||||
await page.getByRole("button", { name: "SSO 계정으로 로그인" }).click();
|
await page.getByRole("button", { name: "SSO 계정으로 로그인" }).click();
|
||||||
|
|
||||||
await expect(page.getByRole("alert")).toContainText(
|
await expect(page.getByRole("alert")).toContainText("HTTPS 또는 localhost");
|
||||||
"HTTPS 또는 localhost",
|
|
||||||
);
|
|
||||||
expect(authorizeRequested).toBe(false);
|
expect(authorizeRequested).toBe(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user