API Connect

API Connect

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#API Connect
#Applicationintegration
#APIConnect
 View Only
  • 1.  User Defined Policies (UDP) parameters types shenanigans

    Posted 07/11/24 10:17 AM

    Hello everyone. I hope you are doing well today.

    I have good cases to use UDPs in my work. But I seem limited on the parameters. When trying to use boolean or object types I only get a blank space.

    I suspected something fishy, so I opened the html code. I can see something was supposed to pop up ! Is there a reason for this to be disabled ?

    After removing some of the display: none :



    ------------------------------
    Celian Toureille
    ------------------------------


  • 2.  RE: User Defined Policies (UDP) parameters types shenanigans

    Posted 07/12/24 05:24 PM

    Hi Celian,
    This is all based upon your policy yaml.  Can you share your policy properties from the yaml? In your screen shot you have the dropdowns for string, object, etc.  Your properties, specifically the array item, must not be specifying a type.  You have an array for parameter1, but are the items of this array of different data types?  Typically they would all be the same.

    Best Regards,
    Steve Linn



    ------------------------------
    Steve Linn
    Senior Consulting I/T Specialist
    IBM
    ------------------------------



  • 3.  RE: User Defined Policies (UDP) parameters types shenanigans

    Posted 07/15/24 03:53 AM

    Hi Steve,

    In the end I didn't like the array, the interface it gives is too messy.
    When I looked at http://json-schema.org/draft-04/schema#  I only see stringArray as another type of array.

    We have a lot of options to create UDPs, I guess it's alright. The only downside is passwords. I don't fell alright passing a brut string as a password. Maybe you would add a new type for it ?



    ------------------------------
    Celian Toureille
    ------------------------------



  • 4.  RE: User Defined Policies (UDP) parameters types shenanigans

    Posted 07/15/24 09:01 AM

    Hi Celian,
    If you look at our public github repo of sample v10 user defined policies, see this one https://github.com/ibm-apiconnect/policy-apigw/blob/master/user-defined-policies/clientip-filter/clientip-filter-policy.yaml that has an array of objects in its properties where the object has two string properties which different restrictions.  Notice that each property has a type, whether it be array, object, or string.  If you specify the type, then those dropdowns that are asking for the data type will not show up in the UI.  The array UI interface allows you to enter 0..n array items, and to move each item around to reorder them if needed.

    As for password fields in the clear in the policy properties, that would be a request for enhancement not only for the UI to not show what was being typed, but the yaml to have some type of encrypted value that the Gateway would need to decrypt.

    Regards,

    Steve Linn



    ------------------------------
    Steve Linn
    Senior Consulting I/T Specialist
    IBM
    ------------------------------