mirror of
https://github.com/immich-app/immich
synced 2026-04-21 13:37:38 +00:00
* feat(server): added backchannel logout api endpoint * test(server): fixed e2e tests * fix(server): fixed suggested changes by reviewer * feat(server): created function invalidateOAuth * fix(server): fixed session.repository.sql * test(server): added unit tests for backchannelLogout function * test(server): added e2e tests for oidc backchnnel logout * docs(server): added documentation on backchannel logout url * docs(server): fixed typo * feat(server): minor improvements of the oidc backchannel logout * test(server): fixed tests after merge with main * fix(server): fixed e2e test file * refactor(server): tiny refactor of validateLogoutToken * chore: cleanup * fix: tests * fix: make jwks extractable --------- Co-authored-by: Daniel Dietzler <mail@ddietzler.dev>
36 lines
931 B
TypeScript
36 lines
931 B
TypeScript
import { Selectable } from 'kysely';
|
|
import { SessionTable } from 'src/schema/tables/session.table';
|
|
import { SessionLike } from 'test/factories/types';
|
|
import { newDate, newUuid, newUuidV7 } from 'test/small.factory';
|
|
|
|
export class SessionFactory {
|
|
private constructor(private value: Selectable<SessionTable>) {}
|
|
|
|
static create(dto: SessionLike = {}) {
|
|
return SessionFactory.from(dto).build();
|
|
}
|
|
|
|
static from(dto: SessionLike = {}) {
|
|
return new SessionFactory({
|
|
appVersion: null,
|
|
createdAt: newDate(),
|
|
deviceOS: 'android',
|
|
deviceType: 'mobile',
|
|
expiresAt: null,
|
|
id: newUuid(),
|
|
isPendingSyncReset: false,
|
|
parentId: null,
|
|
pinExpiresAt: null,
|
|
token: Buffer.from('abc123'),
|
|
updateId: newUuidV7(),
|
|
updatedAt: newDate(),
|
|
userId: newUuid(),
|
|
oauthSid: newUuid(),
|
|
...dto,
|
|
});
|
|
}
|
|
|
|
build() {
|
|
return { ...this.value };
|
|
}
|
|
}
|