Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated Links
Panel
borderColorblack
bgColor#f9f9f9
titleColorblack
titleBGColorwhite
borderStylesolid

Contents

Table of Contents

Purpose

...

The URI User filter can use a section of the URI in the request to set the X-PP-User and X-PP-Groups headers.  These headers can then be used by the Rate Limiting filter.

...

Filter name: uri-user

Filter configuration: uri-user.cfg.xml

Release: 8.0.0.0 *

* available in prior versions as URI Identity filter

...

Code Block
languagexml
themeConfluence
titleOptional .... configuration
<?xml version="1.0" encoding="UTF-8"?>

<uri-user xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
              xmlns='http://docs.openrepose.org/repose/uri-user/v1.0'
              xsi:schemaLocation='http://docs.openrepose.org/repose/uri-user/v1.0 ../config/uri-user-configuration.xsd'>

    <!-- list of regexes to match against the URI - the first match will be used -->
    <identification-mappings>
    	<!-- first capture group will be used as the value of the X-PP-User header -->
        <mapping id="main" identification-regex=".*/servers/(\w*)/.*"/>
        <mapping id="backup" identification-regex=".*/servers2/(\w*)/.*"/>
    </identification-mappings>

    <!-- value to put into the X-PP-Groups header -->
    <group>User_Standard</group>

    <!-- header quality for both the X-PP-User and X-PP-Groups headers -->
    <quality>0.5</quality>

</uri-user>

Configurable parameters

...

XML schema definition

Example configuration

The uri-user.cfg.xml file contains the following elements and attributes. Add the filter to your Repose deployment through the system model configuration.

ElementsAttributes

Required/

Optional

Description
<uri-user>-RequiredSpecifies the sub-elements and attributes to define your URI User configuration.
<identification-mappings>-RequiredLists mapping elements which are regular expressions used to extract the identification information from the request URI.  The first regular expression in the list that finds a match in the URI is used to extract the data.
<mapping>-RequiredLists the regular expressions used to extract the identification information from the request URI. The first regular expression in the list that finds a match in the URI is what is used to extract the data.
Image Modified
idOptionalNames the unique identifier of the mapping. This value does not affect processing in any way.
 identification-regex RequiredThe regular expression used to extract identification information from a given URI.
<group>-OptionalNames the rate limiting group associated with the extracted identification data.
<quality>-OptionalDefines the quality assigned to user by the incoming identification data. This value resolves the order of preference when multiple identity filters are used so that the rate limiting filter knows which identity to limit by. Should be a value between 0.0 and 1.0. 

Return codes and conditions

...

This filter does not return specific response codes.  The request will simply pass through to the next filter or to the origin service.

Request headers created

...

HeaderValueAdded WhenQuality
X-PP-UserFirst capture group of the matching regexAn identification mapping regex matches the URIEither the configured quality value or "0.5" by default
X-PP-GroupsEither the configured group value or "User_Standard" by defaultAn identification mapping regex matches the URIEither the configured quality value or "0.5" by default