certificate: reduce nested sdbusplus::object inheritence
The CertIfaces type use to end up being:
object<object<Certificate>, Replace, Delete>
The nested object is unnecessary and can lead to incorrect behavior for
signal emittance. The upstream sdbusplus library attempted to fix this
automatically by flattening the resulting diamond inheritance, but some
of the code here attempted to use `object<Certificate>::function` calls,
which by the automatic flattening was not in the CertIface's inheritance
structure.
Tested:
# Launched certificate manager.
./builddir/phosphor-certificiate-manager --endpoint=ldap --path=/tmp/certificate_test --unit=bmcweb.service --type=authority
# Copied certificate into /tmp/certificate_test
cp /etc/ssl/certs/Go_Daddy_Class_2_CA.pem /tmp/certificate_test
# Checked busctl that Certificate object exists.
busctl --user tree xyz.openbmc_project.Certs.Manager.Authority.Ldap
└─/xyz
└─/xyz/openbmc_project
└─/xyz/openbmc_project/certs
└─/xyz/openbmc_project/certs/authority
└─/xyz/openbmc_project/certs/authority/ldap
└─/xyz/openbmc_project/certs/authority/ldap/1
busctl --user introspect xyz.openbmc_project.Certs.Manager.Authority.Ldap /xyz/openbmc_project/certs/authority/ldap/1 xyz.openbmc_project.Certs.Certificate
NAME TYPE SIGNATURE RESULT/VALUE >
.CertificateString property s "-----BEGIN CERTIFICATE-->
.Issuer property s "C=US,O=The Go Daddy Grou>
.KeyUsage property as 0 >
.Subject property s "C=US,O=The Go Daddy Grou>
.ValidNotAfter property t 2035170380 >
.ValidNotBefore property t 1088485580
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: If11679eb26708ce146c8451acb2169782e89ea54
diff --git a/certificate.hpp b/certificate.hpp
index 9a0c917..2a09e69 100644
--- a/certificate.hpp
+++ b/certificate.hpp
@@ -15,8 +15,8 @@
namespace certs
{
using DeleteIface = sdbusplus::xyz::openbmc_project::Object::server::Delete;
-using CertificateIface = sdbusplus::server::object::object<
- sdbusplus::xyz::openbmc_project::Certs::server::Certificate>;
+using CertificateIface =
+ sdbusplus::xyz::openbmc_project::Certs::server::Certificate;
using ReplaceIface = sdbusplus::xyz::openbmc_project::Certs::server::Replace;
using CertIfaces = sdbusplus::server::object::object<CertificateIface,
ReplaceIface, DeleteIface>;