microsoftgraph / microsoftgraph/msgraph-beta-sdk-java

Permissions error response not deserialized correctly

オープン
#918 コメント 8 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Needs: attention :wave: question
主要言語
Java
スター
32
フォーク
14
平均マージ
1日 3時間
マージ済み PR(30日)
6

説明

Expected behavior

API calls with errors should return a useable error response.

Actual behavior

An exception is thrown while parsing the permission error response:

com.microsoft.graph.beta.models.odataerrors.ODataError: 
	at com.microsoft.graph.beta.models.odataerrors.ODataError.createFromDiscriminatorValue(ODataError.java:36) ~[microsoft-graph-beta-6.5.1.jar:na]
	at com.microsoft.kiota.serialization.JsonParseNode.getObjectValue(JsonParseNode.java:211) ~[microsoft-kiota-serialization-json-1.1.2.jar:na]
	at com.microsoft.kiota.http.OkHttpRequestAdapter.lambda$throwIfFailedResponse$0(OkHttpRequestAdapter.java:674) ~[microsoft-kiota-http-okHttp-1.1.2.jar:na]
	at com.microsoft.kiota.ApiExceptionBuilder.<init>(ApiExceptionBuilder.java:26) ~[microsoft-kiota-abstractions-1.1.2.jar:na]
	at com.microsoft.kiota.http.OkHttpRequestAdapter.throwIfFailedResponse(OkHttpRequestAdapter.java:673) ~[microsoft-kiota-http-okHttp-1.1.2.jar:na]
	at com.microsoft.kiota.http.OkHttpRequestAdapter.send(OkHttpRequestAdapter.java:281) ~[microsoft-kiota-http-okHttp-1.1.2.jar:na]
	at com.microsoft.graph.beta.security.informationprotection.sensitivitylabels.SensitivityLabelsRequestBuilder.get(SensitivityLabelsRequestBuilder.java:120) ~[microsoft-graph-beta-6.5.1.jar:na]
Steps to reproduce the behavior
  • Use any sdk versions 6.3.0 to 6.5.1
  • Using client secret credentials, call a graph api which requires a permission that app registration client does not have
  • Observe the thrown exception as shown above

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

client-secret 認証情報と、必要な権限がない API 呼び出しで失敗を再現します。スタックトレースにある ODataError.createFromDiscriminatorValue、JsonParseNode.getObjectValue、OkHttpRequestAdapter.throwIfFailedResponse から調査を開始します。権限エラーのレスポンスが parsing exception なしで使用可能なエラーにデシリアライズされれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
api, authorization
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。