UNPKG

@citrineos/util

Version:

The OCPP util module which supplies helpful utilities like cache and queue connectors, etc.

33 lines (32 loc) 1.25 kB
import { FastifyRequest } from 'fastify'; import { ILogObj, Logger } from 'tslog'; import { ApiAuthenticationResult, ApiAuthorizationResult, IApiAuthProvider, UserInfo } from '@citrineos/base'; /** * A local bypass authentication provider that doesn't perform actual authentication * Only for development and testing environments */ export declare class LocalBypassAuthProvider implements IApiAuthProvider { private readonly _logger; /** * Creates a new local bypass authentication provider * * @param logger Optional logger instance */ constructor(logger?: Logger<ILogObj>); extractToken(_request: FastifyRequest): Promise<string>; /** * Always returns a successful authentication with admin user * * @param token Ignored, can be any string * @returns Authentication result with admin user info */ authenticateToken(_token: string): Promise<ApiAuthenticationResult>; /** * Always returns a successful authorization * * @param user Ignored, can be any user * @param request Ignored, can be any request * @returns Always successful authorization */ authorizeUser(user: UserInfo, request: FastifyRequest): Promise<ApiAuthorizationResult>; }