blob: 3ed05603edf5e18f8e755298cab15fe366039d2c [file]
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
meta:
version: '1.0'
urtest:
requires: {plugins: [cachekey.so, xdebug.so]}
description: 'Cachekey captures beyond the default regex match capacity'
server:
name: server
client:
name: client
ats:
name: ts
records_config:
proxy.config.diags.debug.enabled: 1
proxy.config.diags.debug.tags: cachekey
plugin_config:
- 'xdebug.so --enable=x-cache-key'
remap_config:
- from: 'http://nine.example.com/'
to: 'http://127.0.0.1:{SERVER_HTTP_PORT}/'
plugins:
- name: cachekey.so
args:
- '--static-prefix=capture'
- '--capture-path=(a)(b)(c)(d)(e)(f)(g)(h)(i)'
- from: 'http://ten.example.com/'
to: 'http://127.0.0.1:{SERVER_HTTP_PORT}/'
plugins:
- name: cachekey.so
args:
- '--static-prefix=capture'
- '--capture-path=(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)'
- from: 'http://twelve.example.com/'
to: 'http://127.0.0.1:{SERVER_HTTP_PORT}/'
plugins:
- name: cachekey.so
args:
- '--static-prefix=capture'
- '--capture-path=(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)'
- from: 'http://replace.example.com/'
to: 'http://127.0.0.1:{SERVER_HTTP_PORT}/'
plugins:
- name: cachekey.so
args:
- '--static-prefix=capture'
- '--capture-path=/(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)/$9$1/'
- from: 'http://whole.example.com/'
to: 'http://127.0.0.1:{SERVER_HTTP_PORT}/'
plugins:
- name: cachekey.so
args:
- '--static-prefix=capture'
- '--capture-path=abcdef'
- from: 'http://no-match.example.com/'
to: 'http://127.0.0.1:{SERVER_HTTP_PORT}/'
plugins:
- name: cachekey.so
args:
- '--static-prefix=capture'
- '--capture-path=(z)'
- from: 'http://optional.example.com/'
to: 'http://127.0.0.1:{SERVER_HTTP_PORT}/'
plugins:
- name: cachekey.so
args:
- '--static-prefix=capture'
- '--capture-path=/(a)(b)?(c)?/$1-$2-$3/'
sessions:
- transactions:
- client-request:
method: GET
url: /abcdefghi
version: '1.1'
headers:
fields:
- [Host, nine.example.com]
- [uuid, nine]
- [X-Debug, x-cache-key]
server-response:
status: 200
reason: OK
headers:
fields:
- [Content-Length, 0]
proxy-response:
status: 200
headers:
fields:
- [X-Cache-Key, {value: '/capture/a/b/c/d/e/f/g/h/i', as: equal}]
- client-request:
method: GET
url: /abcdefghij
version: '1.1'
headers:
fields:
- [Host, ten.example.com]
- [uuid, ten]
- [X-Debug, x-cache-key]
server-response:
status: 200
reason: OK
headers:
fields:
- [Content-Length, 0]
proxy-response:
status: 200
headers:
fields:
- [X-Cache-Key, {value: '/capture/a/b/c/d/e/f/g/h/i/j', as: equal}]
- client-request:
method: GET
url: /abcdefghijkl
version: '1.1'
headers:
fields:
- [Host, twelve.example.com]
- [uuid, twelve]
- [X-Debug, x-cache-key]
server-response:
status: 200
reason: OK
headers:
fields:
- [Content-Length, 0]
proxy-response:
status: 200
headers:
fields:
- [X-Cache-Key, {value: '/capture/a/b/c/d/e/f/g/h/i/j/k/l', as: equal}]
- client-request:
method: GET
url: /abcdefghijkl
version: '1.1'
headers:
fields:
- [Host, replace.example.com]
- [uuid, replace]
- [X-Debug, x-cache-key]
server-response:
status: 200
reason: OK
headers:
fields:
- [Content-Length, 0]
proxy-response:
status: 200
headers:
fields:
- [X-Cache-Key, {value: '/capture/ia', as: equal}]
- client-request:
method: GET
url: /abcdef
version: '1.1'
headers:
fields:
- [Host, whole.example.com]
- [uuid, whole]
- [X-Debug, x-cache-key]
server-response:
status: 200
reason: OK
headers:
fields:
- [Content-Length, 0]
proxy-response:
status: 200
headers:
fields:
- [X-Cache-Key, {value: '/capture/abcdef', as: equal}]
- client-request:
method: GET
url: /abcdef
version: '1.1'
headers:
fields:
- [Host, no-match.example.com]
- [uuid, no-match]
- [X-Debug, x-cache-key]
server-response:
status: 200
reason: OK
headers:
fields:
- [Content-Length, 0]
proxy-response:
status: 200
headers:
fields:
- [X-Cache-Key, {value: '/capture', as: equal}]
- client-request:
method: GET
url: /a
version: '1.1'
headers:
fields:
- [Host, optional.example.com]
- [uuid, optional-a]
- [X-Debug, x-cache-key]
server-response:
status: 200
reason: OK
headers:
fields:
- [Content-Length, 0]
proxy-response:
status: 200
headers:
fields:
- [X-Cache-Key, {value: '/capture/a--', as: equal}]
- client-request:
method: GET
url: /ab
version: '1.1'
headers:
fields:
- [Host, optional.example.com]
- [uuid, optional-ab]
- [X-Debug, x-cache-key]
server-response:
status: 200
reason: OK
headers:
fields:
- [Content-Length, 0]
proxy-response:
status: 200
headers:
fields:
- [X-Cache-Key, {value: '/capture/a-b-', as: equal}]
- client-request:
method: GET
url: /ac
version: '1.1'
headers:
fields:
- [Host, optional.example.com]
- [uuid, optional-ac]
- [X-Debug, x-cache-key]
server-response:
status: 200
reason: OK
headers:
fields:
- [Content-Length, 0]
proxy-response:
status: 200
headers:
fields:
- [X-Cache-Key, {value: '/capture/a--c', as: equal}]
- client-request:
method: GET
url: /abc
version: '1.1'
headers:
fields:
- [Host, optional.example.com]
- [uuid, optional-abc]
- [X-Debug, x-cache-key]
server-response:
status: 200
reason: OK
headers:
fields:
- [Content-Length, 0]
proxy-response:
status: 200
headers:
fields:
- [X-Cache-Key, {value: '/capture/a-b-c', as: equal}]