influxdata / influxdata/iot-api-python

The argument `authorization` in `create_authorization` needs to use a keyword

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

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

主要言語
Python
スター
28
フォーク
10
PR マージ指標
30日以内にマージされた PR はありません

説明

In `api/devices.py#162` the statement...

```
request = authorization_api.create_authorization(authorization)
```

should be

```
request = authorization_api.create_authorization(authorization=authorization)
```

This is related to.

* https://github.com/influxdata/influxdb-client-python/pull/682
* https://github.com/influxdata/influxdb-client-python/pull/680
* https://github.com/influxdata/docs-v2/pull/5701

Note that on clicking the _Auth_ link in the flask UI, the tutorial application is now returning...

```
ApiException
influxdb_client.rest.ApiException: (400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json; charset=utf-8', 'X-Influxdb-Build': 'OSS', 'X-Influxdb-Version': 'v2.7.11', 'X-Platform-Error-Code': 'invalid', 'Date': 'Wed, 04 Dec 2024 13:04:14 GMT', 'Content-Length': '163'})
HTTP response body: {
"code": "invalid",
"message": "invalid json structure: json: cannot unmarshal object into Go struct field postAuthorizationRequest.orgID of type platform.ID"
}
```

The example here is causing confusion for some users.

I tried to push a branch with this change to create a PR, however I do not have write permissions to this repository.

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

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

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

調査の方向性

api/devices.py#162から開始し、Flaskチュートリアルのフローにあるcreate_authorizationの呼び出しを調べます。引数の使用方法を、issueで要求されているキーワード形式に合わせて更新し、その後Authリンクを実行して、報告されていた400 ApiExceptionが返されなくなったことを確認します。

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

評価

技術スタック
python
領域
api, backend
issue の種類
バグ
難易度
1/5
見積もり時間
1時間未満
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
55/100

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

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