Skip to content

armgit / ARES

Public Imported from GitHub
0

ARES - authorized red-team engagement automation with dashboard, campaign scope, module orchestration, OPSEC controls, encrypted vault, and reporting.

test(postgres): maintain valid refresh family expiry and retention order constraints in mutation test

Mafifrizib579885080b1
diff --git a/tests/integration/test_postgres_websocket_tickets.py b/tests/integration/test_postgres_websocket_tickets.py
index 1efd656..bd43932 100644
--- a/tests/integration/test_postgres_websocket_tickets.py
+++ b/tests/integration/test_postgres_websocket_tickets.py
@@ -1674,13 +1674,25 @@ async def test_postgres_bearer_resolver_mutation_matrix_and_pool_recovery() -> N
)
async with database._pool.acquire() as connection:
await connection.execute(
- "UPDATE refresh_token_families SET absolute_expires_at=now() - interval '1 hour' WHERE id=$1",
+ """
+ UPDATE refresh_token_families
+ SET created_at=now() - interval '2 days',
+ absolute_expires_at=now() - interval '1 day',
+ retain_until=now() + interval '1 day'
+ WHERE id=$1
+ """,
consumed.bearer_family_id,
)
expired = await database.resolve_websocket_ticket_principal(consumed)
async with database._pool.acquire() as connection:
await connection.execute(
- "UPDATE refresh_token_families SET absolute_expires_at=now() + interval '30 days' WHERE id=$1",
+ """
+ UPDATE refresh_token_families
+ SET created_at=now(),
+ absolute_expires_at=now() + interval '30 days',
+ retain_until=now() + interval '60 days'
+ WHERE id=$1
+ """,
consumed.bearer_family_id,
)
recovered = await database.resolve_websocket_ticket_principal(consumed)