mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-02 11:56:53 +00:00
Instrument /v2/svr/auth/check credential age
This commit is contained in:
1 parent
0357b25f92
commit
fb1c20582e
4 files changed
+71
-28
No files matched your search
+4
-2
@@ -148,8 +148,10 @@ class ExternalServiceCredentialsGeneratorTest {
|
||||
final long elapsedSeconds = 10000;
|
||||
clock.incrementSeconds(elapsedSeconds);
|
||||
|
||||
assertEquals(standardGenerator.validateAndGetTimestamp(standardCredentials, elapsedSeconds + 1).orElseThrow(), TIME_SECONDS);
|
||||
assertTrue(standardGenerator.validateAndGetTimestamp(standardCredentials, elapsedSeconds - 1).isEmpty());
|
||||
final Long timestamp = standardGenerator.validateAndGetTimestamp(standardCredentials).orElseThrow();
|
||||
|
||||
assertFalse(standardGenerator.isCredentialExpired(timestamp, elapsedSeconds + 1));
|
||||
assertTrue(standardGenerator.isCredentialExpired(timestamp, elapsedSeconds - 1));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in new issue
Block a user