UNPKG

homebridge-config-ui-x

Version:

A web based management, configuration and control platform for Homebridge.

50 lines (49 loc) 2.1 kB
import { JwtService } from '@nestjs/jwt'; import { UserDto } from '../../modules/users/users.dto.js'; import { ConfigService } from '../config/config.service.js'; import { JsonFileStoreService } from '../fs/json-file-store.service.js'; import { Logger } from '../logger/logger.service.js'; export declare class AuthService { private readonly jwtService; private readonly configService; private readonly jsonStore; private readonly logger; private otpUsageCache; private legacyOtpGuardrails; constructor(jwtService: JwtService, configService: ConfigService, jsonStore: JsonFileStoreService, logger: Logger); authenticate(username: string, password: string, otp?: string): Promise<any>; signIn(username: string, password: string, otp?: string): Promise<any>; private checkPassword; generateNoAuthToken(): Promise<{ access_token: string; token_type: string; expires_in: number; }>; refreshToken(user: any): Promise<any>; validateUser(payload: any): Promise<any>; private hashPassword; private genSalt; setupFirstUser(user: UserDto): Promise<UserDto>; generateSetupWizardToken(): Promise<{ access_token: string; token_type: string; expires_in: number; }>; checkAuthFile(): Promise<void>; desensitiseUserProfile(user: UserDto): UserDto; getUsers(strip?: boolean): Promise<UserDto[]>; findByUsername(username: string): Promise<UserDto>; private withAuthFile; addUser(user: UserDto): Promise<UserDto>; deleteUser(id: number): Promise<void>; updateUser(id: number, update: UserDto): Promise<UserDto>; updateOwnPassword(username: string, currentPassword: string, newPassword: string): Promise<UserDto>; setupOtp(username: string): Promise<{ timestamp: Date; otpauth: string; }>; activateOtp(username: string, code: string): Promise<UserDto>; deactivateOtp(username: string, password: string): Promise<UserDto>; verifyOtpToken(user: UserDto, otp: string): Promise<boolean>; private markUserAsLegacyOtp; }