tests: fix postgres e2e tests (#877)

This commit is contained in:
Elias Schneider
2025-08-24 19:15:26 +02:00
committed by GitHub
parent d0392d25ed
commit 10b087640f
4 changed files with 11 additions and 8 deletions

View File

@@ -343,7 +343,7 @@ func (s *TestService) SeedDatabase(baseURL string) error {
},
{
Base: model.Base{
ID: "b2c3d4e5-f6g7-8901-bcde-f12345678901",
ID: "dc3c9c96-714e-48eb-926e-2d7c7858e6cf",
},
Token: "PARTIAL567890ABC",
ExpiresAt: datatype.DateTime(time.Now().Add(7 * 24 * time.Hour)),
@@ -352,7 +352,7 @@ func (s *TestService) SeedDatabase(baseURL string) error {
},
{
Base: model.Base{
ID: "c3d4e5f6-g7h8-9012-cdef-123456789012",
ID: "44de1863-ffa5-4db1-9507-4887cd7a1e3f",
},
Token: "EXPIRED34567890B",
ExpiresAt: datatype.DateTime(time.Now().Add(-24 * time.Hour)), // Expired
@@ -361,7 +361,7 @@ func (s *TestService) SeedDatabase(baseURL string) error {
},
{
Base: model.Base{
ID: "d4e5f6g7-h8i9-0123-def0-234567890123",
ID: "f1b1678b-7720-4d8b-8f91-1dbff1e2d02b",
},
Token: "FULLYUSED567890C",
ExpiresAt: datatype.DateTime(time.Now().Add(24 * time.Hour)),

View File

@@ -40,7 +40,7 @@ export const oidcClients = {
id: '7c21a609-96b5-4011-9900-272b8d31a9d1',
name: 'Tailscale',
callbackUrl: 'http://tailscale/auth/callback',
secret: 'n4VfQeXlTzA6yKpWbR9uJcMdSx2qH0Lo',
secret: 'n4VfQeXlTzA6yKpWbR9uJcMdSx2qH0Lo'
},
federated: {
id: 'c48232ff-ff65-45ed-ae96-7afa8a9b443b',
@@ -116,7 +116,7 @@ export const signupTokens = {
createdAt: new Date().toISOString()
},
partiallyUsed: {
id: 'b2c3d4e5-f6g7-8901-bcde-f12345678901',
id: 'dc3c9c96-714e-48eb-926e-2d7c7858e6cf',
token: 'PARTIAL567890ABC',
expiresAt: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000).toISOString(),
usageLimit: 5,
@@ -124,7 +124,7 @@ export const signupTokens = {
createdAt: new Date(Date.now() - 2 * 24 * 60 * 60 * 1000).toISOString()
},
expired: {
id: 'c3d4e5f6-g7h8-9012-cdef-123456789012',
id: '44de1863-ffa5-4db1-9507-4887cd7a1e3f',
token: 'EXPIRED34567890B',
expiresAt: new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString(),
usageLimit: 3,
@@ -132,7 +132,7 @@ export const signupTokens = {
createdAt: new Date(Date.now() - 3 * 24 * 60 * 60 * 1000).toISOString()
},
fullyUsed: {
id: 'd4e5f6g7-h8i9-0123-def0-234567890123',
id: 'f1b1678b-7720-4d8b-8f91-1dbff1e2d02b',
token: 'FULLYUSED567890C',
expiresAt: new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString(),
usageLimit: 1,

View File

@@ -19,6 +19,9 @@ services:
extends:
file: docker-compose.yml
service: pocket-id
environment:
- DB_PROVIDER=postgres
- DB_CONNECTION_STRING=postgres://postgres:postgres@postgres:5432/pocket-id
depends_on:
postgres:
condition: service_healthy

View File

@@ -215,7 +215,7 @@ test('Refresh token fails when used for the wrong user', async ({ request }) =>
data: {
rt: token,
client: clientId,
user: 'bad-user'
user: '44cb5d71-db31-4555-9a1b-5484650f6002'
}
})
.then((r) => r.text());