Commit 2a0d7404739b5e2d5222292baebfe2c5edefb68d
1 parent
239bd679
更新
Showing
5 changed files
with
7 additions
and
6 deletions
commons/api/doLogin.py
... | ... | @@ -12,12 +12,13 @@ |
12 | 12 | import requests |
13 | 13 | import json |
14 | 14 | from commons.scripts.readConf import readConfig |
15 | +from commons.scripts.pwdCry import pwdCry | |
15 | 16 | |
16 | 17 | class doLogin(): |
17 | 18 | def __init__(self): |
18 | 19 | rC = readConfig() |
19 | 20 | self.userName = rC.returnOptionsItems("loginInfo","userName") |
20 | - self.password = rC.returnOptionsItems("loginInfo","password") | |
21 | + self.password = pwdCry(rC.returnOptionsItems("loginInfo","password")) | |
21 | 22 | self.loginUrl = rC.returnOptionsItems("host","uapHost")+"/api/authenticationApi/loginWeb" |
22 | 23 | self.loginData = {"userName":self.userName,"password":self.password} |
23 | 24 | self.webHeaders = {"X-Requested-With":"XMLHttpRequest", | ... | ... |
commons/clientSession.py
... | ... | @@ -12,6 +12,7 @@ |
12 | 12 | import requests |
13 | 13 | import json |
14 | 14 | from commons.scripts.readConf import readConfig |
15 | +from commons.scripts.pwdCry import pwdCry | |
15 | 16 | |
16 | 17 | class cliSession(object): |
17 | 18 | def __init__(self): |
... | ... | @@ -20,7 +21,7 @@ class cliSession(object): |
20 | 21 | def __init__(self): |
21 | 22 | rC = readConfig() |
22 | 23 | self.userName = rC.returnOptionsItems("loginInfo","userName") |
23 | - self.password = rC.returnOptionsItems("loginInfo","password") | |
24 | + self.password = pwdCry(rC.returnOptionsItems("loginInfo","password")) | |
24 | 25 | self.loginUrl = rC.returnOptionsItems("host","uapHost")+"/api/authenticationApi/loginWeb" |
25 | 26 | self.loginData = {"userName":self.userName,"password":self.password} |
26 | 27 | self.webHeaders = {"X-Requested-With":"XMLHttpRequest", | ... | ... |
commons/scripts/pwdCry.py
... | ... | @@ -17,7 +17,6 @@ def pwdCry(string): |
17 | 17 | public_key = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCgN7kda5L4ztOUquoHjubQIEyqBpjpaYeq+DBKXA3JNOZsMjGwLGVqfCwQg3HHAGTaWnxsp5gjmh0tSziJFgQf2u45TqA2UObOvklRhbWr56QoTNsjm72wZoSOlUzW3xHi/6PocHdy/7bMOiDf6fmYhFBZdRleX6tCAp7w6DsdbQIDAQAB' |
18 | 18 | key = '-----BEGIN PUBLIC KEY-----\n' + public_key + '\n-----END PUBLIC KEY-----' |
19 | 19 | rsakey = RSA.importKey(key) |
20 | - print(rsakey) | |
21 | 20 | cipher = Cipher_pksc1_v1_5.new(rsakey) |
22 | 21 | encrypt_text = cipher.encrypt(string.encode("utf-8")) |
23 | 22 | cipher_text = base64.b64encode(encrypt_text) | ... | ... |
config/marketConfig/test_config_hg
report/test.log