OpenLEADR / openleadr-python

Python library for OpenADR 2.0b
https://openleadr.org/docs
Apache License 2.0
135 stars 55 forks source link

Element oadrSignedObject should not be included when XMLSignatures are disabled #153

Open bpair opened 1 year ago

bpair commented 1 year ago

The VTN I am attempting to communicate with requires an X509 cert and TLS but not XML signatures. The messages are not signed but the payload contents are wrapped in an oadrSignedObject element which breaks the VTN. If there is no XML SIgnature then the oadrSignedObject should be removed.

stan-janssen commented 1 year ago

That's a strange combination and I'm not sure that is really a part of the OpenADR specification. Which VTN are you trying to communicate with?

According to the OpenADR XML schema, all payloads are always wrapped in the oadrSignedObject tag:

https://github.com/OpenLEADR/openleadr-python/blob/ac9d3d1ee46bd877b2e5fc12752c12837c75a027/openleadr/schema/oadr_20b.xsd#L16-L24

Is there documentation somewhere that says differently? Because then I will have to think about adjusting this.

bpair commented 1 year ago

I agree this is weird. I was trying to use code from https://github.com/avob/OpenADR The only thing in the spec is really about removing xml signatures to enable backward compatibility and it mentions removing the oadrSignedObject element. That would then not validate with the schema you reference. But then again why have a signedObject element wrap an unsigned element? I think I may have the XMLSignatures working in the avovb code after adding in some code to find the signed object element and attribute.