feat(core): 견고성 quick-win — 기본 UA·OAuth state·원자적 토큰·버전 단일화#36
Merged
Conversation
감사(전수 논증)의 코어 인프라 약점 중 저비용·고가치 항목을 한 묶음으로 상환. - http: 식별용 기본 User-Agent(arcsolve/<version>)를 _request_raw/get_text 양 진입점에서 주입. UA 누락 시 403을 주는 API(NWS·Wikipedia)를 구조적으로 예방하고 서비스별 UA 하드코딩 drift를 제거. 호출자 UA가 항상 우선(서비스 override 유지). - oauth: state를 생성만 하고 버리던 것을 _state에 저장하고 exchange_code(code, state=?)에서 secrets.compare_digest로 대조(CSRF·인가코드 주입 방어). TokenStore.update를 tempfile+ os.replace 원자적 교체로 변경해 쓰기 중단 시 credentials.json 손상을 방지(0600 유지). 토큰 엔드포인트에도 기본 UA 전송. - cli(auth): redirect URL 전체 붙여넣기를 받아 code/state를 파싱(_parse_redirect) → state 검증이 실제로 동작하면서 기존 'code만 붙여넣기'도 후방호환. - pkg: 버전을 arcsolve/__init__.py 단일 출처로 통일(hatch dynamic version), pyproject 이중 기록 제거. 859 passed(신규 6) · ruff clean · runtime/dist 버전·기본 UA 정상 확인. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
무엇을 / 왜
감사의 코어 인프라 약점 중 저비용·고가치 항목을 한 묶음으로 상환. 코어 한 곳을 고쳐 전 서비스가 무료로 견고화되는 변경들이다.
변경
arcsolve/<version>)를 모든 요청에 주입. UA 누락 시 403을 주는 API(NWS·Wikipedia)를 구조적으로 예방하고 서비스별 UA 하드코딩 drift 제거. 호출자 UA가 항상 우선(서비스 override 유지).state를 생성만 하고 버리던 것을 저장·대조(CSRF·인가코드 주입 방어).exchange_code(code, state=?)+arcsolve auth가 redirect URL 전체 붙여넣기를 받아 code/state 파싱(후방호환). 토큰 저장을tempfile+os.replace원자적 교체로 변경(쓰기 중단 시 credentials.json 손상 방지, 0600 유지). 토큰 엔드포인트에도 기본 UA.arcsolve/__init__.py단일 출처로 통일(hatch dynamic version), pyproject 이중 기록 제거.검증
859 passed(신규 6) ·ruffclean · runtime/dist 버전·기본 UA 정상 확인.머지 순서
#35 머지 후 이 브랜치를 main에 리베이스하면 CHANGELOG-drift CI가 해소됩니다(이 PR은 조각만 추가).
🤖 Generated with Claude Code