UNPKG

@citrineos/util

Version:

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

29 lines (28 loc) 1.15 kB
import { type AuthorizationStatusEnumType, type ConnectorDto, type EvseDto, type IAuthorizer, type IdTokenEnumType, type IMessageContext, type SystemConfig } from '@citrineos/base'; import type { Authorization, ILocationRepository } from '@citrineos/data'; import type { ILogObj } from 'tslog'; import { Logger } from 'tslog'; export interface RealTimeAuthorizationRequestBody { tenantPartnerId: number; idToken: string; idTokenType: IdTokenEnumType; locationId?: string; stationId: string; evseId: number; connectorId: number; } export interface RealTimeAuthorizationResponse { timestamp: string; data: { allowed: string; reason?: string; }; } export declare class RealTimeAuthorizer implements IAuthorizer { private _locationRepository; private _config; private readonly _logger; private readonly _oidcTokenProvider?; constructor(locationRepository: ILocationRepository, config: SystemConfig, logger?: Logger<ILogObj>); authorize(authorization: Authorization, context: IMessageContext, evse?: EvseDto, connector?: ConnectorDto): Promise<AuthorizationStatusEnumType>; }