import { HttpRequest, RouteParameterResolver, RouteParameterResolverContext } from '@deepkit/http';
import { ScopedLogger } from '@deepkit/logger';
import { ActiveRecordClassType } from '@deepkit/orm';
import type { BaseAppConfig } from '../app';
import { ParsedJwt } from '../auth';
/**
 * base request JWT lookup
 */
export declare function getJwtFromRequest(request: HttpRequest): Promise<ParsedJwt | undefined>;
export declare class ParsedJwtResolver implements RouteParameterResolver {
    resolve(context: RouteParameterResolverContext): Promise<ParsedJwt | undefined>;
}
export declare function getEntityIdFromRequestJwt(request: HttpRequest): Promise<any>;
/**
 * request JWT user ID to user object
 */
export declare function getEntityFromRequestJwt<T extends ActiveRecordClassType>(request: HttpRequest, EntityClass: T): Promise<InstanceType<T> | undefined>;
export declare function createAuthMiddleware<T extends ActiveRecordClassType>(EntityClass: T): {
    new (): {
        handle(request: HttpRequest): Promise<void>;
        getEntityIdFromRequest(request: HttpRequest): Promise<any>;
        loadAndValidateEntity(request: HttpRequest, id: any): Promise<void>;
        execute(request: HttpRequest, response: import("@deepkit/http").HttpResponse, next: (err?: any) => void): Promise<void>;
    };
};
/**
 * HTTP basic auth middleware
 */
export declare function createBasicAuthMiddleware(expectedUsername?: string): {
    new (logger: ScopedLogger): {
        config: BaseAppConfig;
        logger: ScopedLogger;
        handle(request: HttpRequest): Promise<void>;
        execute(request: HttpRequest, response: import("@deepkit/http").HttpResponse, next: (err?: any) => void): Promise<void>;
    };
};
/**
 * standard authed entity resolver
 */
export declare function resolveEntityFromRequestJwt<T extends ActiveRecordClassType>(context: RouteParameterResolverContext, EntityClass: T): Promise<InstanceType<T> | undefined>;
export declare function createEntityFromRequestJwtParameterResolver<T extends ActiveRecordClassType>(EntityClass: T): {
    new (): {
        resolve(context: RouteParameterResolverContext): Promise<InstanceType<T> | undefined>;
    };
};
//# sourceMappingURL=auth.d.ts.map