feat: enhance passkey to support reverse proxy (trusted proxies config)#11935
feat: enhance passkey to support reverse proxy (trusted proxies config)#11935
Conversation
|
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Co-authored-by: wanghe-fit2cloud <46734380+wanghe-fit2cloud@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
建议用codex 的 review 功能 + AGENTS.md 索引指导,效果比较好。 github copilot 的 review 功能一言难尽。如果需要 review 是在其他人 pr 上 @ copilot 去 review。 这里他直接照抄我的东西了 :( |
Passkey previously required direct TLS termination at 1Panel. When running behind a reverse proxy, HTTPS was not detected, making passkey unusable even with a valid domain bound.
Changes
Backend (
core/app/service/auth.go)passkeyEnabled(); HTTPS detection now relies solely on request schemepasskeyRequestScheme()to honorForwarded/X-Forwarded-Protoheaders only when the request originates from a trusted proxy IP/CIDRloadPasskeyTrustedProxies()/parsePasskeyTrustedProxies()— readsPasskeyTrustedProxiessetting (default:127.0.0.1,::1)passkeyForwardedProto()andpasskeyXForwardedProto()parsersBackend (
core/app/api/v2/setting.go,core/app/dto/setting.go)PasskeyTrustedProxiesas a persisted setting with server-side IP/CIDR normalization and validation vianormalizePasskeyTrustedProxies()Frontend
updateSettingAPIbindDomainbeing set (not SSL status), matching the actual server-side requirementpasskeyKeyManagement,passkeyTrustedProxies,passkeyTrustedProxiesHelper; updatedpasskeyRequireSSLmessage🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.