Layer7 API Management

 View Only
Expand all | Collapse all

Examples of custom assertions

  • 1.  Examples of custom assertions

    Posted Nov 13, 2015 10:00 AM

    We want to create some custom assertions with input and output parameters for the api gateway. Does anybody want to share some samples of custom assertions? With some examples we could kickstart our own custom assertions.



  • 2.  Re: Examples of custom assertions
    Best Answer

    Posted Nov 18, 2015 07:33 AM

    Hello, Edward. You may find the attached Custom Assertion project plugin for Eclipse useful.

     

    Note: This plugin is not a supported CA product. It was developed by the community. Use at your own risk, and post questions here, and don't contact CA support for questions or issues related to the use of this plugin.

     

    Use this plugin by adding it to your Eclipse dropins folder. This can be easier to find on some platforms than on others. On Mac, you'll find it in your Eclipse.app directory:

     

     

    Start (or restart, if already running) Eclipse, and create a new project:

     

     

    Under the CA API Management category, select CA API Management Custom Assertion Project, and click Next:

     

     

    Make changes to fields in the form to accelerate creation of a unique custom assertion and/or click the Finish button:

     

     

    This will result in a custom assertion project that is ready to be built with Ant, and that demonstrates taking two strings as input, converting both to upper case and concatenating them together, and returning the result in an output context variable:

     

     

    The project will use your workspace's default JRE:

     

     

    For custom assertions that will be run on v8.4 or above gateways, you must use a Java 8 (a.k.a. 1.8) version. For custom assertions that will be run on v8.0 to v8.3, you must use a Java 7 (a.k.a. 1.7) version of Java. This change can be made to in your project's Java Build Path settings. For earlier version of the gateway, you should use an earlier version of the plugin (not attached, but can attach upon request).

     

    Build your project by selecting the build.xml file in the project's root directory, right click to open its context menu, select Run As, and Ant Build:

     

    This will result in a corresponding .jar file in a build folder in the project's root directory:

    Deploy the .jar file to your gateway's /opt/SecureSpan/Gateway/runtime/modules/lib file and change its ownership to layer7:layer7, then restart your gateway. Your custom assertion should now be available in the policy assertion pallet.



  • 3.  Re: Examples of custom assertions

    Posted Nov 18, 2015 07:39 AM

    BTW, I should add that though it's great to see your interest in extending the gateway's capabilities using custom assertions, in almost all cases, it's possible and possibly better to use policy (and possibly policy backed encapsulated assertions in later versions of the gateway). In the many years I've been with Layer 7 and now CA, I can probably count on two hands the times that a custom assertion was needed to solve a problem, and for most of those cases, we now have out-of-the-box policy assertions that can solve the same problem without a custom assertion.



  • 4.  RE: Re: Examples of custom assertions

    Posted Oct 07, 2023 03:16 PM

    Hi Ben,

    I think in order to sign and encrypt REST JSON messages it is still necessary to write custom assertion, which I am doing now.




  • 5.  RE: Re: Examples of custom assertions

    Posted Oct 09, 2023 04:20 AM

    Hi Willard, have you looked into the encode/decode JSON Web Token assertions? Based on your described requirements, it sounds like this should do the job: Encode JSON Web Token Assertion (broadcom.com)




  • 6.  RE: Re: Examples of custom assertions

    Posted Oct 23, 2023 02:59 PM

    Thanks Andrew, I'll give it a try and sorry for the late reply.




  • 7.  RE: Re: Examples of custom assertions

    Posted Oct 23, 2023 03:13 PM

    Thanks again Andrew. This serialises a JSON Web Token, and encrypts using Elliptical Curve. I need to sign and encrypt headers and payload of a REST JSON request or both, depending on the requirement. And the assertion also needs to be able to encrypt using RSA, using the public key, in some cases. I am almost done using Bouncy Castle except I just noticed that the packaged version of BC has vulnerabilities of which I raised a ticket.




  • 8.  RE: Re: Examples of custom assertions

    Posted Oct 24, 2023 07:14 AM

    I see now that the JWT assertion will not suit your requirement. It looks like you want to sign and encrypt different parts of a request/response message (headers and payloads). This is the edge of my knowledge but, if you haven't already, you may want to look into these assertions: Sign Element Assertion (broadcom.com) and Encrypt Element Assertion (broadcom.com) though they might only apply to Web Services which could be what you are looking for anyway.

    Hope that helps




  • 9.  Re: Examples of custom assertions

    Posted Jul 12, 2018 05:03 AM

    My colleague Lucas has recently developed a Custom Assertion for us. He wrote a nice how to: Implementation of a CA API Gateway Custom Assertion. If you are interested in starting to develop a Custom Assertion you might like to consider this tutorial.



  • 10.  RE: Re: Examples of custom assertions

    Posted Oct 04, 2023 09:52 AM

    Hallo Waldemar, Is this example/tutorial still available? 

    Thanks WJ




  • 11.  RE: Re: Examples of custom assertions

    Posted Jul 16, 2019 11:36 AM
    The attachment to your message can't be found anymore : where can I found the Custom Assertion project plugin for Eclipse now ?

    Thanks in advance.



  • 12.  RE: Re: Examples of custom assertions

    Posted Jul 17, 2019 08:37 AM
    It seems to be gone with the migration to Broadcom. 
    See attached the jar File from the original post.


  • 13.  RE: Re: Examples of custom assertions

    Posted Jul 17, 2019 09:04 AM
    Edited by System Jun 16, 2020 01:41 PM
    Hi Waldemar, 

    Actually there is no attachment with the original post either:



    And nothing is attached to your reply.

    Could you add the file as attachment to a new message ?

    Thanks.




  • 14.  RE: Re: Examples of custom assertions

    Posted Nov 07, 2019 10:18 PM
    Could you please provide me the latest the plug-in jar that supports?
    There is no attachment.



  • 15.  RE: Re: Examples of custom assertions

    Posted Nov 08, 2019 05:02 AM
    I will sent you a PM. It is not possible anymore to attach a jar file.

    ------------------------------
    Product Manager - APIIDA API Gateway Manager
    APIIDA AG
    https://apiida.com/aagm?lang=en
    ------------------------------



  • 16.  RE: Re: Examples of custom assertions

    Posted Nov 11, 2019 01:52 PM
    Hello, 
    Can you also send me the plugin? Thank you very much


  • 17.  RE: Re: Examples of custom assertions

    Posted Nov 12, 2019 03:14 AM
    Sure, just sended you a PM.

    @Broadcom: Could it be possible, that you can provide the jar file again in this forum?


    ------------------------------
    Product Manager - APIIDA API Gateway Manager
    APIIDA AG
    https://apiida.com/aagm?lang=en
    ------------------------------



  • 18.  RE: Re: Examples of custom assertions

    Posted Nov 20, 2019 02:29 AM
    Hi Waldemar,

    we cant find the plugin for custom assertion on provided link, can you please share it as an attachment.

    It really needed for us, while im using the provided link it just return back to the same community broadcom page so can you please help on this

    thanks in advance


  • 19.  RE: Re: Examples of custom assertions

    Posted Nov 20, 2019 05:35 AM

    Hi Jagan, 
    Unfortunately it is not possible to share it as an attachment. The forum software don't allow jar files. 
    I can sent it to you as PM. 



    ------------------------------
    Product Manager - APIIDA API Gateway Manager
    APIIDA AG
    https://apiida.com/aagm?lang=en
    ------------------------------



  • 20.  RE: Re: Examples of custom assertions

    Posted Nov 20, 2019 07:21 AM
    Yeah, Waldemar

    but the link u have provided https://apiida.com/aagm?lang=en doesn't contain the plugin. can you share it via email?


  • 21.  RE: Re: Examples of custom assertions

    Posted Nov 20, 2019 07:25 AM
    This is just the link form the automated signature. Please check your inbox from this forum.

    ------------------------------
    Product Manager - APIIDA API Gateway Manager
    APIIDA AG
    https://apiida.com/aagm?lang=en
    ------------------------------



  • 22.  RE: Re: Examples of custom assertions

    Posted Nov 10, 2020 04:02 AM
    Hello,

    Please, could you also send me the plugin?

    Thank you!!


  • 23.  RE: Re: Examples of custom assertions

    Posted Jun 22, 2020 10:02 AM
    Hi,

    Could you please provide me the latest the plug-in jar that supports?
    There is no attachment.

    Thanks in advance.

    Regards.


  • 24.  Re: Examples of custom assertions

    Posted Dec 10, 2015 10:00 AM

    Hello. Was Ben's response adequate to addressing your question? If so then please take a moment to mark it as the best answer. Thanks!



  • 25.  Re: Examples of custom assertions

    Posted Jan 25, 2019 03:47 PM

    Could you please provide me the latest the plug-in jar that supports ca-apigateway 9.3 version ?



  • 26.  RE: Re: Examples of custom assertions

    Posted Nov 19, 2019 08:20 AM
    Hi,
    Is it also possible to get hands on this plugin ?
    Does ti support all gateway versions, considering we're using 9.4CR03 ?
    Thanks.


  • 27.  RE: Re: Examples of custom assertions

    Posted Nov 19, 2019 09:57 AM
    As far as I know, this plugin works with Gateway 9.4. We have developed ourself some custom assertions (for APIIDA API Gateway Manager), which are working fine with all 9.x Gateways. 
    But since this is an unofficial plugin, you won't get any support from Broadcom. 

    I can send you the file via PM. I hope a Broadcom member can do this in the future.

    ------------------------------
    Product Manager - APIIDA API Gateway Manager
    APIIDA AG
    https://apiida.com/aagm?lang=en
    ------------------------------



  • 28.  RE: Re: Examples of custom assertions

    Posted Nov 19, 2019 10:06 AM
    Thanks.


  • 29.  RE: Re: Examples of custom assertions

    Posted Jan 06, 2020 01:46 AM
    Could you please provide me the latest the plug-in jar that supports ca-apigateway 9.3 version ?

    ------------------------------
    Chief Manager,
    ICICI Bank
    Hyderabad
    ------------------------------



  • 30.  RE: Re: Examples of custom assertions

    Posted Jan 07, 2020 03:16 AM
    Hi Parag, 
    There is no other version, then the one from 2015. This version still works, but there is no specific 9.3 version. 
    It would really help, if someone from the Broadcom Team could confirm this. 
    Besides that, I will send you a PM with the plugin.

    ------------------------------
    Product Manager - APIIDA API Gateway Manager
    APIIDA AG
    https://apiida.com/aagm?lang=en
    ------------------------------



  • 31.  RE: Re: Examples of custom assertions

    Posted Jan 21, 2020 09:20 AM
    Hi Waldemar,

    Is there a possibility I could get this plug-in as well. It seems its no longer in the forums and support has not been able to locate it as well. It would be greatly appreciated!

    Thanks!


  • 32.  RE: Re: Examples of custom assertions

    Posted Jan 22, 2020 03:00 AM
    Hi Paul, 
    Just send you a PM with a download link.

    ------------------------------
    Product Manager - APIIDA API Gateway Manager
    APIIDA AG
    https://apiida.com/aagm?lang=en
    ------------------------------



  • 33.  RE: Re: Examples of custom assertions

    Posted Jan 22, 2020 10:57 AM
    Hi Waldemar,

    Would you be able to send me a copy of the plug in as well please?

    Kind regards,
    Andrew


  • 34.  RE: Re: Examples of custom assertions

    Posted Jan 23, 2020 03:31 AM
    Sure, just send you a PM

    ------------------------------
    Product Manager - APIIDA API Gateway Manager
    APIIDA AG
    https://apiida.com/aagm?lang=en
    ------------------------------



  • 35.  RE: Re: Examples of custom assertions

    Posted Feb 03, 2020 04:52 PM
    Hi Waldemar,

    Could you send me an eclipse plugin as well please?


  • 36.  RE: Re: Examples of custom assertions

    Posted Feb 04, 2020 03:09 AM
    Sure! Just send you a PM.

    ------------------------------
    Product Manager - APIIDA API Gateway Manager
    APIIDA AG
    https://apiida.com/aagm?lang=en
    ------------------------------



  • 37.  RE: Re: Examples of custom assertions

    Posted Feb 06, 2020 12:52 PM

    Hi Waldemar. 

    Could you send me the eclipse plugin as well ?

    You might want to put it on a Github or some sort to avoid to send PM to everyone ! :)

    Thanks in advance




  • 38.  RE: Re: Examples of custom assertions

    Posted Apr 09, 2020 05:52 PM
    Hi Waldemar,

    Could you send me an eclipse plugin as well please?

    TIA,



  • 39.  RE: Re: Examples of custom assertions

    Posted Nov 09, 2020 12:52 PM
    Hello,
    Could you please send me an eclipse plugin as well please?
    Thanks in advance.
    BR


  • 40.  RE: Re: Examples of custom assertions

    Posted Jan 08, 2021 01:34 PM
    Hi Waldemar,

    We are working in custom assertion in Layer 7 gateway 10.X version and required this dropins.Could you pls send to me PM (shivashanthalatha.l@gmail.com)

    Thanks,
    Latha


  • 41.  RE: Re: Examples of custom assertions

    Posted Dec 21, 2022 03:53 PM
    Hello Waldemar,

    It did not work on gateway 10.1. Do you have any suggestion?

    By the way I used jar file from https://github.com/Layer7-Community/Utilities/tree/main/custom-assertion-plugin

    Thanks a lot!


  • 42.  RE: Re: Examples of custom assertions

    Posted Dec 22, 2022 09:45 AM

    Hi Ozgur,

    Waldemar no longer works for APIIDA, but we have documented the process for creating Custom Assertions recently here:

    https://www.youtube.com/watch?v=lRn-mB2-hp0

    Please also subscribe and take a look at other videos on our YouTube channel here:

    https://www.youtube.com/@APIIDA

    I hope this helps :-)

    Vince



    ------------------------------
    Principal Architect
    Apiida AG
    https://www.apiida.com
    ------------------------------



  • 43.  RE: Re: Examples of custom assertions

    Posted Jun 19, 2020 02:19 AM
    Hi Waldemar,

    Would you be able to send me a copy of the plug in as well please?

    Kind regards,
    RM



  • 44.  RE: Re: Examples of custom assertions

    Posted Jun 29, 2020 11:23 AM

    Hello Ramon MatosHongyan Gong, Simon CARRIE,

    I'll pass it on to my colleague Michael Stroh, so he can send you the plugin.

    best regards,

    Oleksij Donets



    ------------------------------
    Consultant, Services
    APIIDA AG
    https://www.apiida.com
    ------------------------------



  • 45.  RE: Re: Examples of custom assertions

    Posted Jul 01, 2020 09:45 AM
    Hello Oleksij Donets,

    Could you please pass the plugin on to me as well ?
    Email : ext.arjun.pilli@dsv.com



  • 46.  RE: Re: Examples of custom assertions

    Posted Jul 06, 2020 03:12 AM
    Hi All,

    Please could you send me the plug in too !! when you get a chance. 

    Regards,
    Arjun


  • 47.  RE: Re: Examples of custom assertions

    Posted Jul 08, 2020 05:54 PM
    Hi,

    Please could you send me the plug in too.

    Regards.


  • 48.  RE: Re: Examples of custom assertions

    Posted Nov 09, 2020 12:52 PM
    Hello Oleksij Donets,

    Please could you send me the plug-in as well?

    Thank you very much in advance.
    BR


  • 49.  RE: Re: Examples of custom assertions

    Posted Nov 09, 2020 12:52 PM
    Hi,
    Could you please send me the plug-in as well?
    Thank you very much in advance.
    BR


  • 50.  RE: Re: Examples of custom assertions

    Posted Jan 08, 2021 01:34 PM

    Hi Waldemar. 

    We are working in custom assertion development in 10.0 version and required this plugin . Could you send me the eclipse plugin to shivashanthalatha.l@gmail.com or any link that we can get the jar.

    Thanks in advance




  • 51.  RE: Examples of custom assertions

    Broadcom Employee
    Posted Oct 06, 2023 12:33 PM

    Note: The Custom Assertion project plugin for Eclipse that's discussed below is currently available in the Layer7 Community repo.



    ------------------------------
    Ben Urbanski
    Product Manager, API Gateway
    Layer7 API Management
    ------------------------------