hyper-sdk 0.1.1__tar.gz → 0.1.2__tar.gz
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.
- {hyper_sdk-0.1.1 → hyper_sdk-0.1.2}/PKG-INFO +1 -1
- {hyper_sdk-0.1.1 → hyper_sdk-0.1.2}/hyper_sdk/akamai/sec_cpt.py +17 -1
- {hyper_sdk-0.1.1 → hyper_sdk-0.1.2}/hyper_sdk/session.py +1 -1
- {hyper_sdk-0.1.1 → hyper_sdk-0.1.2}/hyper_sdk.egg-info/PKG-INFO +1 -1
- {hyper_sdk-0.1.1 → hyper_sdk-0.1.2}/pyproject.toml +1 -1
- {hyper_sdk-0.1.1 → hyper_sdk-0.1.2}/LICENSE +0 -0
- {hyper_sdk-0.1.1 → hyper_sdk-0.1.2}/README.md +0 -0
- {hyper_sdk-0.1.1 → hyper_sdk-0.1.2}/hyper_sdk/__init__.py +0 -0
- {hyper_sdk-0.1.1 → hyper_sdk-0.1.2}/hyper_sdk/akamai/__init__.py +0 -0
- {hyper_sdk-0.1.1 → hyper_sdk-0.1.2}/hyper_sdk/akamai/pixel.py +0 -0
- {hyper_sdk-0.1.1 → hyper_sdk-0.1.2}/hyper_sdk/akamai/script_path.py +0 -0
- {hyper_sdk-0.1.1 → hyper_sdk-0.1.2}/hyper_sdk/akamai/stop_signal.py +0 -0
- {hyper_sdk-0.1.1 → hyper_sdk-0.1.2}/hyper_sdk/akamai_input.py +0 -0
- {hyper_sdk-0.1.1 → hyper_sdk-0.1.2}/hyper_sdk/incapsula/__init__.py +0 -0
- {hyper_sdk-0.1.1 → hyper_sdk-0.1.2}/hyper_sdk/incapsula/utmvc.py +0 -0
- {hyper_sdk-0.1.1 → hyper_sdk-0.1.2}/hyper_sdk/incapsula_input.py +0 -0
- {hyper_sdk-0.1.1 → hyper_sdk-0.1.2}/hyper_sdk.egg-info/SOURCES.txt +0 -0
- {hyper_sdk-0.1.1 → hyper_sdk-0.1.2}/hyper_sdk.egg-info/dependency_links.txt +0 -0
- {hyper_sdk-0.1.1 → hyper_sdk-0.1.2}/hyper_sdk.egg-info/requires.txt +0 -0
- {hyper_sdk-0.1.1 → hyper_sdk-0.1.2}/hyper_sdk.egg-info/top_level.txt +0 -0
- {hyper_sdk-0.1.1 → hyper_sdk-0.1.2}/setup.cfg +0 -0
|
@@ -34,6 +34,22 @@ class SecCptChallenge:
|
|
|
34
34
|
|
|
35
35
|
return SecCptChallenge(duration, challenge_path, challenge_data)
|
|
36
36
|
|
|
37
|
+
@staticmethod
|
|
38
|
+
def parse_from_json(json_payload: str) -> 'SecCptChallenge':
|
|
39
|
+
api_response = json.loads(json_payload)
|
|
40
|
+
|
|
41
|
+
challenge_data = SecCptChallengeData(
|
|
42
|
+
api_response.get('token', ''),
|
|
43
|
+
api_response.get('timestamp', 0),
|
|
44
|
+
api_response.get('nonce', ''),
|
|
45
|
+
api_response.get('difficulty', 0)
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
duration = api_response.get('chlg_duration', 0)
|
|
49
|
+
challenge_path = api_response.get('branding_url_content', '')
|
|
50
|
+
|
|
51
|
+
return SecCptChallenge(duration, challenge_path, challenge_data)
|
|
52
|
+
|
|
37
53
|
@staticmethod
|
|
38
54
|
def _parse_challenge_data(src: str) -> SecCptChallengeData:
|
|
39
55
|
challenge_match = sec_challenge_expr.search(src)
|
|
@@ -109,4 +125,4 @@ class SecCptChallenge:
|
|
|
109
125
|
break
|
|
110
126
|
continue
|
|
111
127
|
|
|
112
|
-
return answers
|
|
128
|
+
return answers
|
|
@@ -106,7 +106,7 @@ class Session:
|
|
|
106
106
|
def generate_signature(self) -> str:
|
|
107
107
|
claims = {
|
|
108
108
|
"key": self.api_key,
|
|
109
|
-
"exp": datetime.now(timezone.utc) + timedelta(seconds=
|
|
109
|
+
"exp": datetime.now(timezone.utc) + timedelta(seconds=60)
|
|
110
110
|
}
|
|
111
111
|
token = jwt.encode(claims, self.jwt_key, algorithm='HS256')
|
|
112
112
|
return token.decode('utf-8')
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|