Repository navigation
fix(auth): align effective permissions with native content policy - #37
Merged
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.
当前 dev 的 EAP effective-permission 接口只读取 Hub 端 V2 决策,没有确认原生 C 对同一路径的内容权限。本次在现行入口中补齐原生内容权限确认,任何原生拒绝或策略不可用都不会返回可写;原生结果也不能扩大 V2 的资格范围或硬只读限制。
origin/dev ee732e74ce02f184586e1313b489e2198dbc15fe。d77c013bd;从该基线派生本短分支,未 cherry-pick 旧接口或旧权限体系。seahub/urls.py已将/api/v2.1/cloudfile/authorization/v1/effective-permission/接到cloudfile_ext.v2.acl_http.EffectivePermission。保留此路径和成功响应字段,不增加旧NativeEffectiveContractView或开关。check_permission_by_path与现有 V2 Authority 取更严格结果;库 r、子目录 rw 返回 write=true,库根及兄弟目录 r 返回 write=false。无内容权限 HTTP 403,原生 RPC/SQL故障 HTTP 503;仅管理权限不转为内容 rw。验证命令(Python 环境含 Django、DRF、PyJWT):
12 个新合同检查覆盖库 r 子目录 rw、根及兄弟 r、无权限用户、管理角色、原生策略异常、原生撤权、未知/管理标记、SQL失败、主体覆盖、匿名访问、目录共享根与文件路径;同时跑既有 ACL runtime/policy 及原 HTTP 合同回归。测试运行真实 DRF、V2 Authority 和 ACL 解析器,显式替代原生 RPC/SQL 输入;隔离 runner 仅隔离原生登录数据库导入,不测试登录后端。
未覆盖:匹配 Server 的真实 C/Go 权限策略、DEV 上传/提交/下载字节流、真实登录/Token、真实 SQL/Redis 与跨服务并发。接口响应只是客户端资格检查,不能替代 Server 最终写入终判。未部署 DEV/生产,未合并本 PR。