Skip to content

Commit c9daffc

Browse files
committed
Make is_valid_jwt private
1 parent 6b6c66a commit c9daffc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/test_session.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def test_authenticate_success(TEST_CONSTANTS, mock_user_management):
191191
}
192192

193193
with patch.object(Session, "unseal_data", return_value=mock_session), patch.object(
194-
session, "is_valid_jwt", return_value=True
194+
session, "_is_valid_jwt", return_value=True
195195
), patch("jwt.decode", return_value=mock_jwt_payload), patch.object(
196196
session.jwks,
197197
"get_signing_key_from_jwt",
@@ -264,7 +264,7 @@ def test_refresh_success(TEST_CONSTANTS, mock_user_management):
264264
cookie_password=TEST_CONSTANTS["COOKIE_PASSWORD"],
265265
)
266266

267-
with patch.object(session, "is_valid_jwt", return_value=True) as _:
267+
with patch.object(session, "_is_valid_jwt", return_value=True) as _:
268268
with patch(
269269
"jwt.decode",
270270
return_value={

workos/session.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def authenticate(
7171
reason=AuthenticateWithSessionCookieFailureReason.INVALID_SESSION_COOKIE,
7272
)
7373

74-
if not self.is_valid_jwt(session["access_token"]):
74+
if not self._is_valid_jwt(session["access_token"]):
7575
return AuthenticateWithSessionCookieErrorResponse(
7676
authenticated=False,
7777
reason=AuthenticateWithSessionCookieFailureReason.INVALID_JWT,
@@ -172,7 +172,7 @@ def get_logout_url(self) -> str:
172172
)
173173
return str(result)
174174

175-
def is_valid_jwt(self, token: str) -> bool:
175+
def _is_valid_jwt(self, token: str) -> bool:
176176
try:
177177
signing_key = self.jwks.get_signing_key_from_jwt(token)
178178
jwt.decode(token, signing_key.key, algorithms=self.jwk_algorithms)

0 commit comments

Comments
 (0)