pypomes-jwt 0.9.3__tar.gz → 0.9.4__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.

Potentially problematic release.


This version of pypomes-jwt might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pypomes_jwt
3
- Version: 0.9.3
3
+ Version: 0.9.4
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
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
6
6
 
7
7
  [project]
8
8
  name = "pypomes_jwt"
9
- version = "0.9.3"
9
+ version = "0.9.4"
10
10
  authors = [
11
11
  { name="GT Nunes", email="wisecoder01@gmail.com" }
12
12
  ]
@@ -94,10 +94,8 @@ def jwt_set_account(account_id: str,
94
94
  access_max_age: int = JWT_ACCESS_MAX_AGE,
95
95
  refresh_max_age: int = JWT_REFRESH_MAX_AGE,
96
96
  grace_interval: int = None,
97
- token_audience: str = None,
98
- token_nonce: str = None,
99
97
  request_timeout: int = None,
100
- remote_provider: bool = True,
98
+ remote_provider: bool = None,
101
99
  logger: Logger = None) -> None:
102
100
  """
103
101
  Set the data needed to obtain JWT tokens for *account_id*.
@@ -108,8 +106,6 @@ def jwt_set_account(account_id: str,
108
106
  :param access_max_age: access token duration, in seconds
109
107
  :param refresh_max_age: refresh token duration, in seconds
110
108
  :param grace_interval: optional time to wait for token to be valid, in seconds
111
- :param token_audience: optional audience the token is intended for
112
- :param token_nonce: optional value used to associate a client session with a token
113
109
  :param request_timeout: timeout for the requests to the reference URL
114
110
  :param remote_provider: whether the JWT provider is a remote server
115
111
  :param logger: optional logger
@@ -132,8 +128,6 @@ def jwt_set_account(account_id: str,
132
128
  access_max_age=access_max_age,
133
129
  refresh_max_age=refresh_max_age,
134
130
  grace_interval=grace_interval,
135
- token_audience=token_audience,
136
- token_nonce=token_nonce,
137
131
  request_timeout=request_timeout,
138
132
  remote_provider=remote_provider,
139
133
  logger=logger)
@@ -455,7 +449,8 @@ def jwt_refresh_tokens(errors: list[str] | None,
455
449
  # issue tokens
456
450
  result = jwt_issue_tokens(errors=errors,
457
451
  account_id=account_id,
458
- account_claims=account_claims)
452
+ account_claims=account_claims,
453
+ logger=logger)
459
454
  else:
460
455
  op_errors.append("Refresh token was not provided")
461
456
 
@@ -33,9 +33,7 @@ class JwtRegistry:
33
33
  "access-max-age": <int>, # in seconds - defaults to JWT_ACCESS_MAX_AGE
34
34
  "refresh-max-age": <int>, # in seconds - defaults to JWT_REFRESH_MAX_AGE
35
35
  "grace-interval": <int> # time to wait for token to be valid, in seconds
36
- # optional
37
- "token-audience": <string> # the audience the token is intended for
38
- "token_nonce": <string> # value used to associate a client session with a token
36
+ "request-timeout": <int> # timeout for the requests to the reference URL (in seconds)
39
37
  "claims": {
40
38
  "valid-from": <string> # token's start (<YYYY-MM-DDThh:mm:ss+00:00>)
41
39
  "valid-until": <string> # token's finish (<YYYY-MM-DDThh:mm:ss+00:00>)
@@ -45,7 +43,7 @@ class JwtRegistry:
45
43
  "gender": <string>, # subject's gender
46
44
  "name": <string>, # subject's name
47
45
  "roles": <List[str]>, # subject roles
48
- "nonce": <string>, # value used to associate a Client session with a token
46
+ "nonce": <string>, # used to associate a Client session with a token
49
47
  ...
50
48
  }
51
49
  },
@@ -78,7 +76,7 @@ class JwtRegistry:
78
76
  "gender": <string> # subject's gender
79
77
  "name": <string> # subject's name
80
78
  "roles": <List[str]> # subject roles
81
- "nonce": <string> # value used to associate a client session with a token
79
+ "nonce": <string> # used to associate a client session with a token
82
80
 
83
81
  The token header has these items:
84
82
  "alg": <string> # the algorithm used to sign the token (one of *HS256*, *HS51*', *RSA256*, *RSA512*)
@@ -101,11 +99,9 @@ class JwtRegistry:
101
99
  claims: dict[str, Any],
102
100
  access_max_age: int,
103
101
  refresh_max_age: int,
104
- grace_interval: int,
105
- token_audience: str,
106
- token_nonce: str,
107
- request_timeout: int,
108
- remote_provider: bool,
102
+ grace_interval: int | None,
103
+ request_timeout: int | None,
104
+ remote_provider: bool | None,
109
105
  logger: Logger = None) -> None:
110
106
  """
111
107
  Add to storage the parameters needed to produce and validate JWT tokens for *account_id*.
@@ -121,9 +117,7 @@ class JwtRegistry:
121
117
  :param access_max_age: access token duration, in seconds
122
118
  :param refresh_max_age: refresh token duration, in seconds
123
119
  :param grace_interval: time to wait for token to be valid, in seconds
124
- :param token_audience: the audience the token is intended for
125
- :param token_nonce: optional value used to associate a client session with a token
126
- :param request_timeout: timeout for the requests to the reference URL
120
+ :param request_timeout: timeout for the requests to the reference URL (in seconds)
127
121
  :param remote_provider: whether the JWT provider is a remote server
128
122
  :param logger: optional logger
129
123
  """
@@ -135,8 +129,6 @@ class JwtRegistry:
135
129
  "access-max-age": access_max_age,
136
130
  "refresh-max-age": refresh_max_age,
137
131
  "grace-interval": grace_interval,
138
- "token-audience": token_audience,
139
- "token-nonce": token_nonce,
140
132
  "request-timeout": request_timeout,
141
133
  "remote-provider": remote_provider,
142
134
  "claims": claims or {}
File without changes
File without changes
File without changes