pyntcli 0.1.73__py3-none-any.whl → 0.1.74__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.
- pyntcli/__init__.py +1 -1
- pyntcli/analytics/send.py +32 -17
- pyntcli/auth/login.py +41 -31
- pyntcli/commands/burp.py +8 -16
- pyntcli/commands/command.py +15 -30
- pyntcli/commands/id_command.py +5 -3
- pyntcli/commands/listen.py +20 -45
- pyntcli/commands/newman.py +2 -2
- pyntcli/commands/postman.py +26 -25
- pyntcli/commands/pynt_cmd.py +27 -13
- pyntcli/commands/root.py +2 -0
- pyntcli/log/log.py +2 -1
- pyntcli/main.py +4 -3
- pyntcli/pynt_docker/pynt_container.py +65 -53
- pyntcli/store/store.py +19 -14
- {pyntcli-0.1.73.dist-info → pyntcli-0.1.74.dist-info}/METADATA +1 -1
- {pyntcli-0.1.73.dist-info → pyntcli-0.1.74.dist-info}/RECORD +21 -21
- tests/auth/test_login.py +17 -19
- {pyntcli-0.1.73.dist-info → pyntcli-0.1.74.dist-info}/WHEEL +0 -0
- {pyntcli-0.1.73.dist-info → pyntcli-0.1.74.dist-info}/entry_points.txt +0 -0
- {pyntcli-0.1.73.dist-info → pyntcli-0.1.74.dist-info}/top_level.txt +0 -0
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
pyntcli/__init__.py,sha256=
|
|
2
|
-
pyntcli/main.py,sha256=
|
|
1
|
+
pyntcli/__init__.py,sha256=KewwZnnRMQkstdiLHG6R7ciil5WtDn_QVk-Z392irYc,23
|
|
2
|
+
pyntcli/main.py,sha256=intiqInoRbIF_lE8ilxQBP5aloPAtAvUBdF4k0Rqfxw,4289
|
|
3
3
|
pyntcli/analytics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
pyntcli/analytics/send.py,sha256=
|
|
4
|
+
pyntcli/analytics/send.py,sha256=cKvMw4HIGJGLip5OMPqTv1AJDlKlc_Uk2Sfcl0e3QLE,2845
|
|
5
5
|
pyntcli/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
pyntcli/auth/login.py,sha256=
|
|
6
|
+
pyntcli/auth/login.py,sha256=CosHIB1HHWa3cGjpE4uHNxsi_7SPL-I6Da0zCq3OcmU,5012
|
|
7
7
|
pyntcli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
-
pyntcli/commands/burp.py,sha256=
|
|
9
|
-
pyntcli/commands/command.py,sha256=
|
|
8
|
+
pyntcli/commands/burp.py,sha256=tbGpKP4NEuEZYSuBxqvLJaC4kRqtv0GO6BpBfPX2DRM,10397
|
|
9
|
+
pyntcli/commands/command.py,sha256=UvJEHv69iQ03R0pN2RCsi3my48xwSMoDBTvcnbg_XzE,9477
|
|
10
10
|
pyntcli/commands/har.py,sha256=Iq0455umKvlcMxcU4l70-NIZh7Wovry3f76u68drmQ4,3654
|
|
11
|
-
pyntcli/commands/id_command.py,sha256=
|
|
12
|
-
pyntcli/commands/listen.py,sha256=
|
|
13
|
-
pyntcli/commands/newman.py,sha256=
|
|
14
|
-
pyntcli/commands/postman.py,sha256=
|
|
15
|
-
pyntcli/commands/pynt_cmd.py,sha256=
|
|
16
|
-
pyntcli/commands/root.py,sha256=
|
|
11
|
+
pyntcli/commands/id_command.py,sha256=UBEgMIpm4vauTCsKyixltiGUolNg_OfHEJvJ_i5BpJY,943
|
|
12
|
+
pyntcli/commands/listen.py,sha256=ZfzCM8P0TVweC42NCL24_1yK48_NvRER6Vi8_oChaT0,8450
|
|
13
|
+
pyntcli/commands/newman.py,sha256=ctq9cuEH1GnFOhGshAn6eNfyw3rrrLMaeoWIVcf9JQs,4826
|
|
14
|
+
pyntcli/commands/postman.py,sha256=yPE8jBITEhDT7htUaa7r2jxKfHwuSKj9177HGinABCs,4938
|
|
15
|
+
pyntcli/commands/pynt_cmd.py,sha256=KOl9guUtesO2JcMM5nPKKkjnK6F9HV4jHHcoUk4KVhw,2825
|
|
16
|
+
pyntcli/commands/root.py,sha256=GijCi8hqe8sXEo6faWimlCmT8d782yjrw1IWJT5RAMk,3320
|
|
17
17
|
pyntcli/commands/sub_command.py,sha256=GF3-rE_qk2L4jGPFqHLm9SdGINmu3EakhjJTFyWjRms,374
|
|
18
18
|
pyntcli/commands/util.py,sha256=IREZvHYJ7wEth8ujOkk5ZXZ4UrUA7jDv134_UueED4s,2995
|
|
19
19
|
pyntcli/log/__init__.py,sha256=cOGwOYzMoshEbZiiasBGkj6wF0SBu3Jdpl-AuakDesw,19
|
|
20
|
-
pyntcli/log/log.py,sha256=
|
|
20
|
+
pyntcli/log/log.py,sha256=cWCdWmUaAwePwdhYDcgNMEG9d9RM34sGahxBCYEdv2Y,1069
|
|
21
21
|
pyntcli/pynt_docker/__init__.py,sha256=PQIOVxc7XXtMLfEX7ojgwf_Z3mmTllO3ZvzUZTPOxQY,30
|
|
22
|
-
pyntcli/pynt_docker/pynt_container.py,sha256=
|
|
22
|
+
pyntcli/pynt_docker/pynt_container.py,sha256=rMHdTOace-hJjhKbY8u9VxrVG6J5ymfEYiCGBGrIiEI,8332
|
|
23
23
|
pyntcli/store/__init__.py,sha256=xuS9OB21F6B1sUx5XPGxz_6WpG6-KTMbuq50RrZS5OY,29
|
|
24
24
|
pyntcli/store/json_connector.py,sha256=UGs3uORw3iyn0YJ8kzab-veEZToA6d-ByXYuqEleWsA,560
|
|
25
|
-
pyntcli/store/store.py,sha256=
|
|
25
|
+
pyntcli/store/store.py,sha256=Kf4IFCAu0i0DPVGgntrSYUiwz6kmW9HvItKnCT-MosE,1905
|
|
26
26
|
pyntcli/store/store_connector.py,sha256=w4LzcpRZesUZL1f63RmLlWEFRtJ6Y6rcS6PkkGtO4MA,357
|
|
27
27
|
pyntcli/transport/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
28
28
|
pyntcli/transport/pynt_requests.py,sha256=KiEG3hNcwY7DLIJDCq-7LIPq54yYQcDBhHe3KhpqRTc,1563
|
|
@@ -32,10 +32,10 @@ pyntcli/ui/pynt_errors.py,sha256=UAr8OV5EM4zLhfWSmK_qss8nal2Ezo66Dk8ZMvR_RTs,546
|
|
|
32
32
|
pyntcli/ui/report.py,sha256=W-icPSZrGLOubXgam0LpOvHLl_aZg9Zx9qIkL8Ym5PE,1930
|
|
33
33
|
pyntcli/ui/ui_thread.py,sha256=OVTbiIFMg2KgxAvHf7yy86xGm4RVS2vj_VYZkMi-SRY,4956
|
|
34
34
|
tests/conftest.py,sha256=gToq5K74GtgeGQXjFvXSzMaE6axBYxAzcFG5XJPOXjI,427
|
|
35
|
-
tests/auth/test_login.py,sha256=
|
|
35
|
+
tests/auth/test_login.py,sha256=juYxYZWfNmAuwm-ygGEF5gjzaR9LcimonDr7pN5vgLI,3209
|
|
36
36
|
tests/store/test_cred_store.py,sha256=_7-917EtNC9eKEumO2_lt-7KuDmCwOZFaowCm7DbA_A,254
|
|
37
|
-
pyntcli-0.1.
|
|
38
|
-
pyntcli-0.1.
|
|
39
|
-
pyntcli-0.1.
|
|
40
|
-
pyntcli-0.1.
|
|
41
|
-
pyntcli-0.1.
|
|
37
|
+
pyntcli-0.1.74.dist-info/METADATA,sha256=mEvK3_PCXXcU-hNBhwdEsB5ZHWkf6doTvEtYCeSXZxw,463
|
|
38
|
+
pyntcli-0.1.74.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
39
|
+
pyntcli-0.1.74.dist-info/entry_points.txt,sha256=kcGmqAxXDttNk2EPRcqunc_LTVp61gzakz0v-GEE2SY,43
|
|
40
|
+
pyntcli-0.1.74.dist-info/top_level.txt,sha256=u9MDStwVHB7UG8PUcODeWCul_NvzL2EzoLvSlgwLHFs,30
|
|
41
|
+
pyntcli-0.1.74.dist-info/RECORD,,
|
tests/auth/test_login.py
CHANGED
|
@@ -10,7 +10,7 @@ import os
|
|
|
10
10
|
from cryptography.hazmat.primitives.asymmetric import rsa
|
|
11
11
|
from cryptography.hazmat.primitives import serialization
|
|
12
12
|
|
|
13
|
-
from pyntcli.auth.login import Login, Timeout, InvalidTokenInEnvVarsException, is_jwt_expired, should_login,
|
|
13
|
+
from pyntcli.auth.login import Login, Timeout, InvalidTokenInEnvVarsException, is_jwt_expired, should_login, PYNT_ID
|
|
14
14
|
from pyntcli.store import CredStore
|
|
15
15
|
|
|
16
16
|
|
|
@@ -22,8 +22,8 @@ class TestLogin():
|
|
|
22
22
|
yield
|
|
23
23
|
finally:
|
|
24
24
|
pass
|
|
25
|
-
|
|
26
|
-
def get_request_url_parameters(self, req: requests.PreparedRequest)
|
|
25
|
+
|
|
26
|
+
def get_request_url_parameters(self, req: requests.PreparedRequest):
|
|
27
27
|
u = req.url
|
|
28
28
|
parsed_url = urlparse(u)
|
|
29
29
|
return parsed_url.query
|
|
@@ -36,7 +36,7 @@ class TestLogin():
|
|
|
36
36
|
if self.login_request_cnt < 2:
|
|
37
37
|
resp.status_code = 404
|
|
38
38
|
return resp
|
|
39
|
-
|
|
39
|
+
|
|
40
40
|
resp.status_code = 200
|
|
41
41
|
resp._content = json.dumps({"token": "testToken"}).encode()
|
|
42
42
|
return resp
|
|
@@ -44,53 +44,51 @@ class TestLogin():
|
|
|
44
44
|
def test_login(self, mock_webbrowser, mock_sleep, mock_expanduser):
|
|
45
45
|
l = Login()
|
|
46
46
|
self.login_request_cnt = 0
|
|
47
|
-
with requests_mock.mock() as m:
|
|
47
|
+
with requests_mock.mock() as m:
|
|
48
48
|
m.add_matcher(self.poll_matcher)
|
|
49
|
-
l.login()
|
|
49
|
+
l.login()
|
|
50
50
|
|
|
51
51
|
assert self.login_request_cnt == 2
|
|
52
52
|
c = CredStore()
|
|
53
53
|
assert c.get("token") == {"token": "testToken"}
|
|
54
54
|
|
|
55
55
|
def test_login_timeout(self, mock_webbrowser, mock_sleep, mock_expanduser):
|
|
56
|
-
l = Login()
|
|
56
|
+
l = Login()
|
|
57
57
|
l.login_wait_period = 0
|
|
58
58
|
self.login_request_cnt = 0
|
|
59
59
|
with pytest.raises(Timeout):
|
|
60
60
|
with requests_mock.mock() as m:
|
|
61
61
|
m.add_matcher(self.poll_matcher)
|
|
62
62
|
l.get_token_using_request_id("some_id")
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
|
|
65
64
|
def test_is_jwt_expired(self):
|
|
66
65
|
|
|
67
66
|
private_key = rsa.generate_private_key(
|
|
68
67
|
public_exponent=65537,
|
|
69
68
|
key_size=2048
|
|
70
69
|
).private_bytes(encoding=serialization.Encoding.PEM,
|
|
71
|
-
format=serialization.PrivateFormat.PKCS8,
|
|
70
|
+
format=serialization.PrivateFormat.PKCS8,
|
|
72
71
|
encryption_algorithm=serialization.NoEncryption())
|
|
73
72
|
|
|
74
|
-
|
|
75
73
|
token_data = {
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
"exp": int((datetime.datetime.now() - datetime.timedelta(days=1)).timestamp())
|
|
75
|
+
}
|
|
78
76
|
|
|
79
77
|
token = jwt.encode(token_data, private_key.decode(), algorithm="RS256").decode("utf-8")
|
|
80
78
|
assert is_jwt_expired(token) == True
|
|
81
79
|
|
|
82
80
|
token_data = {
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
"exp": int((datetime.datetime.now() + datetime.timedelta(days=1)).timestamp())
|
|
82
|
+
}
|
|
85
83
|
|
|
86
84
|
token = jwt.encode(token_data, private_key.decode(), algorithm="RS256").decode("utf-8")
|
|
87
85
|
assert is_jwt_expired(token) == False
|
|
88
86
|
|
|
89
87
|
def test_login_using_env_vars(self, mocker, mock_expanduser):
|
|
90
88
|
creds = json.dumps({"token": {"refresh_token": "some data"}})
|
|
91
|
-
mocker.patch.dict(os.environ, {
|
|
92
|
-
assert should_login() == False
|
|
93
|
-
|
|
94
|
-
os.environ[
|
|
89
|
+
mocker.patch.dict(os.environ, {PYNT_ID: creds})
|
|
90
|
+
assert should_login() == False
|
|
91
|
+
|
|
92
|
+
os.environ[PYNT_ID] = "some bad credentials"
|
|
95
93
|
with pytest.raises(InvalidTokenInEnvVarsException):
|
|
96
94
|
should_login()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|