Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored pki_handler to evse_security #157

Merged
merged 8 commits into from
Sep 29, 2023

Conversation

Pietfried
Copy link
Contributor

  • removed pki handler impl and header from libocpp and replaced by evse_security.hpp, which can be provided externally from libocpp consumer.
  • Refactored all parts where pki_handler was used with usage of evse_security
  • added dependency to libevse-security and used this for implementation of evse_security interface. This internal evse_security_impl is used if no external implementation is given in the ChargePoint constructor

/// \param certificate_type specifies the CA certificate type
/// \return result of the operation
virtual InstallCertificateResult install_ca_certificate(const std::string& certificate,
const CaCertificateType& certificate_type) = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering this in our call earlier today too. Why are we passing enum class arguments by const reference? Seems like by value would be simpler and more code efficient as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is just a matter of habbit, they could also be passed by value. In general, there are a couple of things we could target for a larger styling refactor of libocpp, which is already on our list :)

@Pietfried Pietfried force-pushed the pg-pki-handler-to-evse-security branch 2 times, most recently from 563697c to e8983aa Compare September 1, 2023 06:50
@Pietfried Pietfried force-pushed the pg-pki-handler-to-evse-security branch from e8983aa to 6a6c582 Compare September 18, 2023 07:41
this->device_model->get_optional_value<bool>(ControllerComponentVariables::AdditionalRootCertificateCheck)
.value_or(false));
this->database_handler = std::make_shared<DatabaseHandler>(core_database_path, sql_init_path);
this->evse_security = evse_security;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this line. evse_security is already initialized in ChargingStationBase. If you set evse_security to nullptr, a new instance is created in ChargingStationBase and overwritten with this line.

@Pietfried Pietfried force-pushed the pg-pki-handler-to-evse-security branch 2 times, most recently from 4b7d0b8 to 643dfe2 Compare September 28, 2023 08:42
@Pietfried Pietfried force-pushed the pg-pki-handler-to-evse-security branch from 643dfe2 to 5c2c133 Compare September 29, 2023 08:52
Pietfried and others added 8 commits September 29, 2023 15:17
…_security.hpp, which can be provided externally from libocpp consumer. Refactored all parts where pki_handler was used with usage of evse_security

Signed-off-by: pietfried <[email protected]>
… of evse_security interface. This internal evse_security_impl is used of no external implementation is given in the ChargePoint constructor

Signed-off-by: pietfried <[email protected]>
Signed-off-by: Ioan Bogdann <[email protected]>
Signed-off-by: pietfried <[email protected]>
Signed-off-by: pietfried <[email protected]>
Signed-off-by: pietfried <[email protected]>
Signed-off-by: Kai-Uwe Hermann <[email protected]>
Signed-off-by: pietfried <[email protected]>
Signed-off-by: Kai-Uwe Hermann <[email protected]>
Signed-off-by: pietfried <[email protected]>
@Pietfried Pietfried force-pushed the pg-pki-handler-to-evse-security branch from 48a9fc1 to 2530619 Compare September 29, 2023 13:17
@Pietfried Pietfried merged commit e4f1ccd into main Sep 29, 2023
@Pietfried Pietfried deleted the pg-pki-handler-to-evse-security branch September 29, 2023 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants