Skip to content

Commit 456edf5

Browse files
committed
Fix test suite failure edge case
This could *rarely* fail, because if it runs really close to the integer timestamp ticking over (e.g. at sometime.999), we could end up with an integer timestamp that ticks over and passes validation when it shouldn't because the server processing code gets it at (sometime+1).001. Increase it by 1 to avoid the error.
1 parent 4f50b19 commit 456edf5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/test_auth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,13 +274,13 @@ def test_auth_malformed(client, db):
274274

275275
# Bad timestamps
276276
r = client.get(
277-
"/auth_test/whoami", headers=x_sogs(a, B, 'GET', '/auth_test/whoami', timestamp_off=86401)
277+
"/auth_test/whoami", headers=x_sogs(a, B, 'GET', '/auth_test/whoami', timestamp_off=86402)
278278
)
279279
assert r.status_code == 425
280280
assert r.data == b'Invalid authentication: X-SOGS-Timestamp is too far from current time'
281281

282282
r = client.get(
283-
"/auth_test/whoami", headers=x_sogs(a, B, 'GET', '/auth_test/whoami', timestamp_off=-86401)
283+
"/auth_test/whoami", headers=x_sogs(a, B, 'GET', '/auth_test/whoami', timestamp_off=-86402)
284284
)
285285
assert r.status_code == 425
286286
assert r.data == b'Invalid authentication: X-SOGS-Timestamp is too far from current time'

0 commit comments

Comments
 (0)