pypomes-jwt 0.8.4__py3-none-any.whl → 0.8.5__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 pypomes-jwt might be problematic. Click here for more details.
- pypomes_jwt/jwt_data.py +12 -6
- pypomes_jwt/jwt_pomes.py +3 -1
- {pypomes_jwt-0.8.4.dist-info → pypomes_jwt-0.8.5.dist-info}/METADATA +1 -1
- pypomes_jwt-0.8.5.dist-info/RECORD +8 -0
- pypomes_jwt-0.8.4.dist-info/RECORD +0 -8
- {pypomes_jwt-0.8.4.dist-info → pypomes_jwt-0.8.5.dist-info}/WHEEL +0 -0
- {pypomes_jwt-0.8.4.dist-info → pypomes_jwt-0.8.5.dist-info}/licenses/LICENSE +0 -0
pypomes_jwt/jwt_data.py
CHANGED
|
@@ -35,12 +35,14 @@ class JwtData:
|
|
|
35
35
|
"token-audience": <string> # the audience the token is intended for
|
|
36
36
|
"token_nonce": <string> # value used to associate a client session with a token
|
|
37
37
|
"claims": {
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
38
|
+
"valid-from": <string> # token's start (<YYYY-MM-DD hh:mm:ss>)
|
|
39
|
+
"valid-until": <string> # token's finish (<YYYY-MM-DD hh:mm:ss>)
|
|
40
|
+
"birthdate": <string>, # subject's birth date
|
|
41
|
+
"email": <string>, # subject's email
|
|
42
|
+
"gender": <string>, # subject's gender
|
|
43
|
+
"name": <string>, # subject's name
|
|
44
|
+
"roles": <List[str]>, # subject roles
|
|
45
|
+
"nonce": <string>, # value used to associate a Client session with a token
|
|
44
46
|
...
|
|
45
47
|
}
|
|
46
48
|
},
|
|
@@ -66,6 +68,8 @@ class JwtData:
|
|
|
66
68
|
|
|
67
69
|
Account-related claims are optional claims, and convey information about the registered account they belong to.
|
|
68
70
|
Alhough they can be freely specified, these are some of the most commonly used claims:
|
|
71
|
+
"valid-from": <string> # token's start (<YYYY-MM-DD hh:mm:ss>)
|
|
72
|
+
"valid-until": <string> # token's finish (<YYYY-MM-DD hh:mm:ss>)
|
|
69
73
|
"birthdate": <string> # subject's birth date
|
|
70
74
|
"email": <string> # subject's email
|
|
71
75
|
"gender": <string> # subject's gender
|
|
@@ -238,6 +242,8 @@ class JwtData:
|
|
|
238
242
|
|
|
239
243
|
# issue a candidate refresh token first, and persist it
|
|
240
244
|
current_claims["exp"] = just_now + account_data.get("refresh-max-age")
|
|
245
|
+
current_claims["valid-from"] = datetime.fromtimestamp(timestamp=current_claims["iat"])
|
|
246
|
+
current_claims["valid-until"] = datetime.fromtimestamp(timestamp=current_claims["exp"])
|
|
241
247
|
# may raise an exception
|
|
242
248
|
refresh_token: str = jwt.encode(payload=current_claims,
|
|
243
249
|
key=JWT_ENCODING_KEY,
|
pypomes_jwt/jwt_pomes.py
CHANGED
|
@@ -379,9 +379,11 @@ def jwt_get_claims(errors: list[str] | None,
|
|
|
379
379
|
"header": {
|
|
380
380
|
"alg": "RS256",
|
|
381
381
|
"typ": "JWT",
|
|
382
|
-
"kid": "
|
|
382
|
+
"kid": "1234"
|
|
383
383
|
},
|
|
384
384
|
"payload": {
|
|
385
|
+
"valid-from": <YYYY-MM-DD hh:mm:ss>
|
|
386
|
+
"valid-until": <YYYY-MM-DD hh:mm:ss>
|
|
385
387
|
"birthdate": "1980-01-01",
|
|
386
388
|
"email": "jdoe@mail.com",
|
|
387
389
|
"exp": 1516640454,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pypomes_jwt
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.5
|
|
4
4
|
Summary: A collection of Python pomes, penyeach (JWT module)
|
|
5
5
|
Project-URL: Homepage, https://github.com/TheWiseCoder/PyPomes-JWT
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/TheWiseCoder/PyPomes-JWT/issues
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
pypomes_jwt/__init__.py,sha256=P7rT6ZVE2BzU3ntYOr83H5iOf5JcCmjDUYakNbrRAP0,1266
|
|
2
|
+
pypomes_jwt/jwt_constants.py,sha256=FA50jKQ3D09MxXkUpVkXW5IQqm_UX6qm3bU5gHvkU-4,3980
|
|
3
|
+
pypomes_jwt/jwt_data.py,sha256=wRXLM8U5gb2JYDiv0G3R4n4npZyFJ_93tFI8A4BwROc,22180
|
|
4
|
+
pypomes_jwt/jwt_pomes.py,sha256=BNL6r-IfnKKeBZFpTzFXQUnotFKgV6PeKHqar9Ys20I,17186
|
|
5
|
+
pypomes_jwt-0.8.5.dist-info/METADATA,sha256=mMCgIa9kXt8WBVxxpI86ge27VYm2gg8rBAfzmnK6_Hc,632
|
|
6
|
+
pypomes_jwt-0.8.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
7
|
+
pypomes_jwt-0.8.5.dist-info/licenses/LICENSE,sha256=NdakochSXm_H_-DSL_x2JlRCkYikj3snYYvTwgR5d_c,1086
|
|
8
|
+
pypomes_jwt-0.8.5.dist-info/RECORD,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
pypomes_jwt/__init__.py,sha256=P7rT6ZVE2BzU3ntYOr83H5iOf5JcCmjDUYakNbrRAP0,1266
|
|
2
|
-
pypomes_jwt/jwt_constants.py,sha256=FA50jKQ3D09MxXkUpVkXW5IQqm_UX6qm3bU5gHvkU-4,3980
|
|
3
|
-
pypomes_jwt/jwt_data.py,sha256=VTMPJz9CqzaxNyKdDa9cRcUbhGf8U9S6ms9XSuO-7Qg,21639
|
|
4
|
-
pypomes_jwt/jwt_pomes.py,sha256=4S-kKc-lLZg_9jMXk6T1IrBJXiUBAuC_nxhKsv6xzVk,17119
|
|
5
|
-
pypomes_jwt-0.8.4.dist-info/METADATA,sha256=ADSxeO2kePBxf5faJtwfl_zgDaDumeYjySyPVHJnM1E,632
|
|
6
|
-
pypomes_jwt-0.8.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
7
|
-
pypomes_jwt-0.8.4.dist-info/licenses/LICENSE,sha256=NdakochSXm_H_-DSL_x2JlRCkYikj3snYYvTwgR5d_c,1086
|
|
8
|
-
pypomes_jwt-0.8.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|