Skip to content

Commit

Permalink
Merge pull request #493 from ut-issl/feature/del_authentication_to_wings
Browse files Browse the repository at this point in the history
Pre Release (v3.8.0-beta.4): 認証なしの最新の WINGS への対応
  • Loading branch information
meltingrabbit authored Feb 18, 2023
2 parents 9e04f4d + a1e0341 commit 9534282
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 59 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ dkms.conf
# for c2a user sample
Examples/minimum_user/src/src_core
Examples/minimum_user/build
Examples/minimum_user/src/src_user/Test/authorization.json
Examples/2nd_obc_user/src/src_core
Examples/2nd_obc_user/build
Examples/2nd_obc_user/src/src_user/Test/authorization.json
*.pyc

This file was deleted.

16 changes: 1 addition & 15 deletions Examples/2nd_obc_user/src/src_user/Test/utils/wings_utils.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
import os
import isslwings as wings


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"),
)

# 環境変数があればそちらを優先
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)
return wings.Operation()
1 change: 0 additions & 1 deletion Examples/2nd_obc_user/sync_with_minimum_user.bat
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ call :sync_file ".\src\src_user\TlmCmd\common_tlm_cmd_packet.c" "..\minimum_user
call :sync_file ".\src\src_user\TlmCmd\common_tlm_packet.c" "..\minimum_user\src\src_user\TlmCmd\common_tlm_packet.c"

call :sync_file ".\src\src_user\Test\utils\wings_utils.py" "..\minimum_user\src\src_user\Test\utils\wings_utils.py"
call :sync_file ".\src\src_user\Test\authorization.json.temp" "..\minimum_user\src\src_user\Test\authorization.json.temp"
call :sync_file ".\src\src_user\Test\pytest.ini" "..\minimum_user\src\src_user\Test\pytest.ini"


Expand Down
11 changes: 0 additions & 11 deletions Examples/minimum_user/src/src_user/Test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,3 @@ 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_USERNAME |
| password | WINGS_PASSWORD |

This file was deleted.

16 changes: 1 addition & 15 deletions Examples/minimum_user/src/src_user/Test/utils/wings_utils.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
import os
import isslwings as wings


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"),
)

# 環境変数があればそちらを優先
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)
return wings.Operation()
2 changes: 1 addition & 1 deletion c2a_core_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ void C2A_core_main(void);
#define C2A_CORE_VER_MAJOR (3)
#define C2A_CORE_VER_MINOR (8)
#define C2A_CORE_VER_PATCH (0)
#define C2A_CORE_VER_PRE ("beta.3")
#define C2A_CORE_VER_PRE ("beta.4")

#endif

0 comments on commit 9534282

Please sign in to comment.