fix(auth): combine trusted permission resolvers with UI-only hints - #211
Merged
Conversation
This was referenced Aug 5, 2026
Deploying svadmin-example with
|
| Latest commit: |
de30f7c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1c092e71.svadmin-example.pages.dev |
| Branch Preview URL: | https://codex-auth-permissions-harde.svadmin-example.pages.dev |
Deploying svadmin with
|
| Latest commit: |
de30f7c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9732cc2a.svadmin.pages.dev |
| Branch Preview URL: | https://codex-auth-permissions-harde.svadmin.pages.dev |
Owner
Author
|
审查结论:暂不合并(PARTIAL,高风险认证/权限变更)。 阻塞项:公开契约在实现与文档之间不一致。实现中的 SSO/Supabase provider 始终包含 请统一为一个明确契约:要么文档全部说明“方法存在,无 trusted resolver 时返回 null”,要么实现/类型改为确实省略属性或返回 undefined,并补对应测试。修复后重新跑 Lint & Test、E2E,并继续高风险复审。 已确认的正向证据:当前 head |
Merged
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
Combines PRs #208 and #209 into a single coherent auth hardening change. Both PRs addressed the same security concern (client-side claims treated as authorization facts) but conflicted in 8 files and took slightly different approaches.
What this combined PR does
Trusted resolver architecture (from #208):
getPermissions()on SSO and Supabase providers now returnsnullunless the application explicitly configures a trusted resolvergetPermissionsconfig option receives{ session, getAccessToken, createAuthenticatedFetch }getPermissionsconfig option receives{ client, user }user_metadata.roleare used as permissionsExact permission matching (from #208):
createFeatureGateno longer interprets wildcards (*orresource:*)Stronger UI-only documentation (from #209):
getPermissionsas UI-only hintsusePermissionsJSDoc: "runs in the browser and never authorizes API, RLS, or action requests"types.tsAuthProvider:getPermissionsannotated as "UI-only permission hints"Tests
All permission, SSO auth-provider, and Supabase tests pass. The only failing tests are the pre-existing
LiteActionButtonstests (local@lucide/sveltestale symlink issue — CI passes fine).Closes
Supersedes #208 and #209.