[Feat]: Add a PermissionDenied server error with HTTP 403 and gRPC PERMISSION_DENIED mappings
维护者通常 2 天内回复
@Iwaniukooo11 已经在做这个了。
开始于 2026年11月2日。
评估
这个 Issue 还没有评估数据。
描述
Feature request
Please expose a server-side PermissionDeniedError (or equivalent generic authorization error) with consistent transport mappings. With a2a-sdk==1.3.0, a2a.utils.errors has no authorization-denial type and A2A_ERROR_MAPPING has no HTTP 403 / gRPC PERMISSION_DENIED mapping.
Why this is needed
An authenticated client can lack the action permission to list or cancel tasks even though the agent supports the operation and the task is still cancelable. Raising UnsupportedOperationError or TaskNotCancelableError misrepresents the failure and can cause a client to cache the wrong capability or lifecycle conclusion.
A2A v1.0.1 §3.3.2 requires authorization errors for insufficient permissions. It gives HTTP 403, gRPC PERMISSION_DENIED and a JSON-RPC custom error as examples. Resource hiding remains a separate concern: inaccessible or nonexistent task IDs should still be indistinguishable via TaskNotFound where appropriate.
Reproduction / API gap
import a2a.utils.errors as errors
assert not hasattr(errors, "PermissionDeniedError")
assert not any(mapping.http_code == 403 or mapping.grpc_status == "PERMISSION_DENIED"
for mapping in errors.A2A_ERROR_MAPPING.values())
This passes with 1.3.0. A handler wishing to deny an authenticated caller's ListTasks or CancelTask action cannot raise a built-in exception with the required authorization semantics.
Requested behavior
- A public server exception representing an action-policy denial.
- HTTP/REST 403 and gRPC PERMISSION_DENIED mappings.
- An SDK-owned JSON-RPC custom error mapping (rather than applications inventing conflicting numeric codes).
- Structured
google.rpc.ErrorInfowith a documented stable reason such as PERMISSION_DENIED, plus optional bounded missing-scope information. - Client-side reconstruction and transport regression tests.
- Documentation distinguishing action denial from resource existence hiding, unsupported operations, and noncancelable lifecycle states.
Our HTTP teaching lab now authorizes in identity middleware and returns HTTP 403 before dispatch, which works around the HTTP gap. A shared handler-level exception would make this practical across JSON-RPC, HTTP+JSON and gRPC without separate application mappings.
I searched for PermissionDenied, PERMISSION_DENIED, and authorization-error reports before filing; this request is scoped to the missing public server error/mappings in 1.3.0.
- 主要语言
- Python
- 星标
- 2.2k
- 派生
- 532
- 平均合并
- 3 天 17 小时
- 30 天内合并 PR
- 43
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
a2aproject/a2a-python 的其他 Issue
-
[Bug]: `A2A-Version` validation ignores minor versions and the query parameter可能已有人在做 @rohityan 于 70 天前认领。 未关闭component: server status:awaiting response
难度 2/5 1-3 小时 新手友好度 75/100
a2aproject/a2a-python#1204 · 3 条评论 · 已指派 1 人 ·
维护者通常 2 天内回复
-
[Bug]: REST task/request id sanitization可能已有人在做 @Linux2010 于 129 天前认领。 未关闭maintainers-only
难度 2/5 1-3 小时 新手友好度 65/100
a2aproject/a2a-python#805 · 1 条评论 ·
维护者通常 2 天内回复
-
[Bug]: CancelTaskRequest.metadata never reaches AgentExecutor.cancel可能已有人在做 @muscariello 于 1 天前认领。 未关闭maintainers-only
a2aproject/a2a-python#1415 · 已指派 1 人 ·
维护者通常 2 天内回复
-
[Feat]: Add a task-state-invariants agent skill for sibling-surface propagation可能已有人在做 @Linux2010 于 1 天前认领。 未关闭component: tooling status:awaiting response
a2aproject/a2a-python#1413 · 3 条评论 · 已指派 1 人 ·
维护者通常 2 天内回复
-
[Bug]: taskId-only continuation still fails required contextId inference in SDK 1.3.0 (follow-up to #1206)可能已有人在做 @rohityan 于 2 天前认领。 未关闭component: server status:awaiting response
a2aproject/a2a-python#1411 · 1 条评论 · 已指派 1 人 ·
维护者通常 2 天内回复
查看 a2aproject/a2a-python 的全部 Issue
相似的 Issue
-
HandyModRTransform.deriv3 is wrong for m > 2可能已有人在做 @SajalDevX 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
-
read_messages: the first read after subscribe/psubscribe returns no messages even when some are waiting可能已有人在做 @matheussilvano 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 80/100
The-Swarm-Corporation/swarms-framework-docs#399 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
bump patch
难度 2/5 1-3 小时 新手友好度 72/100
autowarefoundation/autoware_carla_scenario#1321 ·
维护者通常 1 天内回复