Layer7 Gateway service resolver uri generic Star * Name Matching
search cancel

Layer7 Gateway service resolver uri generic Star * Name Matching

book

Article ID: 191302

calendar_today

Updated On:

Products

CA API Gateway API SECURITY CA API Gateway Precision API Monitoring Module for API Gateway (Layer 7) CA API Gateway Enterprise Service Manager (Layer 7) STARTER PACK-7 CA Microgateway

Issue/Introduction

I need documentation which shows what the options are on star name (*) matching is for policies.   For instance, I know I can create a service with this kind of match:

    /myapi/v1/*

which will match anything that starts with "/myapi/v1/", but is there anything available besides a "*", that is, can I do regular expressions or anything more complex?

Environment

Release : 9.2

Component : API GATEWAY

Resolution

Use Case Service URI Wildcard

  • Administrator publishes two (AND ONLY TWO) services
  1. service foo at /foo
  2. service bar at /bar*
  • request comes in at uri /foo
    • policy for service foo is executed
  • request comes in at uri /bar
    • policy for service bar is executed
  • request comes in at uri /barmihtva
    • policy for service bar is executed
  • request comes in at uri /bar/blah.bzzt
    • policy for service bar is executed
  • request comes in at uri /baz
    • returns policy not found

Use Case Global Policy

  • Administrator publishes two policy
  1. service foo at /foo
  2. service bar at /bar
  • administrator publishes a third service with an arbitrary WSDL and assigns uri /*
  • request comes in at uri /foo
    • policy for service foo is executed
  • request comes in at uri /bar
    • policy for service bar is executed
  • request comes in at ANY OTHER URI
    • policy for global service is executed

 

Use Case Service URI with Wildcard AND Global Policy

  • Administrator publishes three (AND ONLY 3) services
  1. service foo at /foo
  2. service bar at /bar*
  3. service honeypot at /*
  • request comes in at uri /foo
    • policy for service foo is executed
  • request comes in at uri /bar
    • policy for service bar is executed
  • request comes in at uri /barmihtva
    • policy for service bar is executed
  • request comes in at uri /bar/blah.bzzt
    • policy for service bar is executed
  • request comes in at uri /baz
    • policy for service honeypot is executed

Special note:
The different types of matches as prefix and suffix instead of file extension and path because any URL with characters after the wildcard (*) is considered a file extension even if there is no period. So /*a and /*.a are both considered file extension matches which is misleading. ex. Consider the two URLs: /zar* and /zar/*a. If a request is issued with the URL=/zar/bbbbbba the policy at URL=/zar* wins the conflict resolution.


Other methods of service resolution
Use a global message received policy fragment which evaluates the request uri and uses a resolve service assertion.

There is also a fast resolve tactical assertion which slightly changes behavior.