ManageIQ / manageiq-providers-ovirt

ManageIQ plugin for the oVirt provider.
https://www.ovirt.org/
Apache License 2.0
6 stars 62 forks source link

Fix passing custom CA cert via DDF params #633

Closed agrare closed 1 year ago

agrare commented 1 year ago

The verify_credentials method is looking for "ca_certs" in the default_endpoint hash but the key is "certificate_authority".

This means even if the user passes in a valid CA cert the verify call will fail because ca_certs will be nil

server, port, verify_ssl, ca_certs = default_endpoint&.values_at(
  "hostname", "port", "verify_ssl", "ca_certs"
)
(byebug) ca_certs
nil
(byebug) default_endpoint.keys
["hostname", "verify_ssl", "certificate_authority", "port"]
agrare commented 1 year ago

This should have specs covering it, going to add some now

miq-bot commented 1 year ago

Checked commits https://github.com/agrare/manageiq-providers-ovirt/compare/ce5a66ffd709e840383ccd02900e49ce71d8ae31~...ffef9e402dce58f1d353a7fbf8276235e888ebe3 with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint 2 files checked, 0 offenses detected Everything looks fine. :+1:

agrare commented 1 year ago

This appears to have been broken since fe8f1e553ba2a8721d0c823c517962f29da5f6b4 (:scream:)

Fryguy commented 1 year ago

Backported to petrosian in commit fc259c66a4cee03fb0a3940fbbff344ccc8b8a87.

commit fc259c66a4cee03fb0a3940fbbff344ccc8b8a87
Author: Jason Frey <fryguy9@gmail.com>
Date:   Thu Mar 2 16:33:11 2023 -0500

    Merge pull request #633 from agrare/fix_ca_certs_ddf_params

    Fix passing custom CA cert via DDF params

    (cherry picked from commit e2435344a1604b066bb9d587d8867d38644cd34a)