Declare the upsert and restore actions as the operations they perform
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 15h 13m
- Merged PRs (30d)
- 368
Description
카탈로그(backend.ai mgr ops list)로 훑어 찾은 것. 선언한 operation이 실제 동작과 달라 권한 검사와 감사 기록이 어긋난다.
upsert를 UPDATE로 선언한 8건: upsert_domain_fair_share_weight, upsert_project_fair_share_weight, upsert_user_fair_share_weight와 각각의 bulk 3건, upsert_artifacts, upsert_deployment_policy. 서비스는 실제로 Upserter를 만들어 repository.upsert_\*를 부른다.
ActionOperationType.UPSERT.to_permission()은 CREATE | UPDATE를 요구하는데 UPDATE만 선언하면 UPDATE만 검사한다. CREATE 권한이 없는 호출자가 행을 새로 만들 수 있다.
restore_artifacts가 UPDATE로 선언돼 있다. delete_artifacts는 DELETE(소프트)이고 이 액션이 그 역전인데, actions/AGENTS.md는 update 모양으로 같은 전이를 하지 말라고 정한다 — 감사 행에 UPDATE로 남아 삭제가 흔적에서 사라진다. RESTORE를 선언하면 요구 권한은 SOFT_DELETE로 같고 기록만 restore가 된다.
할 일: 아홉 개 액션의 operation_type()을 실제 동작에 맞춘다. upsert 8건은 UPSERT, restore_artifacts는 RESTORE. 권한이 강해지므로 이 경로를 쓰는 역할이 CREATE를 갖고 있는지 확인한다.
JIRA Issue: BA-7434
Contributor guide
Research direction
Start with the nine actions named in the issue and their operation_type() declarations, using the backend.ai mgr ops list catalog to locate them; read actions/AGENTS.md for the transition guidance. Confirm the eight upsert actions declare UPSERT and restore_artifacts declares RESTORE, then verify the affected roles have the required CREATE permission and the audit operations match the intended actions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- authorization, backend, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100