Skip to content

Commit

Permalink
Implement LocalAuthListDisablePostAuthorize variable (#941)
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Rogach <[email protected]>
  • Loading branch information
jannejy authored Jan 17, 2025
1 parent 04b5b75 commit 4165d6c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/ocpp/v201/ctrlr_component_variables.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ extern const ComponentVariable LocalAuthListCtrlrEnabled;
extern const RequiredComponentVariable LocalAuthListCtrlrEntries;
extern const RequiredComponentVariable ItemsPerMessageSendLocalList;
extern const ComponentVariable LocalAuthListCtrlrStorage;
extern const ComponentVariable LocalAuthListDisablePostAuthorize;
extern const ComponentVariable MonitoringCtrlrAvailable;
extern const ComponentVariable BytesPerMessageClearVariableMonitoring;
extern const RequiredComponentVariable BytesPerMessageSetVariableMonitoring;
Expand Down
6 changes: 6 additions & 0 deletions lib/ocpp/v201/charge_point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,12 @@ AuthorizeResponse ChargePoint::validate_token(const IdToken id_token, const std:
EVLOG_info << "Found invalid entry in local authorization list but not sending Authorize.req because "
"RemoteAuthorization is disabled";
response.idTokenInfo.status = AuthorizationStatusEnum::Unknown;
} else if (this->device_model
->get_optional_value<bool>(ControllerComponentVariables::LocalAuthListDisablePostAuthorize)
.value_or(false)) {
EVLOG_info << "Found invalid entry in local authorization list but not sending Authorize.req because "
"LocalAuthListDisablePostAuthorize is enabled";
response.idTokenInfo.status = AuthorizationStatusEnum::Unknown;
} else if (this->connectivity_manager->is_websocket_connected()) {
// C14.FR.03: If a value found but not valid we shall send an authorize request
EVLOG_info << "Found invalid entry in local authorization list: Sending Authorize.req";
Expand Down
7 changes: 7 additions & 0 deletions lib/ocpp/v201/ctrlr_component_variables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,13 @@ const ComponentVariable LocalAuthListCtrlrStorage = {
"Storage",
}),
};
const ComponentVariable LocalAuthListDisablePostAuthorize = {
ControllerComponents::LocalAuthListCtrlr,
std::nullopt,
std::optional<Variable>({
"DisablePostAuthorize",
}),
};
const ComponentVariable MonitoringCtrlrAvailable = {
ControllerComponents::MonitoringCtrlr,
std::nullopt,
Expand Down

0 comments on commit 4165d6c

Please sign in to comment.