cmdbox 0.5.0.8__py3-none-any.whl → 0.5.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of cmdbox might be problematic. Click here for more details.
- cmdbox/app/auth/signin.py +631 -0
- cmdbox/app/edge.py +96 -12
- cmdbox/app/features/cli/cmdbox_edge_config.py +9 -3
- cmdbox/app/features/cli/cmdbox_gui_start.py +1 -1
- cmdbox/app/features/cli/cmdbox_web_start.py +2 -1
- cmdbox/app/features/web/cmdbox_web_bbforce_cmd.py +1 -1
- cmdbox/app/features/web/cmdbox_web_copyright.py +1 -1
- cmdbox/app/features/web/cmdbox_web_del_cmd.py +1 -1
- cmdbox/app/features/web/cmdbox_web_del_pipe.py +1 -1
- cmdbox/app/features/web/cmdbox_web_do_signin.py +88 -32
- cmdbox/app/features/web/cmdbox_web_exec_cmd.py +2 -2
- cmdbox/app/features/web/cmdbox_web_exec_pipe.py +2 -2
- cmdbox/app/features/web/cmdbox_web_filer download.py +2 -3
- cmdbox/app/features/web/cmdbox_web_filer.py +1 -1
- cmdbox/app/features/web/cmdbox_web_filer_upload.py +1 -1
- cmdbox/app/features/web/cmdbox_web_get_cmd_choices.py +1 -1
- cmdbox/app/features/web/cmdbox_web_get_cmds.py +2 -2
- cmdbox/app/features/web/cmdbox_web_get_modes.py +2 -2
- cmdbox/app/features/web/cmdbox_web_get_server_opt.py +1 -1
- cmdbox/app/features/web/cmdbox_web_gui.py +2 -2
- cmdbox/app/features/web/cmdbox_web_list_cmd.py +2 -2
- cmdbox/app/features/web/cmdbox_web_list_pipe.py +2 -2
- cmdbox/app/features/web/cmdbox_web_load_cmd.py +1 -1
- cmdbox/app/features/web/cmdbox_web_load_pin.py +3 -5
- cmdbox/app/features/web/cmdbox_web_load_pipe.py +1 -1
- cmdbox/app/features/web/cmdbox_web_raw_cmd.py +1 -1
- cmdbox/app/features/web/cmdbox_web_raw_pipe.py +1 -1
- cmdbox/app/features/web/cmdbox_web_result.py +2 -2
- cmdbox/app/features/web/cmdbox_web_save_cmd.py +1 -1
- cmdbox/app/features/web/cmdbox_web_save_pin.py +2 -2
- cmdbox/app/features/web/cmdbox_web_save_pipe.py +1 -1
- cmdbox/app/features/web/cmdbox_web_signin.py +26 -8
- cmdbox/app/features/web/cmdbox_web_users.py +35 -37
- cmdbox/app/features/web/cmdbox_web_versions_cmdbox.py +1 -1
- cmdbox/app/features/web/cmdbox_web_versions_used.py +1 -1
- cmdbox/app/options.py +8 -8
- cmdbox/app/web.py +76 -555
- cmdbox/extensions/sample_project/sample/extensions/features.yml +38 -13
- cmdbox/extensions/sample_project/sample/extensions/user_list.yml +82 -40
- cmdbox/extensions/user_list.yml +10 -0
- cmdbox/version.py +2 -2
- cmdbox/web/assets/cmdbox/list_cmd.js +50 -2
- cmdbox/web/assets/cmdbox/signin.js +7 -0
- cmdbox/web/gui.html +1 -0
- cmdbox/web/signin.html +7 -0
- {cmdbox-0.5.0.8.dist-info → cmdbox-0.5.1.1.dist-info}/METADATA +1 -1
- {cmdbox-0.5.0.8.dist-info → cmdbox-0.5.1.1.dist-info}/RECORD +51 -51
- cmdbox/app/signin.py +0 -56
- {cmdbox-0.5.0.8.dist-info → cmdbox-0.5.1.1.dist-info}/LICENSE +0 -0
- {cmdbox-0.5.0.8.dist-info → cmdbox-0.5.1.1.dist-info}/WHEEL +0 -0
- {cmdbox-0.5.0.8.dist-info → cmdbox-0.5.1.1.dist-info}/entry_points.txt +0 -0
- {cmdbox-0.5.0.8.dist-info → cmdbox-0.5.1.1.dist-info}/top_level.txt +0 -0
cmdbox/app/signin.py
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
from typing import Dict, Any, Tuple, List, Union
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class Signin(object):
|
|
5
|
-
|
|
6
|
-
def __init__(self, appcls, ver):
|
|
7
|
-
self.ver = ver
|
|
8
|
-
self.appcls = appcls
|
|
9
|
-
|
|
10
|
-
def jadge(self, access_token:str, email:str, signin_file_data:Dict[str, Any]) -> Tuple[bool, Dict[str, Any]]:
|
|
11
|
-
"""
|
|
12
|
-
サインインを成功させるかどうかを判定します。
|
|
13
|
-
返すユーザーデータには、uid, name, email, groups, hash が必要です。
|
|
14
|
-
|
|
15
|
-
Args:
|
|
16
|
-
access_token (str): アクセストークン
|
|
17
|
-
email (str): メールアドレス
|
|
18
|
-
signin_file_data (Dict[str, Any]): サインインファイルデータ(変更不可)
|
|
19
|
-
|
|
20
|
-
Returns:
|
|
21
|
-
Tuple[bool, Dict[str, Any]]: (成功かどうか, ユーザーデータ)
|
|
22
|
-
"""
|
|
23
|
-
users = [u for u in signin_file_data['users'] if u['email'] == email and u['hash'] == 'oauth2']
|
|
24
|
-
return len(users) > 0, users[0] if len(users) > 0 else None
|
|
25
|
-
|
|
26
|
-
def get_groups(self, access_token:str, user:Dict[str, Any], signin_file_data:Dict[str, Any]) -> Tuple[List[str], List[int]]:
|
|
27
|
-
"""
|
|
28
|
-
ユーザーのグループを取得します
|
|
29
|
-
|
|
30
|
-
Args:
|
|
31
|
-
access_token (str): アクセストークン
|
|
32
|
-
user (Dict[str, Any]): ユーザーデータ
|
|
33
|
-
signin_file_data (Dict[str, Any]): サインインファイルデータ(変更不可)
|
|
34
|
-
|
|
35
|
-
Returns:
|
|
36
|
-
Tuple[List[str], List[int]]: (グループ名, グループID)
|
|
37
|
-
"""
|
|
38
|
-
group_names = list(set(self.correct_group(user['groups'], None, signin_file_data)))
|
|
39
|
-
gids = [g['gid'] for g in signin_file_data['groups'] if g['name'] in group_names]
|
|
40
|
-
return group_names, gids
|
|
41
|
-
|
|
42
|
-
def correct_group(self, group_names:List[str], master_groups:List[Dict[str, Any]], signin_file_data:Dict[str, Any]):
|
|
43
|
-
"""
|
|
44
|
-
指定されたグループ名に属する子グループ名を収集します
|
|
45
|
-
|
|
46
|
-
Args:
|
|
47
|
-
group_names (List[str]): グループ名リスト
|
|
48
|
-
master_groups (List[Dict[str, Any]], optional): 親グループ名. Defaults to None.
|
|
49
|
-
signin_file_data (Dict[str, Any]): サインインファイルデータ(変更不可)
|
|
50
|
-
"""
|
|
51
|
-
master_groups = signin_file_data['groups'] if master_groups is None else master_groups
|
|
52
|
-
gns = []
|
|
53
|
-
for gn in group_names.copy():
|
|
54
|
-
gns = [gr['name'] for gr in master_groups if 'parent' in gr and gr['parent']==gn]
|
|
55
|
-
gns += self.correct_group(gns, master_groups, signin_file_data)
|
|
56
|
-
return group_names + gns
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|