Wildcard Matching in OpenSSO
The OpenSSO Enterprise policy service supports policy definitions that use either of the two following wildcards:
- *The Multi-Level Wildcard (asterisk):
*
*
- *The One-Level Wildcard (hyphen-asterisk-hyphen):
-*-
*
These wildcards can be used in policy related situations. For example, when using the OpenSSO Enterprise Console or the ssoadm utility to create policies or when configuring the Policy Agent property that establishes the not-enforced list.
| Caution When issuing the ssoadm command, if you include values that contain the multi-level wildcard or the one-level wildcard, then the name/value pair should be enclosed in double quotes to avoid substitution by the shell. |
For creating a policy, the following are feasible examples of the wildcards in use:
http://agentHost:8090/agentsample/*
http://agentHost:8090/agentsample/example-*-/example.html
For the not-enforced list, the following are feasible examples of the wildcards in use:
Web Agents:
http://agentHost:8090/agentsample.com/*.gif
http://agentHost:8090/agentsample/-*-/images
J2EE Agents:
/agentsample.com/*.gif
/agentsample.com/-*-/images
Note
|
The Multi-Level Wildcard (asterisk)
The following list summarizes the behavior of the multi-level wildcard (asterisk):
- Matches zero or more occurrences of any character except for the question mark.
- Spans across multiple levels in a URL
- Cannot be escaped. Therefore, the backslash character or other characters cannot be used to escape the asterisk, as such:
\*
The following examples show the multi-level wildcard character when used with the forward slash as the delimiter character:
- The asterisk matches zero or more characters, except the question mark, in the resource name, including the forward slash. For example,
...B-example/*
matches
...B-example/b/c/d
but doesn't match
...B-example/?
- Multiple consecutive forward slash characters do not match with a single forward slash character. For example,
...B-example/*/A-example
doesn't match
...B-example/A-example
- Any number of trailing forward slash characters are not recognized as part of the resource name. For example,
...B-example/
and
...B-example//
are treated the same as
...B-example
Table 1: Examples of the the Multi-Level Wildcard
| Pattern | Matches | Does Not Match |
|---|---|---|
http://A-example.com:80/* |
http://A-example.com:80 http://A-example.com:80/ http://A-example.com:80/index.html http://A-example.com:80/x.gif |
http://B-example.com:80/ http://A-example.com:8080/index.html http://A-example.com:80/a?b=1 |
http://A-example.com:80/*.html |
http://A-example.com:80/index.html http://A-example.com:80/pub/ab.html http://A-example.com:80/pri/xy.html |
http://A-example.com/index.html http://A-example.com:80/x.gif http://B-example.com/index.html |
http://A-example.com:80/*/ab |
http://A-example.com:80/pri/xy/ab/xy/ab http://A-example.com:80/xy/ab |
http://A-example.com/ab http://A-example.com/ab.html http://B-example.com:80/ab |
http://A-example.com:80/ab/*/de |
http://A-example.com:80/ab/123/de http://A-example.com:80/ab/ab/de http://A-example.com:80/ab/de/ab/de http://A-example.com:80/ab//de |
http://A-example.com:80/ab/de http://A-example.com:80/ab/de http://B-example.com:80/ab/de/ab/de |
The One-Level Wildcard (hyphen-asterisk-hyphen)
The one-level wildcard (hyphen-asterisk-hyphen) matches only the defined level starting at the location of the one-level wildcard to the next delimiter boundary. The "defined level" refers to the area between delimiter boundaries. Many of the rules that apply to the multi-level wildcard also apply to the one-level wildcard.
The following list summarizes the behavior of hyphen-asterisk-hyphen as a wildcard:
- Matches zero or more occurrences of any character except for the forward slash and the question mark .
- Does not span across multiple levels in a URL.
- Cannot be escaped. Therefore, the backslash character or other characters cannot be used to escape the hyphen-asterisk-hyphen, as such:
\-*-
The following examples show the one-level wildcard when used with the forward slash as the delimiter character:
- The one-level wildcard matches zero or more characters (except for the forward slash and the question mark) in the resource name. For example,
...B-example/-*-
doesn't match
...B-example/b/c/
or
...B-example/b?
- Multiple consecutive forward slash characters do not match with a single forward slash character . For example,
...B-example/-*-/A-example
doesn't match
...B-example/A-example
- Any number of trailing forward slash characters are not recognized as part of the resource name. For example,
...B-example/
and
...B-example//
are treated the same as
...B-example
Table 2: Examples of the One-Level Wildcard
| Pattern | Matches | Does Not Match |
|---|---|---|
http://A-example.com:80/b/-*- |
http://A-example.com:80/b http://A-example.com:80/b/ http://A-example.com:80/b/cd/ |
http://A-example.com:80/b/c?d=e http://A-example.com:80/b/cd/e http://A-example.com:8080/b/ |
http://A-example.com:80/b/-*-/f |
http://A-example.com:80/b/c/f http://A-example.com:80/b/cde/f |
http://A-example.com:80/b/c/e/f http://A-example.com:80/f/ |
http://A-example.com:80/b/c-*-/f |
http://A-example.com:80/b/cde/f http://A-example.com:80/b/cd/f http://A-example.com:80/b/c/f |
http://A-example.com:80/b/c/e/f http://A-example.com:80/b/c/ http://A-example.com:80/b/c/fg |


Comments (2)
Oct 14, 2008
dcovey says:
I'm trying to create the following url policy resource name: http://samdev4.int...I'm trying to create the following url policy
resource name: http://samdev4.int.corp.sun:9090/header/*?*
When I save this, then go back to edit it I see http://samdev4.int.corp.sun:9090/header/*
and the ? and trailing has gone.
any idea's why?
Oct 16, 2008
johnwd says:
In response to what dcovey wrote aboeve, during OpenSSO policy creation, the iss...In response to what dcovey wrote aboeve, during OpenSSO policy creation, the issue with the string asterisk-question mark-asterisk being truncated to just asterisk was fixed in June '08.: https://opensso.dev.java.net/issues/show_bug.cgi?id=2815
John D.