Skip to content

Commit

Permalink
Fix invalid references in unit tests
Browse files Browse the repository at this point in the history
Replace validation that auth and refresh tokens match
  • Loading branch information
NeonDaniel committed Nov 22, 2024
1 parent b1d3b03 commit e843bbf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions neon_hana/auth/client_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,9 @@ def check_refresh_request(self, access_token: Optional[str],
except ExpiredSignatureError:
raise HTTPException(status_code=401,
detail="Refresh token is expired")
# if refresh_data.jti != token_data.jti + ".refresh":
# raise HTTPException(status_code=403,
# detail="Refresh and access token mismatch")
if refresh_data.jti != token_data.jti + ".refresh":
raise HTTPException(status_code=403,
detail="Refresh and access token mismatch")
if time() > refresh_data.exp:
raise HTTPException(status_code=401,
detail="Refresh token is expired")
Expand Down
4 changes: 2 additions & 2 deletions tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ def test_check_refresh_request(self):

# Test valid refresh
valid_refresh = self.client_manager.check_refresh_request(
access, refresh, config.client_id)
self.assertEqual(valid_refresh.client_id, config.client_id)
access, refresh, config['access'].client_id)
self.assertEqual(valid_refresh.client_id, config['access'].client_id)
self.assertNotEqual(valid_refresh.access_token, access)
self.assertNotEqual(valid_refresh.refresh_token, refresh)

Expand Down

0 comments on commit e843bbf

Please sign in to comment.