UNPKG

zents

Version:

ZenTS is a Node.js & TypeScript MVC-Framework for building rich web applications, released as free and open-source software under the MIT License. It is designed for building web applications with modern tools and design patterns.

29 lines (28 loc) 1.56 kB
import type { SecurityProviderAuthorizeResponse, SecurityStrategy, SessionStoreAdapter, TokenData } from '../types/interfaces'; import type { Connection } from 'typeorm'; import type { Context } from '../http/Context'; import type { DatabaseContainer } from '../database/DatabaseContainer'; import type { SecurityProviderOptions } from './SecurityProviderOptions'; import type { SecurityRequestContext } from '../types/types'; import type { SecurityResponse } from './SecurityResponse'; export declare class SecurityProvider { options: SecurityProviderOptions; protected response: SecurityResponse; protected adapter: SessionStoreAdapter; protected strategy: SecurityStrategy; protected connection: Connection; private argon2idGenerator; constructor(options: SecurityProviderOptions, response: SecurityResponse, adapter: SessionStoreAdapter, strategy: SecurityStrategy, databaseContainer: DatabaseContainer); login(context: SecurityRequestContext): Promise<void>; logout(context: SecurityRequestContext): Promise<void>; authorize(context: Context): Promise<SecurityProviderAuthorizeResponse>; forbidden(context: Context): Promise<void>; generatePasswordHash(plainTextPassword: string): Promise<string>; generateSessionId(): string; protected generateToken(context: SecurityRequestContext, userId: string): Promise<{ token: string; sessionId: string; }>; protected verifyToken(token: string): Promise<boolean>; protected parseToken(token: string): Promise<TokenData | false>; }