refactor(core): Standardize filename casing for controllers and databases (no-changelog) (#10564)

This commit is contained in:
Iván Ovejero
2024-08-27 16:44:32 +02:00
committed by GitHub
parent be52176585
commit fd58a272e1
264 changed files with 566 additions and 565 deletions

View File

@@ -0,0 +1,34 @@
import { Column, Entity, ManyToOne, PrimaryColumn, Unique } from '@n8n/typeorm';
import { WithTimestamps } from './abstract-entity';
import { User } from './User';
export type AuthProviderType = 'ldap' | 'email' | 'saml'; // | 'google';
@Entity()
@Unique(['providerId', 'providerType'])
export class AuthIdentity extends WithTimestamps {
@Column()
userId: string;
@ManyToOne(() => User, (user) => user.authIdentities)
user: User;
@PrimaryColumn()
providerId: string;
@PrimaryColumn()
providerType: AuthProviderType;
static create(
user: User,
providerId: string,
providerType: AuthProviderType = 'ldap',
): AuthIdentity {
const identity = new AuthIdentity();
identity.user = user;
identity.userId = user.id;
identity.providerId = providerId;
identity.providerType = providerType;
return identity;
}
}