openvidu/typings/src/auth-preferences.ts
Carlos Santos 8aa1bbc64b Refactor storage service and interfaces for improved separation of concerns
- Updated StorageFactory to create basic storage providers and key builders.
- Simplified StorageProvider interface to focus on basic CRUD operations.
- Enhanced MeetStorageService to handle domain-specific logic while delegating storage operations.
- Implemented Redis caching for room data to improve performance.
- Added error handling and logging improvements throughout the service.
- Removed deprecated methods and streamlined object retrieval processes.
refactor: update storage service and interfaces to include user key handling and improve initialization logic

refactor: update beforeAll hooks in recording tests to clear rooms and recordings

refactor: optimize integration recordings test command

Revert "refactor: optimize integration recordings test command"

This reverts commit d517a44fa282b91613f8c55130916c2af5f07267.

refactor: enhance Redis cache storage operations

refactor: streamline test setup and teardown for security and recordings APIs
2025-06-04 11:14:04 +02:00

77 lines
1.7 KiB
TypeScript

export interface AuthenticationPreferences {
authMethod: ValidAuthMethod;
authModeToAccessRoom: AuthMode;
}
/**
* 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;
}
/**
* 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 OAuth authentication.
*/
// export interface OAuthProviderConfig {
// provider: OAuthProvider;
// clientId: string;
// clientSecret: string;
// redirectUri: string;
// }
/**
* Supported OAuth providers.
*/
// export const enum OAuthProvider {
// GOOGLE = 'google',
// GITHUB = 'github'
// }