허가 없는 대상에는 헤드리스를 열지 않는다 - #31
Merged
Merged
Conversation
- 요청에 headlessAllowed 를 받아, false 면 헤드리스 진입 3경로(직행·차단 승격·불완전 승격)를 한 가드로 전부 닫고 plain 만 돈다. product.extract.headless.enabled 스위치와 AND - 둘 다 서야 헤드리스가 열린다. - 누락·null 은 false(허가 없음)로 정규화하는 fail-safe. 이 필드를 모르는 구버전 호출자의 요청은 헤드리스를 열지 않아, 배포 순서와 무관하게 안전한 쪽으로만 어긋난다. - headlessFirst 도 headlessAllowed 가 false 면 함께 무시된다(허가가 라우팅보다 앞선다). - 계약 문서(api-contract.md)와 컨트롤러 원장 로그에 headlessAllowed 를 반영. 허가는 성능 최적화가 아니라 계약이다.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthrough
ChangesHeadless 사용 허가
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ExtractionController
participant LinkExtractionRequest
participant ProductLinkExtractor
participant FallbackProductLinkExtractor
participant PlainExtractor
participant HeadlessExtractor
ExtractionController->>LinkExtractionRequest: headlessAllowed 요청값 전달
LinkExtractionRequest-->>ExtractionController: null 또는 누락값을 false로 정규화
ExtractionController->>ProductLinkExtractor: 정규화된 허가값 전달
ProductLinkExtractor->>FallbackProductLinkExtractor: headlessFirst와 headlessAllowed 전달
alt 운영 설정과 요청 허가가 모두 활성화됨
FallbackProductLinkExtractor->>HeadlessExtractor: headless 직행 또는 승격 추출
else 허가가 없거나 운영 설정이 비활성화됨
FallbackProductLinkExtractor->>PlainExtractor: plain 추출만 실행
end
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Situation
headlessFirst)·차단 승격·불완전 승격 세 경로다. 지금까지 이 경로는 "비싸고 느리니 필요할 때만" 이라는 최적화로만 게이트됐고, "이 대상에 브라우저를 써도 되는가" 라는 허가는 없었다.Task
Action
headlessAllowed를 받는다. false 면 헤드리스 진입 3경로를 한 가드로 전부 닫고 plain 만 돈다.product.extract.headless.enabled스위치와 AND 로 묶는다. 둘의 역할이 다르다:product.extract.headless.enabledheadlessAllowedfalse(허가 없음)로 떨어진다(LinkExtractionRequest). 이 필드를 모르는 구버전 호출자의 요청은 헤드리스를 열지 않아, 배포 순서와 무관하게 안전한 쪽으로만 어긋난다.headlessFirst(직행 힌트)도headlessAllowed가 false 면 함께 무시된다.docs/api-contract.md(계약의 단일 진실)에headlessAllowed항목과 §0 원칙을 더하고, 컨트롤러 원장 로그에 값을 남긴다(허가 없는 대상이 브라우저로 갔는지 사후에 되짚는 근거).Result
headlessAllowed=false면 어떤 실패 분류로도 헤드리스를 타지 않는다.enabled는 켜졌지만headlessAllowed=false인 요청이 헤드리스 세 경로 어디로도 안 가고 plain 만 타는지를 각 경로별로 단언했다(가드를 임시로 풀면 FAIL 하는 negative control).연관 이슈
Summary by CodeRabbit
null이면 기본적으로 헤드리스 처리가 비활성화됩니다.