@mercury-labs/nest-auth
Version:
Mercury framework auth library. It supports local auth, jwt with both bearer token and cookie, basic auth.
27 lines (26 loc) • 1.66 kB
TypeScript
import { ExecutionContext } from '@nestjs/common';
import { CanActivate } from '@nestjs/common/interfaces/features/can-activate.interface';
import { Reflector } from '@nestjs/core';
import { Observable } from 'rxjs';
import { AuthApiKeyGuard, GraphqlAuthJwtGuard, GraphqlAuthRefreshTokenGuard, IAuthDefinitions } from '../index';
import { AuthBasicGuard } from './auth.basic.guard';
import { AuthJwtGuard } from './auth.jwt.guard';
import { AuthRefreshTokenGuard } from './auth.refresh-token.guard';
export declare const IS_INTERNAL_ONLY: string;
export declare const IS_PUBLIC_KEY: string;
export declare const IS_PUBLIC_WITH_OPTIONAL_USER_KEY: string;
export declare const IS_API_KEY: string;
export declare const IS_REFRESH_TOKEN_KEY: string;
export declare class AuthGlobalGuard {
private readonly _reflector;
private readonly _authJwtGuard;
private readonly _basicAuthGuard;
private readonly _authApiKeyGuard;
private readonly _refreshTokenGuard;
private readonly _graphqlAuthJwtGuard;
private readonly _graphqlAuthRefreshTokenGuard;
private readonly _options;
constructor(_reflector: Reflector, _authJwtGuard: AuthJwtGuard, _basicAuthGuard: AuthBasicGuard, _authApiKeyGuard: AuthApiKeyGuard, _refreshTokenGuard: AuthRefreshTokenGuard, _graphqlAuthJwtGuard: GraphqlAuthJwtGuard, _graphqlAuthRefreshTokenGuard: GraphqlAuthRefreshTokenGuard, _options: IAuthDefinitions);
canActivate(context: ExecutionContext): boolean | Promise<boolean> | Observable<boolean>;
protected handleJwtRequestWithOptionalUser(handler: CanActivate, context: ExecutionContext, isPublicWithOptionalUser: boolean): Observable<boolean>;
}