mirror of
https://github.com/samanhappy/mcphub.git
synced 2025-12-31 20:00:00 -05:00
- Add OAuth SSO type definitions (OAuthSSOProvider, OAuthSSOConfig, IOAuthLink) - Add oauthSSO field to SystemConfig for provider configuration - Update IUser interface to support OAuth-linked accounts - Create OAuth SSO service with provider management and token exchange - Add SSO controller with login initiation and callback handling - Update frontend login page with SSO provider buttons - Add SSOCallbackPage for handling OAuth redirects - Update database entities and DAOs for OAuth link storage - Add i18n translations for SSO-related UI elements - Add comprehensive unit tests for OAuth SSO service Co-authored-by: samanhappy <2755122+samanhappy@users.noreply.github.com>
47 lines
1.3 KiB
TypeScript
47 lines
1.3 KiB
TypeScript
import { Entity, Column, PrimaryColumn, CreateDateColumn, UpdateDateColumn } from 'typeorm';
|
|
|
|
/**
|
|
* System configuration entity for database storage
|
|
* Using singleton pattern - only one record with id = 'default'
|
|
*/
|
|
@Entity({ name: 'system_config' })
|
|
export class SystemConfig {
|
|
@PrimaryColumn({ type: 'varchar', length: 50, default: 'default' })
|
|
id: string;
|
|
|
|
@Column({ type: 'simple-json', nullable: true })
|
|
routing?: Record<string, any>;
|
|
|
|
@Column({ type: 'simple-json', nullable: true })
|
|
install?: Record<string, any>;
|
|
|
|
@Column({ type: 'simple-json', nullable: true })
|
|
smartRouting?: Record<string, any>;
|
|
|
|
@Column({ type: 'simple-json', nullable: true })
|
|
mcpRouter?: Record<string, any>;
|
|
|
|
@Column({ type: 'varchar', length: 10, nullable: true })
|
|
nameSeparator?: string;
|
|
|
|
@Column({ type: 'simple-json', nullable: true })
|
|
oauth?: Record<string, any>;
|
|
|
|
@Column({ type: 'simple-json', nullable: true })
|
|
oauthServer?: Record<string, any>;
|
|
|
|
@Column({ type: 'simple-json', nullable: true })
|
|
oauthSSO?: Record<string, any>;
|
|
|
|
@Column({ type: 'boolean', nullable: true })
|
|
enableSessionRebuild?: boolean;
|
|
|
|
@CreateDateColumn({ name: 'created_at', type: 'timestamp' })
|
|
createdAt: Date;
|
|
|
|
@UpdateDateColumn({ name: 'updated_at', type: 'timestamp' })
|
|
updatedAt: Date;
|
|
}
|
|
|
|
export default SystemConfig;
|