bcmd 0.6.11__py3-none-any.whl → 0.6.13__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 bcmd might be problematic. Click here for more details.
- bcmd/common/secret.py +41 -23
- bcmd/tasks/docs.py +8 -1
- {bcmd-0.6.11.dist-info → bcmd-0.6.13.dist-info}/METADATA +1 -1
- {bcmd-0.6.11.dist-info → bcmd-0.6.13.dist-info}/RECORD +7 -7
- {bcmd-0.6.11.dist-info → bcmd-0.6.13.dist-info}/WHEEL +0 -0
- {bcmd-0.6.11.dist-info → bcmd-0.6.13.dist-info}/entry_points.txt +0 -0
- {bcmd-0.6.11.dist-info → bcmd-0.6.13.dist-info}/top_level.txt +0 -0
bcmd/common/secret.py
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
from
|
|
1
|
+
import tkinter as tk
|
|
2
|
+
from tkinter import messagebox
|
|
3
|
+
from typing import Any, TypedDict
|
|
3
4
|
|
|
4
5
|
from async_lru import alru_cache
|
|
5
6
|
from beni import bcrypto, btask
|
|
6
|
-
from beni.
|
|
7
|
+
from beni.bform import BForm
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class PypiSecret(TypedDict):
|
|
@@ -13,9 +14,9 @@ class PypiSecret(TypedDict):
|
|
|
13
14
|
|
|
14
15
|
@alru_cache
|
|
15
16
|
async def getPypi(value: str = '') -> PypiSecret:
|
|
16
|
-
return
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
return _getData(
|
|
18
|
+
'请输入 PYPI 密钥信息',
|
|
19
|
+
value or 'QbuF2mV/lqovtF5dskZGD7qHknYbNuF2QseWRtWxLZTPrC/jL1tcxV8JEKaRjLsu46PxJZ7zepJwggnUTIWnEAoV5VtgP2/hbuzxxHha8817kR5c65H9fXm8eOal7DYXsUoGPQMnm59UWNXUKjmIaP4sn9nySFlRYqa8sEZSbYQ4N0NL35Dpj1e3wyQxJ+7h2jwKAz50Hh8G4yAM3/js9+NUe4ymts+UXcwsP3ADIBMkzjnFc0lEYg2d+fw0A74XWCvoZPoGqHZR/THUOVNAYxoGgDzP4SPIk1XsmtpxvfO/DpJd/Cg/0fB3MYagGKI1+m6Bxqhvd1I/lf0YbM5y4E4=',
|
|
19
20
|
)
|
|
20
21
|
|
|
21
22
|
|
|
@@ -28,24 +29,41 @@ class QiniuSecret(TypedDict):
|
|
|
28
29
|
|
|
29
30
|
@alru_cache
|
|
30
31
|
async def getQiniu(value: str = '') -> QiniuSecret:
|
|
31
|
-
return
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
return _getData(
|
|
33
|
+
'请输入 七牛云 密钥信息',
|
|
34
|
+
value or 'vNroFKeKklrdcJ89suFm+iyuJsq/cyUB5+QWoeeiMc/J0oSLF9cg5rqbK1IRxF0cCQ8KmkQQhdVa+PI6kuTBhoSH6IviVTylzAOrJywEccz9jWkJkW28Y9Vo4ePZmfWf/j7wdxNB144z234KD8IxJn4lR2A0L9JN5kk1o1/hpcydXL74FNtt03lYL/E3WVcvpUfw37mri2HMYOfUw81dRwW35/hMuQjtq1BBrKrIsSKTHH44tROMcgyvt+Qy292AtDBcsYiZxBKhQtBFPMq/vUs=',
|
|
34
35
|
)
|
|
35
36
|
|
|
36
37
|
|
|
37
|
-
def _getData(content: str) ->
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
def _getData(title: str, content: str) -> Any:
|
|
39
|
+
|
|
40
|
+
class PasswordForm(BForm):
|
|
41
|
+
result: dict[str, Any] = {}
|
|
42
|
+
|
|
43
|
+
def __init__(self):
|
|
44
|
+
super().__init__(title=title)
|
|
45
|
+
self.passwordVar = tk.StringVar(value='')
|
|
46
|
+
ary = content.split(' ')
|
|
47
|
+
if len(ary) > 1:
|
|
48
|
+
self.addLabel('提示', ary[0])
|
|
49
|
+
self.addEntry('密码', self.passwordVar, width=30, password=True, focus=True, command=self.onBtn)
|
|
50
|
+
self.addBtn('确定', self.onBtn)
|
|
51
|
+
|
|
52
|
+
def onBtn(self):
|
|
53
|
+
try:
|
|
54
|
+
self.result.update(
|
|
55
|
+
bcrypto.decryptJson(content, self.passwordVar.get())
|
|
56
|
+
)
|
|
57
|
+
self.destroy()
|
|
58
|
+
except:
|
|
59
|
+
messagebox.showerror('密码错误', '密码错误,请重新输入')
|
|
60
|
+
|
|
61
|
+
def getResult(self):
|
|
62
|
+
return self.result
|
|
63
|
+
|
|
64
|
+
result = PasswordForm().run()
|
|
65
|
+
|
|
66
|
+
if result is None:
|
|
67
|
+
btask.abort('用户取消操作')
|
|
41
68
|
else:
|
|
42
|
-
|
|
43
|
-
while True:
|
|
44
|
-
try:
|
|
45
|
-
pwd = getpass.getpass(tips)
|
|
46
|
-
return bcrypto.decryptJson(content, pwd)
|
|
47
|
-
except KeyboardInterrupt:
|
|
48
|
-
print('')
|
|
49
|
-
btask.abort('用户操作取消')
|
|
50
|
-
except BaseException:
|
|
51
|
-
printRed('密码错误')
|
|
69
|
+
return result
|
bcmd/tasks/docs.py
CHANGED
|
@@ -98,7 +98,10 @@ async def userInput():
|
|
|
98
98
|
def getResult(self):
|
|
99
99
|
return self.varIsUpload.get(), self.varPassword.get()
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
result = BuildForm().run()
|
|
102
|
+
if not result:
|
|
103
|
+
btask.abort('用户取消操作')
|
|
104
|
+
isUpload, password = result
|
|
102
105
|
|
|
103
106
|
# 配置里面每个字段都尝试解密(实际效率较低但不影响使用)
|
|
104
107
|
for k, v in conf.items():
|
|
@@ -142,6 +145,10 @@ async def makeDeploy(outputPath: Path):
|
|
|
142
145
|
# 替换文件内容
|
|
143
146
|
content = await bfile.readText(file)
|
|
144
147
|
oldContent = content
|
|
148
|
+
try:
|
|
149
|
+
content = bcrypto.decryptText(content, password)
|
|
150
|
+
except:
|
|
151
|
+
pass
|
|
145
152
|
for k, v in dataDict.items():
|
|
146
153
|
content = content.replace(f'{{{k}}}', str(v))
|
|
147
154
|
if oldContent != content:
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
bcmd/__init__.py,sha256=GP_60-6vImXqdMfC5vc4xlscWajx4OYmnlNXASWn19w,147
|
|
2
2
|
bcmd/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
bcmd/common/func.py,sha256=MehbfuWFHTOsihhYxVFj0_U6-hjMTfLh3n-oMrpyyKo,508
|
|
4
|
-
bcmd/common/secret.py,sha256=
|
|
4
|
+
bcmd/common/secret.py,sha256=oHZCNnpAjrS3ztuTUy24IwSGeA_3Z8KfgnNP48ZVjrQ,2285
|
|
5
5
|
bcmd/resources/project/main.py,sha256=xdskz_sf05fYA1SRMFCIxDjx8SnegxTbCmHpW86ItLs,11
|
|
6
6
|
bcmd/tasks/__init__.py,sha256=_G8hO9P0UEKJRreXv8114XeTR8uFG8gRSjvA1WMv8f8,333
|
|
7
7
|
bcmd/tasks/bin.py,sha256=DufZGRX7b2zclSaZM-zUPGwOiycN9RsV8KxF8tfSyqs,3240
|
|
8
8
|
bcmd/tasks/code.py,sha256=IUs_ClZuSsBk2gavlitC8mkRrQQX9rvNDgR8cFxduBA,3992
|
|
9
9
|
bcmd/tasks/crypto.py,sha256=LKvgsMPLvsi1wlt66TinYiN-oV2IPAfaN9y7hWaVpHs,2951
|
|
10
10
|
bcmd/tasks/debian.py,sha256=B9aMIIct3vNqMJr5hTr1GegXVf20H49C27FMvRRGIzI,3004
|
|
11
|
-
bcmd/tasks/docs.py,sha256=
|
|
11
|
+
bcmd/tasks/docs.py,sha256=LzCS41B82xILXTHbVvdb4ViFz0qPWDv3J8SG06Jaltc,6115
|
|
12
12
|
bcmd/tasks/download.py,sha256=XdZYKi8zQTNYWEgUxeTNDqPgP7IGYJkMmlDDC9u93Vk,2315
|
|
13
13
|
bcmd/tasks/image.py,sha256=_ck-WVfUlyQ2fZTpVPcpcurWSud7AkANKUuFjMW7MwA,14283
|
|
14
14
|
bcmd/tasks/json.py,sha256=WWOyvcZPYaqQgp-Tkm-uIJschNMBKPKtZN3yXz_SC5s,635
|
|
@@ -27,8 +27,8 @@ test/conftest.py,sha256=grlPunlsvrkt_8QPckmF4POiKUPVxIxm2TPAh_ZB-zs,405
|
|
|
27
27
|
test/test_pdf.py,sha256=7yYlfydyhy2dmVYdTA5Vir2AI8TUdzEi55fL-AqJmio,1533
|
|
28
28
|
test/test_proxy.py,sha256=UMF2hFFGUEbJR1jT2mO_wdo-7Rfp0NDqIdTRnOmwtjY,164
|
|
29
29
|
test/test_wasabi.py,sha256=qqXG1Kb9hKH6t624R173j6LagkgmejN0CFYt7kL0nNs,1066
|
|
30
|
-
bcmd-0.6.
|
|
31
|
-
bcmd-0.6.
|
|
32
|
-
bcmd-0.6.
|
|
33
|
-
bcmd-0.6.
|
|
34
|
-
bcmd-0.6.
|
|
30
|
+
bcmd-0.6.13.dist-info/METADATA,sha256=gPg2qkNuXzNWfU4DdgIr17XU5QUkaaPEkkhxew1o6cs,845
|
|
31
|
+
bcmd-0.6.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
32
|
+
bcmd-0.6.13.dist-info/entry_points.txt,sha256=mriCeYh3wksKcqq3-LtzyFkSCIdN1uZc1IJwom-SW1s,34
|
|
33
|
+
bcmd-0.6.13.dist-info/top_level.txt,sha256=fYY6tRrJ_G7tn24RXAG0M5ZKbcuaQznodfX1toFPSKs,10
|
|
34
|
+
bcmd-0.6.13.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|