-
{formatWorksmobilePersonName(row) || "-"}
-
- {row.worksmobileEmail ?? ""}
+
+ )}
+ {isColumnVisible("baronOrg") && (
+
+
+
+ )}
+ {isColumnVisible("worksmobileId") && (
+
+ {row.worksmobileId ?? "-"}
+
+ )}
+ {isColumnVisible("externalKey") && (
+
+ {row.externalKey ?? "-"}
+
+ )}
+ {isColumnVisible("worksmobileDomain") && (
+
+
+
+ )}
+ {isColumnVisible("worksmobile") && (
+
+
+
{formatWorksmobilePersonName(row) || "-"}
+
+ {row.worksmobileEmail ?? ""}
+
-
-
-
-
-
+
+ )}
+ {isColumnVisible("worksmobileOrg") && (
+
+
+
+ )}
+ {isColumnVisible("manage") && (
+
+ {row.resourceType === "USER" && (
+
+ )}
+
+ )}
))}
diff --git a/adminfront/src/lib/adminApi.ts b/adminfront/src/lib/adminApi.ts
index 8f0ee7a1..d1e4b245 100644
--- a/adminfront/src/lib/adminApi.ts
+++ b/adminfront/src/lib/adminApi.ts
@@ -508,7 +508,9 @@ export type WorksmobileOverview = {
tenant: TenantSummary;
config: {
enabled: boolean;
+ domainMappings?: Record
;
tokenConfigured: boolean;
+ adminTenantId?: string;
};
recentJobs: WorksmobileOutboxItem[];
};
diff --git a/adminfront/tests/tenants.spec.ts b/adminfront/tests/tenants.spec.ts
index 1847ce68..0a150c9b 100644
--- a/adminfront/tests/tenants.spec.ts
+++ b/adminfront/tests/tenants.spec.ts
@@ -57,6 +57,7 @@ test.describe("Tenants Management", () => {
});
test("should list tenants", async ({ page }) => {
+ await page.setViewportSize({ width: 900, height: 700 });
const internalTenantId = "c5839444-2de0-4a37-99b0-4f94d3de8bea";
await page.route("**/api/v1/admin/tenants**", async (route) => {
@@ -93,6 +94,15 @@ test.describe("Tenants Management", () => {
timeout: 10000,
});
await expect(page.locator("table")).toContainText(internalTenantId);
+ await expect(page.locator("table")).toContainText("COMPANY");
+ await expect(page.locator("table")).not.toContainText("일반 기업");
+
+ const headerWhiteSpace = await page
+ .locator("table thead th")
+ .evaluateAll((headers) =>
+ headers.map((header) => window.getComputedStyle(header).whiteSpace),
+ );
+ expect(headerWhiteSpace.every((value) => value === "nowrap")).toBe(true);
});
test("should create a new tenant", async ({ page }) => {
diff --git a/adminfront/tests/worksmobile.spec.ts b/adminfront/tests/worksmobile.spec.ts
index 0068391a..dd36795e 100644
--- a/adminfront/tests/worksmobile.spec.ts
+++ b/adminfront/tests/worksmobile.spec.ts
@@ -197,7 +197,7 @@ test.describe("Worksmobile tenant management", () => {
await expect(page.getByText("domainMappings")).not.toBeVisible();
await expect(page.getByText("SCIM token")).not.toBeVisible();
await expect(page.getByText("김누락")).toBeVisible();
- await expect(page.getByText("박웍스")).not.toBeVisible();
+ await expect(page.getByText("박웍스")).toBeVisible();
await expect(page.getByText("WORKS 전용 조직")).toBeVisible();
await expect(page.getByText("기술본부", { exact: true })).toBeVisible();
await expect(page.getByText("parent-tech", { exact: true })).toBeVisible();
@@ -208,47 +208,47 @@ test.describe("Worksmobile tenant management", () => {
const filterButtons = page
.getByRole("button", {
- name: /Baron에만 있음|WORKS에만 있음|양쪽에 다 있음/,
+ name: /바론에만 있음|웍스에만 있음|양쪽 다 있음/,
})
.allTextContents();
await expect.poll(() => filterButtons).toEqual([
- "Baron에만 있음",
- "WORKS에만 있음",
- "양쪽에 다 있음",
+ "바론에만 있음",
+ "웍스에만 있음",
+ "양쪽 다 있음",
]);
- await page.getByRole("button", { name: "WORKS에만 있음" }).click();
- await expect(page.getByText("박웍스")).toBeVisible();
+ await page.getByRole("button", { name: "웍스에만 있음" }).click();
+ await expect(page.getByText("박웍스")).not.toBeVisible();
await expect(page.getByText("김누락")).toBeVisible();
await expect(page.getByText("홍길동")).not.toBeVisible();
- await page.getByRole("button", { name: "양쪽에 다 있음" }).click();
+ await page.getByRole("button", { name: "양쪽 다 있음" }).click();
await expect(page.getByText("홍길동")).toHaveCount(2);
await expect(page.getByText("기술기획", { exact: true })).toBeVisible();
await expect(page.getByText("team-tech", { exact: true })).toBeVisible();
await expect(page.getByText("WORKS 기술기획")).toBeVisible();
await expect(page.getByText("works-team-tech")).toBeVisible();
await expect(page.getByText("김누락")).toBeVisible();
- await expect(page.getByText("박웍스")).toBeVisible();
+ await expect(page.getByText("박웍스")).not.toBeVisible();
- await page.getByRole("button", { name: "Baron에만 있음" }).click();
- await expect(page.getByText("홍길동")).toHaveCount(2);
- await expect(page.getByText("김누락")).not.toBeVisible();
- await expect(page.getByText("박웍스")).toBeVisible();
-
- await page.getByRole("button", { name: "WORKS에만 있음" }).click();
+ await page.getByRole("button", { name: "바론에만 있음" }).click();
await expect(page.getByText("홍길동")).toHaveCount(2);
await expect(page.getByText("김누락")).not.toBeVisible();
await expect(page.getByText("박웍스")).not.toBeVisible();
- await page.getByRole("button", { name: "양쪽에 다 있음" }).click();
+ await page.getByRole("button", { name: "웍스에만 있음" }).click();
+ await expect(page.getByText("홍길동")).toHaveCount(2);
+ await expect(page.getByText("김누락")).not.toBeVisible();
+ await expect(page.getByText("박웍스")).toBeVisible();
+
+ await page.getByRole("button", { name: "양쪽 다 있음" }).click();
+ await expect(page.getByText("김누락")).not.toBeVisible();
+ await expect(page.getByText("박웍스")).toBeVisible();
+ await expect(page.getByText("홍길동")).not.toBeVisible();
+
+ await page.getByRole("button", { name: "바론에만 있음" }).click();
await expect(page.getByText("김누락")).toBeVisible();
await expect(page.getByText("박웍스")).toBeVisible();
- await expect(page.getByText("홍길동")).toHaveCount(2);
-
- await page.getByRole("button", { name: "Baron에만 있음" }).click();
- await expect(page.getByText("김누락")).toBeVisible();
- await expect(page.getByText("박웍스")).not.toBeVisible();
await expect(page.getByText("홍길동")).not.toBeVisible();
await page
@@ -360,4 +360,148 @@ test.describe("Worksmobile tenant management", () => {
page.getByText(/WORKS API rejected user creation/),
).toBeVisible();
});
+
+ test("keeps wide comparison columns inside table scroll and blocks immutable WORKS accounts", async ({
+ page,
+ }) => {
+ await page.setViewportSize({ width: 900, height: 700 });
+
+ await page.route("**/api/v1/**", async (route) => {
+ const url = new URL(route.request().url());
+ const method = route.request().method();
+ const headers = { "Access-Control-Allow-Origin": "*" };
+
+ if (url.pathname.endsWith("/user/me")) {
+ return route.fulfill({
+ json: { id: "admin-user", name: "Admin", role: "super_admin" },
+ headers,
+ });
+ }
+
+ if (
+ url.pathname.endsWith("/admin/tenants/hanmac-family-id") &&
+ method === "GET"
+ ) {
+ return route.fulfill({
+ json: {
+ id: "hanmac-family-id",
+ name: "한맥 가족",
+ slug: "hanmac-family",
+ parentId: null,
+ },
+ headers,
+ });
+ }
+
+ if (
+ url.pathname.endsWith("/admin/tenants/hanmac-family-id/worksmobile") &&
+ method === "GET"
+ ) {
+ return route.fulfill({
+ json: {
+ tenant: {
+ id: "hanmac-family-id",
+ name: "한맥 가족",
+ slug: "hanmac-family",
+ parentId: null,
+ },
+ config: {
+ adminTenantId: "works-tenant-1",
+ },
+ recentJobs: [],
+ },
+ headers,
+ });
+ }
+
+ if (
+ url.pathname.endsWith(
+ "/admin/tenants/hanmac-family-id/worksmobile/comparison",
+ ) &&
+ method === "GET"
+ ) {
+ return route.fulfill({
+ json: {
+ users: [
+ {
+ resourceType: "USER",
+ worksmobileId:
+ "works-user-with-extra-long-identifier-for-scroll-check",
+ externalKey: "external-key-with-extra-long-identifier",
+ worksmobileName: "긴 WORKS 사용자",
+ worksmobileEmail:
+ "long-works-user-name-for-scroll@samaneng.com",
+ worksmobileDomainId: 300285955,
+ worksmobileDomainName: "samaneng.com",
+ worksmobilePrimaryOrgId:
+ "works-primary-org-with-extra-long-identifier",
+ worksmobilePrimaryOrgName: "긴 WORKS 조직",
+ status: "missing_in_baron",
+ },
+ {
+ resourceType: "USER",
+ worksmobileId: "works-cyhan",
+ worksmobileName: "변경 불가 계정",
+ worksmobileEmail: "cyhan@samaneng.com",
+ worksmobileDomainId: 300285955,
+ worksmobileDomainName: "samaneng.com",
+ status: "missing_in_baron",
+ },
+ ],
+ groups: [],
+ },
+ headers,
+ });
+ }
+
+ return route.fulfill({ json: { items: [], total: 0 }, headers });
+ });
+
+ await page.goto("/tenants/hanmac-family-id/worksmobile");
+ await expect(page.getByText("긴 WORKS 사용자")).toBeVisible();
+
+ const userColumnButton = page
+ .getByRole("heading", { name: "구성원" })
+ .locator("xpath=ancestor::div[contains(@class, 'space-y-2')][1]")
+ .getByRole("button", { name: "컬럼 설정" });
+ await userColumnButton.click();
+
+ const dialog = page.getByRole("dialog", { name: "구성원 컬럼 설정" });
+ await dialog.getByLabel("Baron ID").check();
+ await dialog.getByLabel("WORKS ID").check();
+ await dialog.getByLabel("external_key").check();
+ await dialog.getByRole("button", { name: "닫기" }).click();
+
+ const pageOverflow = await page.evaluate(() => ({
+ documentScrollWidth: document.documentElement.scrollWidth,
+ bodyScrollWidth: document.body.scrollWidth,
+ viewportWidth: document.documentElement.clientWidth,
+ }));
+ expect(
+ Math.max(pageOverflow.documentScrollWidth, pageOverflow.bodyScrollWidth),
+ ).toBeLessThanOrEqual(pageOverflow.viewportWidth + 1);
+
+ const userTableScroll = await page.locator("table").first().evaluate(
+ (table) => {
+ const container = table.parentElement?.parentElement as HTMLElement;
+ return {
+ clientWidth: container.clientWidth,
+ overflowX: window.getComputedStyle(container).overflowX,
+ scrollWidth: container.scrollWidth,
+ };
+ },
+ );
+ expect(userTableScroll.overflowX).toBe("auto");
+ expect(userTableScroll.scrollWidth).toBeGreaterThan(
+ userTableScroll.clientWidth,
+ );
+
+ const immutableRow = page.getByRole("row", {
+ name: /cyhan@samaneng\.com/,
+ });
+ await expect(immutableRow.getByRole("checkbox")).toBeDisabled();
+ await expect(
+ immutableRow.getByRole("button", { name: /비밀번호 관리/ }),
+ ).toBeDisabled();
+ });
});
diff --git a/backend/internal/service/worksmobile_sync_service.go b/backend/internal/service/worksmobile_sync_service.go
index 6b77ec12..a2f495da 100644
--- a/backend/internal/service/worksmobile_sync_service.go
+++ b/backend/internal/service/worksmobile_sync_service.go
@@ -33,6 +33,7 @@ type WorksmobileConfigSummary struct {
Enabled bool `json:"enabled"`
DomainMappings map[string]int64 `json:"domainMappings"`
TokenConfigured bool `json:"tokenConfigured"`
+ AdminTenantID string `json:"adminTenantId,omitempty"`
}
type WorksmobileTenantOverview struct {
@@ -115,6 +116,7 @@ func (s *worksmobileSyncService) GetTenantOverview(ctx context.Context, tenantID
Enabled: WorksmobileEnabled(tenant.Config),
DomainMappings: WorksmobileDomainMappings(tenant.Config),
TokenConfigured: worksmobileDirectoryAuthConfigured(),
+ AdminTenantID: strings.TrimSpace(os.Getenv("WORKS_ADMIN_TENANT_ID")),
},
RecentJobs: jobs,
}, nil
diff --git a/backend/internal/service/worksmobile_sync_service_test.go b/backend/internal/service/worksmobile_sync_service_test.go
index d2c9e1b5..4f3fe8e6 100644
--- a/backend/internal/service/worksmobile_sync_service_test.go
+++ b/backend/internal/service/worksmobile_sync_service_test.go
@@ -56,6 +56,26 @@ func TestWorksmobileSyncServiceRejectsAliasLocalPartAlreadyUsedByOtherUser(t *te
require.Empty(t, outboxRepo.created)
}
+func TestWorksmobileSyncServiceOverviewExposesAdminTenantIDForPasswordManageLink(t *testing.T) {
+ t.Setenv("WORKS_ADMIN_TENANT_ID", "works-tenant-1")
+ root := domain.Tenant{
+ ID: "root-tenant",
+ Slug: HanmacFamilyTenantSlug,
+ Name: "한맥가족",
+ }
+ service := NewWorksmobileSyncService(
+ &fakeWorksmobileTenantService{tenants: map[string]domain.Tenant{root.ID: root}},
+ &fakeWorksmobileUserRepo{},
+ &fakeWorksmobileOutboxRepo{},
+ nil,
+ )
+
+ overview, err := service.GetTenantOverview(context.Background(), root.ID)
+
+ require.NoError(t, err)
+ require.Equal(t, "works-tenant-1", overview.Config.AdminTenantID)
+}
+
func TestCompareWorksmobileGroupsUsesOrganizationsAndBarongroupChildCompanies(t *testing.T) {
parentID := "root-tenant"
root := domain.Tenant{
diff --git a/docs/worksmobile-directory-sync-technical-review.md b/docs/worksmobile-directory-sync-technical-review.md
index 07679c5a..76849f3d 100644
--- a/docs/worksmobile-directory-sync-technical-review.md
+++ b/docs/worksmobile-directory-sync-technical-review.md
@@ -192,6 +192,25 @@ Worksmobile 구성원 수정 API에는 PUT(`user-update-put`)과 PATCH(`user-upd
- 기존 WORKS Mobile 구성원에 대한 일반 속성/조직/겸직 동기화는 생성 효율을 위해 먼저 `POST /v1.0/users`를 시도하고, `409 Conflict`일 때 `PATCH /v1.0/users/{email}`로 전환합니다.
- PUT은 전체 교체 성격이 강하고 누락 필드 초기화 위험이 있으므로 현 scope에서는 사용하지 않습니다. 모든 Baron -> WORKS 변경 반영은 부분 수정 PATCH를 우선합니다.
+### 구성원 비밀번호 관리 링크
+
+Baron SSO는 생성 이후 WORKS Mobile 비밀번호 값을 직접 수정하지 않습니다. 운영자가 비밀번호 수정을 요청할 때는 해당 WORKS 계정의 식별자를 이용해 WORKS Mobile 관리자 비밀번호 관리 화면을 새 창으로 엽니다.
+
+사용 URL:
+
+```text
+https://auth.worksmobile.com/integrate/password/manage?usage=admin&targetUserTenantId={회사테넌트}&targetUserDomainId={회사도메인}&targetUserIdNo={변경대상works_USER_ID}&accessUrl=https://admin.worksmobile.com/assets/self-close.html
+```
+
+전제와 기준:
+
+- 브라우저 사용자는 `auth.worksmobile.com`에 관리자 권한으로 로그인되어 있어야 합니다.
+- `targetUserTenantId`는 Baron tenant UUID가 아니라 WORKS Mobile 회사 tenant 식별자입니다. Baron SSO backend는 `WORKS_ADMIN_TENANT_ID` 환경 변수로 이 값을 adminfront overview에 노출합니다.
+- `targetUserDomainId`는 WORKS Mobile 비교 결과의 `worksmobileDomainId`를 사용합니다.
+- `targetUserIdNo`는 WORKS Mobile 비교 결과의 `worksmobileId`를 사용합니다.
+- adminfront는 세 값이 모두 있을 때만 비밀번호 관리 버튼을 활성화합니다.
+- 이 링크는 WORKS Mobile 관리자 화면을 여는 기능이며, Baron SSO backend에서 password 또는 `passwordConfig` 변경 API를 호출하지 않습니다.
+
## 비동기 아키텍처 권장안
Worksmobile API를 handler에서 직접 호출하지 않고, 별도 outbox와 relay worker를 둡니다.