feat(core): Allow enforcement of MFA usage on instance (#16556)

Co-authored-by: Marc Littlemore <marc@n8n.io>
Co-authored-by: Csaba Tuncsik <csaba.tuncsik@gmail.com>
This commit is contained in:
Andreas Fitzek
2025-07-02 11:03:10 +02:00
committed by GitHub
parent 060acd2db8
commit 657e5a3b3a
56 changed files with 619 additions and 88 deletions

View File

@@ -114,6 +114,7 @@ export interface PublicUser {
isOwner?: boolean;
featureFlags?: FeatureFlags; // External type from n8n-workflow
lastActiveAt?: Date | null;
mfaAuthenticated?: boolean;
}
export type UserSettings = Pick<User, 'id' | 'settings'>;
@@ -367,6 +368,10 @@ export type APIRequest<
browserId?: string;
};
export type AuthenticationInformation = {
usedMfa: boolean;
};
export type AuthenticatedRequest<
RouteParams = {},
ResponseBody = {},
@@ -374,6 +379,7 @@ export type AuthenticatedRequest<
RequestQuery = {},
> = Omit<APIRequest<RouteParams, ResponseBody, RequestBody, RequestQuery>, 'user' | 'cookies'> & {
user: User;
authInfo?: AuthenticationInformation;
cookies: Record<string, string | undefined>;
headers: express.Request['headers'] & {
'push-ref': string;