Files
workavia-drive/tdrive/backend/node/src/services/console/entities/session.ts
T
Montassar Ghanmy b4412d3ed3 🔐 OIDC back-channel logout (#521)
* feat: oidc backchannel session storage
* feat: oidc backchannel logout
* ref: e2e test
* 🛠️ Code review
* ♻️ Do not mock internal auth token but call "/login" with oidc_token instead
* ♻️ Refactoring for back-channel logout test
* fix: feedback and e2e tests
* feat: more e2e tests
* ♻️ Added test to test multiple login requests flow
* ref: jwt sid verifier and e2e tests

---------

Co-authored-by: Monta <monta@HP-ProBook-445-14-inch-G9-Notebook-PC-505aadfc.localdomain>
Co-authored-by: Anton SHEPILOV <ashepilov@linagora.com>
2024-05-24 13:52:58 +02:00

27 lines
629 B
TypeScript

import { merge } from "lodash";
import { Column, Entity } from "../../../core/platform/services/database/services/orm/decorators";
export const TYPE = "session";
@Entity(TYPE, {
primaryKey: [["company_id"], "sid"],
globalIndexes: [["sid"]],
type: TYPE,
})
export default class Session {
@Column("company_id", "uuid")
company_id: string;
@Column("sub", "string")
sub: string;
@Column("sid", "string")
sid: string;
}
export type UserSessionPrimaryKey = Pick<Session, "sid">;
export function getInstance(session: Partial<Session> & UserSessionPrimaryKey): Session {
return merge(new Session(), session);
}