bb-inspired
Version:
Core library for BB-inspired NestJS backend
15 lines (14 loc) • 832 B
TypeScript
import { HttpService } from '@nestjs/axios';
import { TokenValidationResponse, UserInfo, AuthResponse, PermissionCheckResponse, RoleCheckResponse, AuthServiceConfig } from './interfaces/auth.interfaces';
export declare class AuthService {
private readonly httpService;
private config?;
private readonly authServiceUrl;
constructor(httpService: HttpService, config?: AuthServiceConfig);
validateUser(username: string, password: string): Promise<AuthResponse>;
validateToken(token: string): Promise<TokenValidationResponse>;
checkPermissions(userId: string, permissions: string[]): Promise<PermissionCheckResponse>;
checkRoles(userId: string, roles: string[]): Promise<RoleCheckResponse>;
getUserById(userId: string): Promise<UserInfo>;
getUserPermissions(userId: string): Promise<string[]>;
}