[ 
https://issues.apache.org/jira/browse/DISPATCH-731?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16145715#comment-16145715
 ] 

Ken Giusti edited comment on DISPATCH-731 at 10/6/17 3:07 PM:
--------------------------------------------------------------

This issue has been resolved, but in a way that is slightly different from the 
original description.

Instead of modifying the "prefix" attribute to accept a pattern in the vhost 
component of the address, a new address attribute "pattern" has been 
introduced.  The pattern attribute is an alternative to the existing "prefix" 
attribute (you may only specify one or the other, not both).  The pattern 
attribute is a wildcarded address pattern that is used to match the incoming 
address.

The pattern consists of a series of tokens separated by either a period (.) or 
a forward slash (//).  For example "one/two/three" is a pattern consisting of 
three tokens: "one", "two", and "three".  There are two tokens that are 
reserved for wildcard matching: '\*' and '#'.   The '\*' token matches exactly 
one token.  The "#" matches zero or more tokens.   

For example, the pattern "one/*/three" will match the addresses "one/two/three" 
and "one/seven/three", but not "one/three" nor "one/two/two-and-a-half/three" 
(too many tokens). 

A "prefix" value can be converted to a pattern by appending a "/#" to it.  For 
example the prefix "a/b/c" is equivalent to the pattern "a/b/c/#".

The '\*' token has higher precedence than the "#" token, and a non-wildcard 
token has the highest precedence (exact match).   So given the following 
patterns:

1) a/b/c
2) a/b/*
3) a/b/#

The best match for input address "a/b/c" would be pattern #1.  The best match 
for "a/b/z" would be #2, since a "\*" match has higher precedence than a "#".  
And the best match for "a/b" and "a/b/c/d" would be #3.

To optimize the lookup process, the pattern matcher performs the following 
transforms on input patterns:

Any sequences of "#/\*" are translated to the equivalent "\*/#"
Any sequences of "#/#" are translated to "#"




was (Author: kgiusti):
This issue has been resolved, but in a way that is slightly different from the 
original description.

Instead of modifying the "prefix" attribute to accept a pattern in the vhost 
component of the address, a new address attribute "pattern" has been 
introduced.  The pattern attribute is an alternative to the existing "prefix" 
attribute (you may only specify one or the other, not both).  The pattern 
attribute is a wildcarded address pattern that is used to match the incoming 
address.

The pattern consists of a series of tokens separated by either a period (.) or 
a forward slash (\/).  For example "one/two/three" is a pattern consisting of 
three tokens: "one", "two", and "three".  There are two tokens that are 
reserved for wildcard matching: '\*' and '#'.   The '\*' token matches exactly 
one token.  The "#" matches zero or more tokens.   

For example, the pattern "one/*/three" will match the addresses "one/two/three" 
and "one/seven/three", but not "one/three" nor "one/two/two-and-a-half/three" 
(too many tokens). 

A "prefix" value can be converted to a pattern by appending a "/#" to it.  For 
example the prefix "a/b/c" is equivalent to the pattern "a/b/c/#".

The '\*' token has higher precedence than the "#" token, and a non-wildcard 
token has the highest precedence (exact match).   So given the following 
patterns:

1) a/b/c
2) a/b/*
3) a/b/#

The best match for input address "a/b/c" would be pattern #1.  The best match 
for "a/b/z" would be #2, since a "\*" match has higher precedence than a "#".  
And the best match for "a/b" and "a/b/c/d" would be #3.

To optimize the lookup process, the pattern matcher performs the following 
transforms on input patterns:

Any sequences of "#/\*" are translated to the equivalent "\*/#"
Any sequences of "#/#" are translated to "#"



> Support wildcard tenant vhosts in address prefix configuration
> --------------------------------------------------------------
>
>                 Key: DISPATCH-731
>                 URL: https://issues.apache.org/jira/browse/DISPATCH-731
>             Project: Qpid Dispatch
>          Issue Type: Improvement
>          Components: Management Agent
>    Affects Versions: 0.7.0
>            Reporter: Ken Giusti
>            Assignee: Ken Giusti
>            Priority: Minor
>             Fix For: 1.0.0
>
>
> When specifying address prefix patterns it should be possible to use a 
> wildcard match for the vhost.  Example:
> address {
>     prefix: a_prefix   # matches current vhost (from open frame)
> }
> address {
>     prefix: /my-vhost.com/other_prefix  # matched only if vhost=my-vhost
> }
> address {
>     prefix:  /*.#.domain1.com/prefix_3 # matched if vhost ends with 
> domain1.com
> }
> address {
>     prefix: /my.vhost.*.com/prefix_4  #matched if vhost starts with 
> 'my.vhost', has a single wildcard component, and ends with '.com'
> }
> Or something like that, I think.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to