typings: Add authentication preferences and update global preferences
This commit is contained in:
parent
fec108d802
commit
695ee31fbd
84
typings/src/auth-preferences.ts
Normal file
84
typings/src/auth-preferences.ts
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
export interface AuthenticationPreferences {
|
||||||
|
authMode: AuthMode;
|
||||||
|
method: ValidAuthMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Authentication modes available to enter a room.
|
||||||
|
*/
|
||||||
|
export const enum AuthMode {
|
||||||
|
NONE = 'none', // No authentication required
|
||||||
|
MODERATORS_ONLY = 'moderators_only', // Only moderators need authentication
|
||||||
|
ALL_USERS = 'all_users' // All users need authentication
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Authentication method base interface.
|
||||||
|
*/
|
||||||
|
export interface AuthMethod {
|
||||||
|
type: AuthType;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum for authentication types.
|
||||||
|
*/
|
||||||
|
export const enum AuthType {
|
||||||
|
SINGLE_USER = 'single-user'
|
||||||
|
// MULTI_USER = 'multi-user',
|
||||||
|
// OAUTH_ONLY = 'oauth-only'
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Authentication method: Single user with fixed credentials.
|
||||||
|
*/
|
||||||
|
export interface SingleUserAuth extends AuthMethod {
|
||||||
|
type: AuthType.SINGLE_USER;
|
||||||
|
credentials: SingleUserCredentials;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Authentication method: Multiple users with optional OAuth integration.
|
||||||
|
*/
|
||||||
|
// export interface MultiUserAuth extends AuthMethod {
|
||||||
|
// type: AuthType.MULTI_USER;
|
||||||
|
// oauthProviders?: OAuthProviderConfig[];
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Authentication method: Only OAuth authentication.
|
||||||
|
*/
|
||||||
|
// export interface OAuthOnlyAuth extends AuthMethod {
|
||||||
|
// type: AuthType.OAUTH_ONLY;
|
||||||
|
// oauthProviders: OAuthProviderConfig[];
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Union type for allowed authentication methods.
|
||||||
|
*/
|
||||||
|
export type ValidAuthMethod = SingleUserAuth /* | MultiUserAuth | OAuthOnlyAuth */;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configuration for a single user login method.
|
||||||
|
*/
|
||||||
|
export interface SingleUserCredentials {
|
||||||
|
username: string;
|
||||||
|
passwordHash: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configuration for OAuth authentication.
|
||||||
|
*/
|
||||||
|
// export interface OAuthProviderConfig {
|
||||||
|
// provider: OAuthProvider;
|
||||||
|
// clientId: string;
|
||||||
|
// clientSecret: string;
|
||||||
|
// redirectUri: string;
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Supported OAuth providers.
|
||||||
|
*/
|
||||||
|
// export const enum OAuthProvider {
|
||||||
|
// GOOGLE = 'google',
|
||||||
|
// GITHUB = 'github'
|
||||||
|
// }
|
||||||
@ -1,3 +1,5 @@
|
|||||||
|
import { AuthenticationPreferences } from './auth-preferences.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents global preferences for OpenVidu Meet.
|
* Represents global preferences for OpenVidu Meet.
|
||||||
*/
|
*/
|
||||||
@ -5,7 +7,7 @@ export interface GlobalPreferences {
|
|||||||
projectId: string;
|
projectId: string;
|
||||||
// roomFeaturesPreferences: RoomFeaturesPreferences;
|
// roomFeaturesPreferences: RoomFeaturesPreferences;
|
||||||
webhooksPreferences: WebhookPreferences;
|
webhooksPreferences: WebhookPreferences;
|
||||||
// securityPreferences: SecurityPreferences;
|
securityPreferences: SecurityPreferences;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface WebhookPreferences {
|
export interface WebhookPreferences {
|
||||||
@ -14,14 +16,13 @@ export interface WebhookPreferences {
|
|||||||
// events: WebhookEvent[];
|
// events: WebhookEvent[];
|
||||||
}
|
}
|
||||||
|
|
||||||
// export interface SecurityPreferences {
|
export interface SecurityPreferences {
|
||||||
// authentication: AuthenticationPreferences;
|
authentication: AuthenticationPreferences;
|
||||||
// e2eEncryption: {}
|
roomCreationPolicy: RoomCreationPolicy;
|
||||||
|
// e2eEncryption: {};
|
||||||
|
}
|
||||||
|
|
||||||
// }
|
export interface RoomCreationPolicy {
|
||||||
|
allowRoomCreation: boolean;
|
||||||
// export interface AuthenticationPreferences {
|
requireAuthentication: boolean;
|
||||||
// requiresAuthentication: boolean;
|
}
|
||||||
// authenticationMethod: AuthMethod; // Método de autenticación
|
|
||||||
// userAccessControl: UserAccessControl; // Control sobre quién puede acceder y cómo
|
|
||||||
// }
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
export * from './global-preferences.js';
|
export * from './global-preferences.js';
|
||||||
|
export * from './auth-preferences.js';
|
||||||
export * from './room-preferences.js';
|
export * from './room-preferences.js';
|
||||||
export * from './participant.js';
|
export * from './participant.js';
|
||||||
export * from './token.js';
|
export * from './token.js';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user