ToolJet/server/src/entities/sso_config.entity.ts
Midhun G S b710d7b02e
SSO for GitHub Enterprise self hosted (#3352)
* SSO for GitHub Enterprise self hosted

* changes

* test cases

* fixes

* label fix

* fixes

* readme changes
2022-07-29 17:03:42 +05:30

46 lines
976 B
TypeScript

import {
Entity,
Column,
PrimaryGeneratedColumn,
CreateDateColumn,
UpdateDateColumn,
ManyToOne,
JoinColumn,
} from 'typeorm';
import { Organization } from './organization.entity';
type Google = {
clientId: string;
};
type Git = {
clientId: string;
clientSecret: string;
hostName?: string;
};
@Entity({ name: 'sso_configs' })
export class SSOConfigs {
@PrimaryGeneratedColumn('uuid')
id: string;
@Column({ name: 'organization_id' })
organizationId: string;
@Column({ name: 'sso' })
sso: 'google' | 'git' | 'form';
@Column({ type: 'json' })
configs: Google | Git;
@Column({ name: 'enabled' })
enabled: boolean;
@CreateDateColumn({ default: () => 'now()', name: 'created_at' })
createdAt: Date;
@UpdateDateColumn({ default: () => 'now()', name: 'updated_at' })
updatedAt: Date;
@ManyToOne(() => Organization, (organization) => organization.id)
@JoinColumn({ name: 'organization_id' })
organization: Organization;
}