Repository navigation
Conversation
Go 구현을 hyper/tokio 기반 Rust로 옮긴다. 외부에서 관찰되는 동작은 Go 버전과 동일하게 유지한다. - net/url, net/http(리다이렉트·ServeMux 경로 정리), encoding/json, yaml.v3의 동작을 바이트 단위로 재현 (gocompat, gojson, config) - 동일 설정으로 Go/Rust 서버에 비정상 입력 포함 119개 요청을 보내 상태줄·헤더·본문이 모두 일치함을 확인 - 처리량: /search 약 1.45배, /suggest 약 3.2배 (2코어, 동시 64) - 로그는 tracing JSON으로 변경 (필드명 유지) - Dockerfile, CI, pre-commit 훅을 cargo 기반으로 변경 BANGS_AUTH_KEYS를 설정하면 /, /search, /suggest, /opensearch.xml에 key 쿼리 파라미터를 요구한다. 키가 없거나 틀리면 404를 반환하고, /health와 /favicon.ico는 열어둔다. /?key=...로 등록하면 OpenSearch 템플릿에 키가 포함되어 Firefox가 자동으로 키를 보낸다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
요약
Go 구현을 Rust(hyper/tokio)로 포팅하고, Cloudflare Access 대신 쓸 수 있는 쿼리 키 인증을 추가합니다.
Rust 포팅
외부에서 관찰되는 동작은 Go 버전과 동일하게 유지했습니다.
net/url: 쿼리 파싱, 이스케이프, URL 검증net/http: 리다이렉트 본문,ServeMux경로 정리(307), Host 검증encoding/json,yaml.v3: 디코딩·인코딩 규칙동일성 검증
같은 설정으로 Go/Rust 서버를 나란히 띄우고 119개 요청을 보내 상태줄·헤더·본문을 비교했고, 모두 일치했습니다.
OPTIONS *, Host 누락, 1만 개 초과 파라미터성능 (CPU 2코어, 동시 연결 64)
/search/suggest/health달라진 점
tracingJSON으로 변경. 필드명은 유지했지만time→timestamp,info→INFO로 바뀜쿼리 키 인증
BANGS_AUTH_KEYS(쉼표 구분)를 설정하면/,/search,/suggest,/opensearch.xml에key쿼리 파라미터를 요구/health,/favicon.ico는 열어 둠/?key=...로 접속해 검색엔진을 등록하면 OpenSearch 템플릿에 키가 포함됨테스트 계획
cargo fmt --check,cargo clippy -D warnings,cargo test(73개)🤖 Generated with Claude Code