下载托管制品
OpenAPI 契约
- 方法
- GET
- 路径
/api/v1/hosted/{hostingPath}- 认证
- jwtBearer (bearer) OR automationKey (bearer)
- 响应状态
- 200 400 401 403 404 429 500
请求与响应 Schema
JSON
{
"requestBody": {},
"responses": {
"200": {
"description": "Hosted artifact",
"content": {
"application/java-archive": {
"format": "binary",
"type": "string"
}
}
},
"400": {
"description": "Invalid request",
"content": {
"application/json": {
"$ref": "#/components/schemas/RequestError"
}
}
},
"401": {
"description": "Authentication required or invalid",
"content": {
"application/json": {
"$ref": "#/components/schemas/SecurityError"
}
}
},
"403": {
"description": "Authenticated but not permitted",
"content": {
"application/json": {
"$ref": "#/components/schemas/SecurityError"
}
}
},
"404": {
"description": "Hosted artifact was not found, has expired, or is not visible to the caller",
"content": {
"application/json": {
"$ref": "#/components/schemas/ApiError"
}
}
},
"429": {
"description": "Rate limit exceeded",
"content": {
"application/json": {
"$ref": "#/components/schemas/SecurityError"
}
}
},
"500": {
"description": "Unexpected server error",
"content": {
"application/json": {
"$ref": "#/components/schemas/ApiError"
}
}
}
}
}使用仪表盘 JWT,或带有 artifact:read 的 nfy_ 密钥获取成功构建的 hosted 输出。认证是必要但不充分的条件:服务器会在返回任何字节前授权确切任务。项目任务需要有效的 artifact:output:read(包括 ARTIFACT_CONSUMER 授权);旧版或临时任务使用精确所有者回退。Hosted 下载使用任务的 hostingPath;默认值为 artifacts/{taskId}/native.jar,路由为 /api/v1/hosted/{hostingPath}。
该路由为私有且按资源授权。响应使用 Cache-Control: private, no-store 与 Content-Disposition: attachment。hostingPath 只改变地址,绝不授予访问权限;匿名请求以及不存在、格式错误、过期或超出调用方已授权资源边界的路径返回相同的未找到结果。仅当任务成功且输出仍被存储时,路径才会解析;未完成、失败、取消或删除的任务不会提供制品。