Dataikuapi is not correctly honoring "DKU_NO_CHECK_CERTIFICATE" in requests

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
api, backend

調査の方向性

まず dataikuapi/dssclient.py の DSSClient と _perform_http を読み、次に api_client() と set_remote_dss() を通じてセッションがどのように作成されるかを追跡します。closed-source の dataiku パッケージに依存せずに証明書検証設定を伝播できるかどうかを確認します。自己署名証明書を使用する場合に、requests が DKU_NO_CHECK_CERTIFICATE と設定された no_check_certificate の値を尊重すれば完了です。

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

説明

In theory, Dataiku supports using self-signed certificates by setting e.g. using an environmental variable DKU_NO_CHECK_CERTIFICATE or by setting no_check_certificate=True in the set_remote function call of the non-open source dataiku package.

However, this parameter is not passed to the api_client(), which causes requests to fail which are made to Dataiku instances using self-signed certificates. It is possible to mitigate this by setting the verify value of the internal Session object to false:

client = dataiku.api_client()
client._session.verify = False

Which is not obvious and requires looking through the internals of the package.

A fix at the central call site of the dataikuapi package, _perform_http:
https://github.com/dataiku/dataiku-api-client-python/blob/fc51e29a12a1f50717771522e1b450ae91ff4d87/dataikuapi/dssclient.py#L1228-L1233
would only be possible in parts by duplicating the logic to check the "DKU_NO_CHECK_CERTIFICATE" variable or config files, but would still fail for Dataiku session set up by using the set_remote_dss function call.

The best option would be to add a "no_check_certificate" parameter to the DSSClient class that can be set when creating an instance of the class. But as the DSSClient is also used by the closed-source dataiku package, it seems to me that this can't be solved by contributing to the open source dataikuapi package.

主要言語
Python
スター
44
フォーク
29
平均マージ
3時間 34分
マージ済み PR(30日)
2

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

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

はじめの一歩

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

dataiku/dataiku-api-client-python のほかの issue

dataiku/dataiku-api-client-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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