[BUG] Publisher sends GraphQL schema to service-level API path instead of workspace path
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 65/100
調査の方向性
publisher の GraphQL スキーマの 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 にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 1週間以上 初心者へのやさしさ 35/100
似ている issue
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
Type: enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
apache/arrow-adbc#4809 ·
-
type/automation type/tech-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
microsoft/vscode-azurefunctions#5197 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
microsoft/microsoft-ui-reactor#1274 ·