chore: write 스코프가 read 를 암시하도록 (#44 준비) #45
No reviewers
Labels
No labels
api
bug
chore
collector
decision-needed
docs
enhancement
feature
feedback-loop
frontend
infra
skill
test
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
xhh/financial-data-platform!45
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "chore/scope-write-implies-read"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
현재
require_scope는 순수 집합 포함 검사라write단독 키가require_scope("read")를 통과 못 함. 조회 엔드포인트에 read 스코프 검사가 없어서 실질 피해는 없지만, #44 Streamlit 대시보드가 write 키 1장으로 조회+트리거를 모두 커버하려면 계층 관계를 명시적으로 잡아두는 편이 낫다._SCOPE_IMPLIES = {"write": {"read"}}상수 도입_expand_scopes()헬퍼로 콤마 파싱 + 암시 전파Test plan
기존 `require_scope` 는 순수 집합 포함 검사. `write` 단독 키는 `require_scope("read")` 를 통과 못 한다. 현재 조회 엔드포인트가 스코프 검사를 안 걸어서 실질 피해는 없지만, 명시적으로 계층을 잡아두어야 Streamlit 대시보드(#44)가 write 키 1장으로 조회+트리거 둘 다 쓸 수 있음이 보장된다. - `_SCOPE_IMPLIES = {"write": {"read"}}` 상수로 암시 관계 선언 - `_expand_scopes(raw)` 헬퍼가 콤마 파싱 + 암시 전파 - `require_scope` 는 확장된 granted set 에서 검사 - tests/api/test_scope.py 7 케이스: - read 단독 / write 만 / 둘 다 / 공백·None 파싱 - write 키가 require_scope("read") 통과 - read 단독 키는 require_scope("write") 에서 403 - AUTH_DISABLED (api_key=None) 는 모든 스코프 통과 68 tests pass (61 → 68). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>