refactor: harden outbound clients and generated media retrieval - #570
Merged
Conversation
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.
Summary
统一收敛身份源、Turnstile、Stripe、模型、MCP、Embedding、模型生成媒体等外部 HTTP 调用,建立清晰、可复用的基础设施适配器边界,并在不破坏现有上游兼容性的前提下应用一致的出站安全策略。
本次变更包括:
scheme + host + port,避免局部信任被其他请求复用。SSRF_ALLOWED_HOSTS或SSRF_ALLOWED_CIDRS时正常跟随;media.artifact_unavailable稳定错误码及中英文前端文案。Change type
Affected areas
Verification
GOCACHE=/private/tmp/deeix-chat-origin-compat-full-cache go test ./...GOCACHE=/private/tmp/deeix-chat-origin-compat-race-cache go test -race ./internal/infra/outboundhttp ./internal/infra/identityprovider ./internal/infra/llm ./internal/infra/mcp ./internal/infra/embedding ./internal/infra/mediaartifact ./internal/application/conversationGOCACHE=/private/tmp/deeix-chat-origin-compat-workspace-cache pnpm exec turbo run check --env-mode=looseGOCACHE=/private/tmp/deeix-chat-origin-compat-api-cache pnpm api:checkGOCACHE=/private/tmp/deeix-chat-origin-compat-build-cache go build -o /private/tmp/deeix-chat-origin-compat-check ./cmd/servergit diff --checkScreenshots, API examples, or logs
No layout changes requiring screenshots.
The frontend change is limited to the stable generated-media error code and its localized user-facing messages.
Automated coverage includes:
Configuration, migration, and compatibility notes
SSRF_ALLOWED_HOSTSandSSRF_ALLOWED_CIDRSconfiguration remains compatible.Documentation
Security and privacy
Checklist
.pycfiles,.envfiles, and local storage data are not committed.