forked from baron/baron-sso
tenants 명칭 및 profile 전화번호 추가
This commit is contained in:
@@ -91,22 +91,22 @@ function makeClientDetail(
|
||||
if (includeTenantScope) {
|
||||
structuredScopes.push({
|
||||
id: "2",
|
||||
name: "tenant",
|
||||
name: "tenants",
|
||||
description: "Tenant access",
|
||||
mandatory: tenantScopeMandatory,
|
||||
locked: tenantAccessRestricted,
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
client: {
|
||||
return {
|
||||
client: {
|
||||
id: "client-claims",
|
||||
name: "Claims App",
|
||||
type: "private",
|
||||
status: "active",
|
||||
redirectUris: ["https://rp.example.com/callback"],
|
||||
scopes: includeTenantScope
|
||||
? ["openid", "tenant", "profile"]
|
||||
? ["openid", "tenants", "profile"]
|
||||
: ["openid", "profile"],
|
||||
tokenEndpointAuthMethod: "client_secret_basic",
|
||||
metadata: {
|
||||
@@ -334,7 +334,7 @@ describe("ClientGeneralPage RP claims", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("preserves tenant scope mandatory state when tenant access restriction is off", async () => {
|
||||
it("preserves tenants scope mandatory state when tenant access restriction is off", async () => {
|
||||
fetchClientMock.mockResolvedValue(
|
||||
makeClientDetail("old_claim", {
|
||||
includeTenantScope: true,
|
||||
@@ -354,8 +354,8 @@ describe("ClientGeneralPage RP claims", () => {
|
||||
|
||||
const tenantScopeRow = Array.from(container.querySelectorAll("tr")).find(
|
||||
(row) =>
|
||||
Array.from(row.querySelectorAll("input")).some(
|
||||
(input) => (input as HTMLInputElement).value === "tenant",
|
||||
Array.from(row.querySelectorAll("input")).some(
|
||||
(input) => (input as HTMLInputElement).value === "tenants",
|
||||
),
|
||||
);
|
||||
|
||||
@@ -389,11 +389,11 @@ describe("ClientGeneralPage RP claims", () => {
|
||||
expect(updateClientMock).toHaveBeenCalledWith(
|
||||
"client-claims",
|
||||
expect.objectContaining({
|
||||
metadata: expect.objectContaining({
|
||||
tenant_access_restricted: false,
|
||||
structured_scopes: expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
name: "tenant",
|
||||
metadata: expect.objectContaining({
|
||||
tenant_access_restricted: false,
|
||||
structured_scopes: expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
name: "tenants",
|
||||
mandatory: false,
|
||||
locked: false,
|
||||
}),
|
||||
|
||||
@@ -650,8 +650,8 @@ function ClientGeneralPage() {
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
name: "tenant",
|
||||
description: t("msg.dev.clients.scopes.tenant", "소속 테넌트 정보 접근"),
|
||||
name: "tenants",
|
||||
description: t("msg.dev.clients.scopes.tenants", "소속 테넌트 정보 접근"),
|
||||
mandatory: false,
|
||||
},
|
||||
{
|
||||
@@ -675,14 +675,14 @@ function ClientGeneralPage() {
|
||||
);
|
||||
|
||||
const tenantScopeDescription = t(
|
||||
"msg.dev.clients.scopes.tenant",
|
||||
"msg.dev.clients.scopes.tenants",
|
||||
"소속 테넌트 정보 접근",
|
||||
);
|
||||
|
||||
const buildTenantScope = useCallback(
|
||||
(id: string): ScopeItem => ({
|
||||
id,
|
||||
name: "tenant",
|
||||
name: "tenants",
|
||||
description: tenantScopeDescription,
|
||||
mandatory: true,
|
||||
locked: true,
|
||||
@@ -693,12 +693,15 @@ function ClientGeneralPage() {
|
||||
const normalizeScopesForTenantAccess = useCallback(
|
||||
(nextScopes: ScopeItem[], restricted: boolean): ScopeItem[] => {
|
||||
const normalized = nextScopes.map((scope) => {
|
||||
if (scope.name.trim() !== "tenant") {
|
||||
const scopeName = scope.name.trim();
|
||||
if (scopeName !== "tenants" && scopeName !== "tenant") {
|
||||
return scope;
|
||||
}
|
||||
const canonicalName = "tenants";
|
||||
if (restricted) {
|
||||
return {
|
||||
...scope,
|
||||
name: canonicalName,
|
||||
description: scope.description || tenantScopeDescription,
|
||||
mandatory: true,
|
||||
locked: true,
|
||||
@@ -706,6 +709,7 @@ function ClientGeneralPage() {
|
||||
}
|
||||
return {
|
||||
...scope,
|
||||
name: canonicalName,
|
||||
description: scope.description || tenantScopeDescription,
|
||||
locked: false,
|
||||
};
|
||||
@@ -713,20 +717,23 @@ function ClientGeneralPage() {
|
||||
|
||||
if (
|
||||
restricted &&
|
||||
!normalized.some((scope) => scope.name.trim() === "tenant")
|
||||
!normalized.some(
|
||||
(scope) => scope.name.trim() === "tenants" || scope.name.trim() === "tenant",
|
||||
)
|
||||
) {
|
||||
normalized.push(buildTenantScope(`tenant-${Date.now()}`));
|
||||
normalized.push(buildTenantScope(`tenants-${Date.now()}`));
|
||||
}
|
||||
|
||||
const openidScopes = normalized.filter(
|
||||
(scope) => scope.name.trim() === "openid",
|
||||
);
|
||||
const tenantScopes = normalized.filter(
|
||||
(scope) => scope.name.trim() === "tenant",
|
||||
(scope) =>
|
||||
scope.name.trim() === "tenants" || scope.name.trim() === "tenant",
|
||||
);
|
||||
const remainingScopes = normalized.filter((scope) => {
|
||||
const name = scope.name.trim();
|
||||
return name !== "openid" && name !== "tenant";
|
||||
return name !== "openid" && name !== "tenants" && name !== "tenant";
|
||||
});
|
||||
|
||||
return [...openidScopes, ...tenantScopes, ...remainingScopes];
|
||||
@@ -762,7 +769,7 @@ function ClientGeneralPage() {
|
||||
},
|
||||
{
|
||||
id: "standard-tenant",
|
||||
name: "tenant",
|
||||
name: "tenants",
|
||||
description: tenantScopeDescription,
|
||||
source: "standard",
|
||||
},
|
||||
@@ -2389,7 +2396,7 @@ function ClientGeneralPage() {
|
||||
<p className="leading-relaxed">
|
||||
{t(
|
||||
"ui.dev.clients.general.tenant_access.hint",
|
||||
"제한을 켜면 tenant 스코프가 자동으로 포함되며, 허용 테넌트를 하나 이상 선택해야 합니다.",
|
||||
"제한을 켜면 tenants 스코프가 자동으로 포함되며, 허용 테넌트를 하나 이상 선택해야 합니다.",
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -518,6 +518,8 @@ description = "Manage OIDC applications, authentication methods, redirect URIs,
|
||||
email = "Email"
|
||||
openid = "Openid"
|
||||
profile = "Profile"
|
||||
tenant = "Tenant access"
|
||||
tenants = "Tenants access"
|
||||
|
||||
[msg.dev.dashboard]
|
||||
access_denied = "The dashboard is available only to users with developer access."
|
||||
@@ -1622,7 +1624,7 @@ description = "Scope Description"
|
||||
mandatory = "Mandatory"
|
||||
name = "Scope Name"
|
||||
delete = "Delete"
|
||||
tenant = "Tenant"
|
||||
tenants = "Tenants"
|
||||
|
||||
[ui.dev.clients.general.tenant_access]
|
||||
title = "Tenant access restriction"
|
||||
@@ -1633,7 +1635,7 @@ search_placeholder = "Search by tenant name or slug"
|
||||
selected_title = "Allowed tenants"
|
||||
selected_empty = "No tenants selected yet."
|
||||
empty = "No tenants match your search."
|
||||
hint = "Turning this on adds the tenant scope automatically and requires at least one allowed tenant."
|
||||
hint = "Turning this on adds the tenants scope automatically and requires at least one allowed tenant."
|
||||
autocomplete_hint = "Type a tenant name to see autocomplete suggestions. Click one to add it to the allowed list."
|
||||
validation_required = "Select at least one allowed tenant when tenant access restriction is enabled."
|
||||
picker_title = "Select tenant"
|
||||
|
||||
@@ -518,6 +518,8 @@ description = "OIDC 앱, 인증 방식, 리다이렉트 URI, 비밀키 재발행
|
||||
email = "이메일 주소 접근"
|
||||
openid = "OIDC 인증 필수 스코프"
|
||||
profile = "기본 프로필 정보 접근"
|
||||
tenant = "테넌트 접근"
|
||||
tenants = "테넌트 접근"
|
||||
|
||||
[msg.dev.dashboard]
|
||||
access_denied = "대시보드는 개발자 권한이 있어야 볼 수 있습니다."
|
||||
@@ -1621,7 +1623,7 @@ description = "설명"
|
||||
mandatory = "필수"
|
||||
name = "스코프 이름"
|
||||
delete = "삭제"
|
||||
tenant = "테넌트"
|
||||
tenants = "테넌트들"
|
||||
|
||||
[ui.dev.clients.general.tenant_access]
|
||||
title = "테넌트 접근 제한"
|
||||
@@ -1632,7 +1634,7 @@ search_placeholder = "테넌트 이름 또는 슬러그로 검색"
|
||||
selected_title = "허용 테넌트"
|
||||
selected_empty = "아직 선택된 테넌트가 없습니다."
|
||||
empty = "검색 결과가 없습니다."
|
||||
hint = "제한을 켜면 tenant 스코프가 자동으로 포함되며, 허용 테넌트를 하나 이상 선택해야 합니다."
|
||||
hint = "제한을 켜면 tenants 스코프가 자동으로 포함되며, 허용 테넌트를 하나 이상 선택해야 합니다."
|
||||
autocomplete_hint = "테넌트 이름을 입력하면 자동 완성 후보가 나타납니다. 클릭하면 허용 목록에 추가됩니다."
|
||||
validation_required = "테넌트 접근 제한을 사용할 경우 허용 테넌트를 하나 이상 선택해야 합니다."
|
||||
picker_title = "테넌트 선택"
|
||||
|
||||
Reference in New Issue
Block a user