Layer 7 API Management

Expand all | Collapse all

Externalize code in JavaScript assertion

Jump to Best Answer
  • 1.  Externalize code in JavaScript assertion

    Posted 20 days ago
    Hi there,

    Is there a way to get the JavaScript source code that normally goes inside the text box in the assertion fetched from an URL for example as it happens with XSLT? If not, could it be another way to externalize this code?

    Thanks in advance,

    Antonio


  • 2.  RE: Externalize code in JavaScript assertion

    Posted 20 days ago
    Hello Antonio,

    I'm not sure If I understood properly, but if you are fetching an html page, since HTML is based on XML, you could use the XML Assertion to navigate to the script tag and get the internal code of the same.

    Kind regards,
    Albert.

    ------------------------------
    Security Engineer
    ELCA
    ------------------------------



  • 3.  RE: Externalize code in JavaScript assertion

    Posted 19 days ago
    Hi Albert,

    No, that is not my use case. I would like to bring javascript code from external source like in the XSLT assertion that you can fetch your XSL stylesheet from somewhere else like from a S3/repo url.



    Thanks for your reply,

    Antonio


  • 4.  RE: Externalize code in JavaScript assertion
    Best Answer

    Posted 19 days ago
    Hello Antonio,

    Unfortunately I don't think that you have that possibility on the ootb assertions. I might be wrong and it would be a great discovery, so if anybody knows how to do that (without custom code) let us know!!

    I imagine that you want to be able to change the code without having to access and change the assertion. Unfortunately the DevOps of ca gateway is quite complex using GMU ... To keep all your development under control I recommend you APIIDA solution (https://apiida.com/).

    Kind regards,
    Albert.



    Kind regards,
    Albert.


    ------------------------------
    Security Engineer
    ELCA
    ------------------------------