[BUG] Publisher sends GraphQL schema to service-level API path instead of workspace path
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 65/100
调研方向
从 publisher 中 GraphQL schema 的 PUT 路径构造入手,并将其与 issue 中描述的 workspace-aware API 路径进行比较。在 APIM workspace 中发布一个 GraphQL API 以重现问题,然后验证请求使用 workspaces/{workspaceId}/apis/{apiId}/schemas/graphql,并且部署成功且不会出现 403 错误。
由索引模型根据 Issue 内容生成。
描述
Release version
APIOps Toolkit for Azure APIM v7.0.2
Describe the bug
When publishing a GraphQL API that belongs to a workspace, the publisher constructs the wrong URI for the GraphQL schema PUT. It targets the service-level API schemas endpoint instead of the workspace-scoped one, causing a 403 AuthorizationFailed error.
The failing request:
PUT .../service/{serviceName}/apis/{apiId}/schemas/graphql
Expected request:
PUT .../service/{serviceName}/workspaces/{workspaceId}/apis/{apiId}/schemas/graphql
Expected behavior
Publisher successfully PUTs the GraphQL schema to workspaces/{workspaceId}/apis/{apiId}/schemas/graphql and the API deploys without error.
Actual behavior
Publisher fails with HTTP 403:
System.Net.Http.HttpRequestException: HTTP request to URI
https://management.azure.com/subscriptions/{sub}/resourceGroups/{rg}/providers/
Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/graphql
?api-version=2024-05-01 failed with status code 403.
Content is '{"error":{"code":"AuthorizationFailed","message":"The client '...'
does not have authorization to perform action
'Microsoft.ApiManagement/service/apis/schemas/write' over scope
'.../service/{serviceName}/apis/{apiId}/schemas/graphql'
or the scope is invalid."}}'.
Reproduction Steps
- Create a GraphQL API inside an APIM workspace.
- Run the extractor —
specification.graphqlis written correctly (extractor is unaffected). - Run the publisher against a different environment — it fails with 403.
- 主要语言
- C#
- 星标
- 448
- 派生
- 247
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Azure/apiops 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 3/5 1-2 天 新手友好度 70/100
-
难度 4/5 3-5 天 新手友好度 55/100
-
难度 3/5 1-2 天 新手友好度 45/100
-
难度 5/5 一周以上 新手友好度 35/100
相似的 Issue
-
area-System.Numerics.Tensors untriaged
难度 2/5 1-3 小时 新手友好度 78/100
dotnet/runtime#134691 · 2 条评论 ·
维护者通常 1 天内回复
-
ci-failure-cause test-failure
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 2/5 1-3 小时 新手友好度 78/100
AvaloniaUI/Avalonia#22312 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 68/100