feat(knex): create database interfaces and knexjs nest integration

Co-authored-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
Erik Michelson 2025-03-06 12:59:59 +01:00
parent 902abf72e6
commit a9183e82bf
No known key found for this signature in database
GPG key ID: DB99ADDDC5C0AF82
93 changed files with 760 additions and 2927 deletions

View file

@ -0,0 +1,32 @@
/*
* SPDX-FileCopyrightText: 2025 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { ProviderType } from '../auth/provider-type.enum';
/**
* An auth identity holds the information how a {@link User} can authenticate themself using a certain auth provider
*/
export interface Identity {
/** The id of the user */
userId: number;
/** The type of the auth provider */
providerType: ProviderType;
/** The identifier of the auth provider, e.g. gitlab */
providerIdentifier: string | null;
/** Timestamp when this identity was created */
createdAt: Date;
/** Timestamp when this identity was last updated */
updatedAt: Date;
/** The remote id of the user at the auth provider or null for local identities */
providerUserId: string | null;
/** The hashed password for local identities or null for other auth providers */
passwordHash: string | null;
}