Skip to content

fix: 기관 계층에 시스템 계층 계정 미제공 - #130

Merged
yessjun merged 1 commit into
mainfrom
fix/withhold-system-accounts-from-org-tier
Sep 16, 2026
Merged

yessjun merged 1 commit into
mainfrom
fix/withhold-system-accounts-from-org-tier

Conversation

@yessjun

@yessjun yessjun commented Sep 16, 2026

Copy link
Copy Markdown
Member

📝 작업내용

  • listUsers가 기관 계층 호출자에게 시스템 계층 계정을 제외, where 절에서 거르므로 총 건수와 페이지 경계가 행과 일치
  • 제외 대상 역할 집합을 리터럴이 아니라 UserRole.isSysTier()에서 도출, 시스템 역할이 늘어도 목록과 상세가 갈라지지 않음
  • getUser도 같은 경계에서 404, 목록에서 빼고 상세를 열어 두면 id 하나로 되돌아감
  • 403이 아니라 404인 이유는 타 기관 지정과 같은 마스킹
  • 연산과 스키마 무변화로 API 명세 버전 유지

⭐️ 검증

  • AdminUsersTest 5건과 ContractDriftTest 6건 통과, 생성 명세 무변화 확인
  • 변이 검증: 제외 조건을 무력화하면 systemTierAccountsAreWithheldFromTheOrgTiertotalElements 0 대신 1로 실패
  • 새 테스트는 role=SYS_ADMIN 조회의 총 건수가 0인지까지 확인하므로, 조회 후 거르는 구현으로는 미통과

💬 리뷰 포인트

  • 이 제외가 기관 스코프가 아니라 역할 경계라는 판단, 무스코프 조회 원칙 자체는 유지
  • 마스킹의 범위, 읽기 경로 한정이고 grantOrgRole은 지금도 403에 사유를 담아 답하며 그 동작은 SYS_ADMIN에게도 동일
  • 배포 순서, 이 변경이 콘솔보다 먼저 나가야 기관 계층 목록에 시스템 계정이 노출되지 않음

The account directory is the one admin read not narrowed by organisation, which
is what lets an administrator reach someone who has requested nothing. That
opening also hands the org tier every system account, and those are the accounts
it can do nothing with: grantOrgRole refuses a sys-tier target and the
account-state writes are SYS_ADMIN-only. An administrator should be able to act
on every account it is shown, so these are withheld (operator, 2026-09-16).

This is a role boundary, not an organisation one, and it leaves the unscoped
ruling standing. The list withholds them in the where clause rather than after
the fetch, so the count and the page boundaries agree with the rows; the set
comes from the enum rather than a literal, so a fourth system role cannot be
withheld from the detail while the list keeps handing it out. The detail answers
404 rather than 403, the masking an organisation outside the actor's already
gets, because an id that still opens the detail makes the exclusion decoration.

No operation and no schema change, so the contract version stands.
@yessjun
yessjun merged commit 1d1d9b6 into main Sep 16, 2026
1 check passed
@yessjun
yessjun deleted the fix/withhold-system-accounts-from-org-tier branch September 16, 2026 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant