Do not assume public artifacts have prefix public/
@petemoore 已经在做这个了。
开始于 2026年5月7日。
评估
这个 Issue 还没有评估数据。
描述
Scanning the taskgraph codebase, there are several pieces of code that check whether an artifact name has prefix public/ to determine whether scopes are required to fetch it. Unfortunately this is not the correct way to determine whether an API call to fetch the artifact requires scopes.
The anonymous role determines the set of scopes that all calls are granted. Typically this includes queue:get-artifact:public/* but that is not a requirement, and in locked down taskcluster deployments this scope may not be included in the anonymous role. Furthermore, the anonymous role may include other scopes with prefix queue:get-artifact: meaning that not only public/* artifacts are public.
The bottom line is: the correct way to check whether an artifact is public is to see if an unauthorized request satisfies the scope queue:get-artifact:<artifact-name> e.g. by calling authorize (node.js) or e.g. scopes.Satisfies (go) or alternatively just fetch the artifact with an unauthorized HEAD request and check for a 200 http status code response.
In python, it looks like you can either expand the scopes of the anonymous role, or make an unauthorised call to auth.currentScopes to fetch anonymous scopes. Then call scopeMatch to see if the anonymous role satisfies the scope queue:get-artifact:<artifact-name> for the artifact name you are interested in.
Note, you should not try to parse the anonymous scopes yourself, but instead rely on one of these libraries to take care of the delicate matters of scope/role expansion, * matching, handling parameterized roles, etc.
- 主要语言
- Python
- 星标
- 26
- 派生
- 55
- 平均合并
- 2 天 6 分钟
- 30 天内合并 PR
- 15
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
taskcluster/taskgraph 的其他 Issue
-
难度 5/5 一周以上 新手友好度 20/100
taskcluster/taskgraph#952 ·
-
难度 4/5 3-5 天 新手友好度 35/100
taskcluster/taskgraph#915 ·
-
feature
难度 3/5 1-2 天 新手友好度 35/100
taskcluster/taskgraph#911 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 45/100
taskcluster/taskgraph#882 ·
-
难度 5/5 一周以上 新手友好度 35/100
taskcluster/taskgraph#865 · 1 条评论 ·
查看 taskcluster/taskgraph 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
anthropics/skills#1811 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
speaches-ai/speaches#678 ·
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
datalayer/mcp-compose#42 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
conda-forge/spacy-feedstock#177 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
UKGovernmentBEIS/inspect_evals#2523 ·