import { Request, TokenInterface, UserInterface } from '@rxstack/core'; import { NamedServiceInterface, ServiceRegistry } from '@rxstack/service-registry'; import { InjectionToken } from 'injection-js'; import { AbstractRefreshTokenManager, SecretLoader } from './services'; import { User } from './models'; export declare const AUTH_PROVIDER_REGISTRY: InjectionToken; export declare const USER_PROVIDER_REGISTRY: InjectionToken; export declare const PASSWORD_ENCODER_REGISTRY: InjectionToken; export declare const TOKEN_EXTRACTOR_REGISTRY: InjectionToken; export declare const TOKEN_ENCODER: InjectionToken; export declare const TOKEN_MANAGER: InjectionToken; export declare const REFRESH_TOKEN_MANAGER: InjectionToken; export declare const SECRET_MANAGER: InjectionToken>; export type UserFactoryFunc = (data: any) => T; export interface AuthenticationProviderInterface extends NamedServiceInterface { authenticate(token: TokenInterface): Promise; support(token: TokenInterface): boolean; } export interface UserProviderInterface extends NamedServiceInterface { loadUserByUsername(username: string, payload?: any): Promise; } export interface PasswordEncoderInterface extends NamedServiceInterface { encodePassword(raw: string): Promise; isPasswordValid(encoded: string, raw: string): Promise; } export interface EncoderAwareInterface { getEncoderName(): string; } export interface TokenEncoderInterface { encode(payload: Object): Promise; decode(token: string): Promise; } export interface TokenManagerInterface { create(user: User): Promise; decode(token: TokenInterface): Promise; } export interface RefreshTokenInterface { _id: string; payload: Object; expiresAt: number; } export interface TokenExtractorInterface extends NamedServiceInterface { extract(request: Request): string; } export interface Secret { key: string | Buffer; passphrase?: string; } export declare enum KeyType { PUBLIC_KEY = "public_key", PRIVATE_KEY = "private_key" }