Closed dol closed 4 years ago
They're actually naming a protcol ACME???
I'm a bit skeptical; from a quick glance it looks like just a portion of the ACME payload is a 7807 string? Are you suggesting an ACME-parsing function, or just something that is barely a step above deserialize, in essence?
If the latter, I guess I have no particular objection to it and would accept a PR for it. However, be aware of the refactoring going on in #23 so that you don't bump into it.
Sorry, my intension was not clearly written. What I mean is the following https://github.com/dol/ApiProblem/commit/a340d921c104abf500ef45430fcb4285d3ef16ec change. The ACME protocol was only an example to ilustrate the usage of the new functionality. Because some ACME protocol responses contain Problem Details parts.
Ah, OK. Yeah, I'd take a PR for that. It looks like it wouldn't conflict with #23 either, which is good.
If you give me some time I'll add some tests as well. Was only a PoC.
Hey @dol. Are you going to be following up on this issue or shall I close it?
decompile is that method. Rename it and make it public, solved.
The acme protocol returns in https://tools.ietf.org/html/draft-ietf-acme-acme-17#section-7.1.3 an error object which is in the format of RFC 7807. To get this informations into a ApiProblem we need to perform a json_decode of the payload. Extract 'error' and json_encode the data to be passed to ApiProblem::fromJson.
It would be easier to just have a static function like decompile named ApiProblem::fromArray() to perform the work.