@citrineos/base
Version:
The base module for OCPP v2.0.1 including all interfaces. This module is not intended to be used directly, but rather as a dependency for other modules.
19 lines (18 loc) • 1.12 kB
TypeScript
import type { AuthorizationDto } from '../dto/authorization.dto.js';
import type { AuthorizationStatusEnumType } from '../dto/types/enums.js';
import type { ConnectorDto } from '../dto/connector.dto.js';
import type { EvseDto } from '../dto/evse.dto.js';
import type { IMessageContext } from '../messages/MessageContext.js';
export interface IAuthorizer {
/**
* Interface for adding additional authorization logic.
* If status is not Accepted, the authorization process will stop and the rejection put into the response.
* The order of Authorizers can lead to different outputs; instantiate them in the order they should be called.
*
* @param {AuthorizationDto} authorization The authorization object associated with the idToken in the request. No modifications should be made to this object.
* @param {IMessageContext} context
*
* @returns {Promise<AuthorizationStatusEnumType>} The updated authorization status
**/
authorize(authorization: AuthorizationDto, context: IMessageContext, evse?: EvseDto, connector?: ConnectorDto): Promise<AuthorizationStatusEnumType>;
}