Hello Oliver,
Thank you for the pointer, when I use the cert_subject: * it indeed works,
it will find the first certificate I have.
This seemed to be because I used limit: single, this i have changed to
limit:10.
According to the docs in Activity the result then comes in
cert_identifier_list instead of cert_identifier if limit != single.
I have changed the condition to test on this variable:
condition:
has_result:
class: Workflow::Condition::Evaluate
param:
test: $context->{cert_identifier_list}
That seems to work because it will get to the state SUCCESS.
However the data attribute stays empty.
{
"result": {
"data": {},
"pid": 3111,
"proc_state": "finished",
"state": "SUCCESS",
"id": 0
}
}
I currently have this this:
get_certificate_data:
class: OpenXPKI::Server::Workflow::Activity::Tools::SetContext
param:
_map_certlist: "[% context.cert_identifier_list %]"
Before I tried to skip the get_certificate_data and go to SUCCESS directly
if hasresult is true but without any luck.
In both cases the data stays empty, how can I get the
context.cert_identifier_list properly in the data of the result?
Cheers,
Gerard
On Thu, 22 Apr 2021 at 00:51, Oliver Welter <[email protected]> wrote:
> Hi,
>
> the "_map" enables parameter replacement that is not required here, so
> remove it. I did not try but as "[% %]" is the makro for the Template
> engine (invoked by the map prefix) I'd assume that this generates some
> unexpected string.
>
> Try "cert_subject: *" - I think that should work, but be aware that the
> class has some internal limits, have a look at the docs of the activitiy
> class.
>
> Oliver
>
> Am 21.04.21 um 11:56 schrieb Gerard van den Bosch:
>
> Hello,
>
> I am trying to get a list of certificates through the API.
> The result I expect is the same as if you login to the WebUI as an
> operator and do a certificate search without filling in any search params.
>
> Steps I have taken:
>
> - Copied workflow certificate_search.yaml and called it
> certificate_list.yaml
> - Changed workflow name
> - Changed the map_cert_subject filter to: _map_cert_subject: "CN=[%],*"
> - Removed input and validators for common_name
> - Added following entry to rpc public.conf
>
> [ListCertificate]
> workflow = certificate_list
> output = cert_identifier, notbefore, notafter, status
>
> When I call the endpoint however this gives back no results:
>
> {
> "result": {
> "id": 0,
> "proc_state": "finished",
> "state": "NORESULT",
> "pid": 956,
> "data": {}
> }
> }
>
> Where I would expect one certificate to come back, which does come back if
> I use the certificate search in the WebUI.
>
> Could anyone give me a pointer of what I could be doing wrong?
>
> Cheers,
> Gerard
>
>
> _______________________________________________
> OpenXPKI-users mailing
> [email protected]https://lists.sourceforge.net/lists/listinfo/openxpki-users
>
>
> --
> Protect your environment - close windows and adopt a penguin!
>
> _______________________________________________
> OpenXPKI-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/openxpki-users
>
_______________________________________________
OpenXPKI-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openxpki-users