Skip to content

Commit

Permalink
fix(v2.0.1): LocalPreAuthorize applied to LocalAuthList
Browse files Browse the repository at this point in the history
Verification of this configuration variable is also done for the Local Authorization List.

Signed-off-by: mlitre <martinlitre@mac.com>
  • Loading branch information
mlitre committed Sep 18, 2024
1 parent 3cd88cb commit 088a6db
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/ocpp/v201/charge_point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -810,8 +810,12 @@ AuthorizeResponse ChargePoint::validate_token(const IdToken id_token, const std:
}
}

if (this->device_model->get_optional_value<bool>(ControllerComponentVariables::LocalAuthListCtrlrEnabled)
.value_or(false)) {
bool local_pre_authorize = this->device_model->get_value<bool>(ControllerComponentVariables::LocalPreAuthorize);
bool local_auth_list_enabled =
this->device_model->get_optional_value<bool>(ControllerComponentVariables::LocalAuthListCtrlrEnabled)
.value_or(false);

if (local_auth_list_enabled and ((is_online and local_pre_authorize) or (!is_online and local_authorize_offline))) {
std::optional<IdTokenInfo> id_token_info = std::nullopt;
try {
id_token_info = this->database_handler->get_local_authorization_list_entry(id_token);
Expand Down Expand Up @@ -851,7 +855,6 @@ AuthorizeResponse ChargePoint::validate_token(const IdToken id_token, const std:
const auto auth_cache_enabled =
this->device_model->get_optional_value<bool>(ControllerComponentVariables::AuthCacheCtrlrEnabled)
.value_or(false);
bool local_pre_authorize = this->device_model->get_value<bool>(ControllerComponentVariables::LocalPreAuthorize);

if (auth_cache_enabled and ((is_online and local_pre_authorize) or (!is_online and local_authorize_offline))) {
try {
Expand Down

0 comments on commit 088a6db

Please sign in to comment.