Skip to content

[refactor] UID/GID 관리 권한을 config-server로 이전 - WAS에서 uid 완전 제거 #213

@yoon6yo

Description

@yoon6yo

배경

현재 WAS DB(used_ids 테이블)와 passwd 파일이 동기화 없이 독립 운영되어 UID 충돌이 발생하고 있습니다.

uid 10009: kwdahun, test0403 동시 존재
uid 10007: test2010, test2100 동시 존재
uid 10000: 7개 계정 동시 존재

해결 방안

config-server가 UID/primary GID를 단독 관리하고, WAS는 uid를 완전히 알지 않는 구조로 변경합니다.

변경 범위

삭제

  • UsedId entity / UsedIdRepository
  • CounterKey.UID
  • IdAllocationService.allocateFor(), allocateNewUid(), findReusableUidByUbuntuUsername(), releaseId(), AllocationResult
  • Request.ubuntuUid 필드 및 assignUbuntuUid() 메서드
  • RequestRepository.findTopByUbuntuUsernameAndUbuntuUidIsNotNullOrderByApprovedAtDesc
  • used_ids 테이블 (DB migration 필요)

수정

  • UserCreationRequestDTOuid, gid 필드 제거
  • AdminRequestCommandServiceidAllocationService.allocateFor() 및 uid/primary group 관련 로직 제거
  • RequestExpiryServicereleaseId() 호출 제거
  • GroupusedId FK 필드 제거
  • AcceptInfoResponseDTOuid 필드 제거
  • SaveRequestResponseDTOubuntuUid 필드 제거
  • IdAllocationService.allocateNewGid()usedIdRepository 의존성 제거

DB 마이그레이션 주의사항

  1. requests.ubuntuUid 컬럼 FK 제약 해제 후 컬럼 삭제
  2. groups.ubuntu_gidused_ids.id_value FK 제약 해제
  3. used_ids 테이블 DROP
  4. id_counter 테이블의 UID row 삭제

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions