From 415f44ecbbdf85681b2428f1da24cff254644dfd Mon Sep 17 00:00:00 2001 From: Yoshinari Gyu <50069930+yngyu@users.noreply.github.com> Date: Fri, 7 Jan 2022 15:26:55 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=E8=AA=8D=E8=A8=BC=E6=83=85=E5=A0=B1?= =?UTF-8?q?=E3=82=92=E7=92=B0=E5=A2=83=E5=A4=89=E6=95=B0=E3=81=8B=E3=82=89?= =?UTF-8?q?=E5=8F=96=E5=BE=97=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/src_user/Test/README.md | 11 +++++++++++ .../src/src_user/Test/utils/wings_utils.py | 14 ++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/Examples/minimum_user_for_s2e/src/src_user/Test/README.md b/Examples/minimum_user_for_s2e/src/src_user/Test/README.md index b5239fa33..ae3c90b60 100644 --- a/Examples/minimum_user_for_s2e/src/src_user/Test/README.md +++ b/Examples/minimum_user_for_s2e/src/src_user/Test/README.md @@ -47,3 +47,14 @@ or cd ./test/src_user/Applications/UserDefined/ pytest -m real -v test_tlm_mem_dump.py ``` + +## 認証情報について +wings と通信するにあたりに対して認証情報を渡す必要がある. `authorization.json.temp` と同じ key を持つ正しい `authorization.json` を誰かからもらうか、又はそれぞれの key に対応する環境変数を埋めること. 対応を下表に示す + +| `authorization.json` の key | 環境変数 | +| :-------------------------- | :------------------ | +| client_id | WINGS_CLIENT_ID | +| client_secret | WINGS_CLIENT_SECRET | +| grant_type | WINGS_GRANT_TYPE | +| username | WINGS_USER_NAME | +| password | WINGS_PASSWORD | diff --git a/Examples/minimum_user_for_s2e/src/src_user/Test/utils/wings_utils.py b/Examples/minimum_user_for_s2e/src/src_user/Test/utils/wings_utils.py index 05abfbd16..e41935240 100644 --- a/Examples/minimum_user_for_s2e/src/src_user/Test/utils/wings_utils.py +++ b/Examples/minimum_user_for_s2e/src/src_user/Test/utils/wings_utils.py @@ -5,6 +5,16 @@ import isslwings as wings def get_wings_operation(): - with open(os.path.dirname(__file__) + "/../authorization.json") as f: - authorization = json.load(f) + authorization = dict( + client_id=os.environ.get("WINGS_CLIENT_ID"), + client_secret=os.environ.get("WINGS_CLIENT_SECRET"), + grant_type=os.environ.get("WINGS_GRANT_TYPE"), + username=os.environ.get("WINGS_USERNAME"), + password=os.environ.get("WINGS_PASSWORD") + ) + + # 環境変数があればそちらを優先 + if None in authorization.values(): + with open(os.path.dirname(__file__) + "/../authorization.json") as f: + authorization = json.load(f) return wings.Operation(authentication_info=authorization) From 95646d6c628e1efdb2fd482efe8e6427fd2fee7f Mon Sep 17 00:00:00 2001 From: Yoshinari Gyu <50069930+yngyu@users.noreply.github.com> Date: Fri, 7 Jan 2022 15:34:22 +0900 Subject: [PATCH 2/3] modify README --- Examples/minimum_user_for_s2e/src/src_user/Test/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Examples/minimum_user_for_s2e/src/src_user/Test/README.md b/Examples/minimum_user_for_s2e/src/src_user/Test/README.md index ae3c90b60..25348ae4e 100644 --- a/Examples/minimum_user_for_s2e/src/src_user/Test/README.md +++ b/Examples/minimum_user_for_s2e/src/src_user/Test/README.md @@ -56,5 +56,5 @@ wings と通信するにあたりに対して認証情報を渡す必要があ | client_id | WINGS_CLIENT_ID | | client_secret | WINGS_CLIENT_SECRET | | grant_type | WINGS_GRANT_TYPE | -| username | WINGS_USER_NAME | +| username | WINGS_USERNAME | | password | WINGS_PASSWORD | From f8a05430aa9b61cb41bfb289400ac1cd29176992 Mon Sep 17 00:00:00 2001 From: Yoshinari Gyu <50069930+yngyu@users.noreply.github.com> Date: Mon, 10 Jan 2022 18:48:57 +0900 Subject: [PATCH 3/3] modify readme & and blank --- .../minimum_user_for_s2e/src/src_user/Test/README.md | 6 +++--- .../src/src_user/Test/utils/wings_utils.py | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Examples/minimum_user_for_s2e/src/src_user/Test/README.md b/Examples/minimum_user_for_s2e/src/src_user/Test/README.md index 25348ae4e..9722069f7 100644 --- a/Examples/minimum_user_for_s2e/src/src_user/Test/README.md +++ b/Examples/minimum_user_for_s2e/src/src_user/Test/README.md @@ -49,12 +49,12 @@ pytest -m real -v test_tlm_mem_dump.py ``` ## 認証情報について -wings と通信するにあたりに対して認証情報を渡す必要がある. `authorization.json.temp` と同じ key を持つ正しい `authorization.json` を誰かからもらうか、又はそれぞれの key に対応する環境変数を埋めること. 対応を下表に示す +wings と通信するにあたりに対して認証情報を渡す必要がある. `authorization.json.temp` と同じ key を持つ正しい `authorization.json` を誰かからもらうか,又はそれぞれの key に対応する環境変数を埋めること. 対応を下表に示す. -| `authorization.json` の key | 環境変数 | +| `authorization.json` の key | 環境変数 | | :-------------------------- | :------------------ | | client_id | WINGS_CLIENT_ID | | client_secret | WINGS_CLIENT_SECRET | | grant_type | WINGS_GRANT_TYPE | -| username | WINGS_USERNAME | +| username | WINGS_USERNAME | | password | WINGS_PASSWORD | diff --git a/Examples/minimum_user_for_s2e/src/src_user/Test/utils/wings_utils.py b/Examples/minimum_user_for_s2e/src/src_user/Test/utils/wings_utils.py index e41935240..d7bcabea8 100644 --- a/Examples/minimum_user_for_s2e/src/src_user/Test/utils/wings_utils.py +++ b/Examples/minimum_user_for_s2e/src/src_user/Test/utils/wings_utils.py @@ -6,11 +6,11 @@ def get_wings_operation(): authorization = dict( - client_id=os.environ.get("WINGS_CLIENT_ID"), - client_secret=os.environ.get("WINGS_CLIENT_SECRET"), - grant_type=os.environ.get("WINGS_GRANT_TYPE"), - username=os.environ.get("WINGS_USERNAME"), - password=os.environ.get("WINGS_PASSWORD") + client_id = os.environ.get("WINGS_CLIENT_ID"), + client_secret = os.environ.get("WINGS_CLIENT_SECRET"), + grant_type = os.environ.get("WINGS_GRANT_TYPE"), + username = os.environ.get("WINGS_USERNAME"), + password = os.environ.get("WINGS_PASSWORD") ) # 環境変数があればそちらを優先