Skip to content

Commit c0b5b18

Browse files
committed
docs(policy): correct request path wildcard semantics
Signed-off-by: Johnny Greco <jogreco@nvidia.com>
1 parent c559efc commit c0b5b18

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎docs/reference/policy-schema.mdx‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ REST rules match HTTP requests by method, path, and optional query parameters.
440440
| Field | Type | Required | Description |
441441
|---|---|---|---|
442442
| `method` | string | Yes | HTTP method, such as `GET` or `POST`. `*` matches any method. |
443-
| `path` | string | Yes | URL path glob. `*` and `**` match zero or more characters and may cross `/`. `?` matches one character. Bracket classes such as `[0-9]` and `[!0]` are supported. |
443+
| `path` | string | Yes | URL path glob. `*` matches zero or more characters within one path segment, and `**` matches zero or more characters across segments. `?` matches one character. Bracket classes such as `[0-9]` and `[!0]` are supported. |
444444
| `query` | map | No | Query parameter matchers keyed by decoded, case-sensitive name. A matcher is a glob string (`tag: "foo-*"`) or an object with `any` (`tag: { any: ["foo-*", "bar-*"] }`). |
445445

446446
In an allow rule, every duplicate value for a configured query key must match.
@@ -467,9 +467,9 @@ endpoints:
467467
any: ["v1.*", "v2.*"]
468468
deny_rules:
469469
- method: POST
470-
path: "/repos/*/pulls/*/reviews"
470+
path: "/repos/*/*/pulls/*/reviews"
471471
- method: "*"
472-
path: "/repos/*/rulesets"
472+
path: "/repos/*/*/rulesets"
473473
```
474474

475475
### WebSocket Rules
@@ -799,7 +799,7 @@ Different policy fields use different wildcard boundaries:
799799
|---|---|---|
800800
| Endpoint `host` | Case-insensitive DNS name or IP comparison. | DNS `*` matches one label and `**` matches one or more labels. Validation restricts wildcard placement. |
801801
| Binary `path` | Canonical executable or trusted ancestor path. | Symlinks resolve to canonical identity. `*` matches within a path segment and `**` crosses directories. Identity enforcement depends on trusted runtime configuration. |
802-
| REST or WebSocket request `path` | Case-sensitive URL path glob. | Both `*` and `**` can cross `/`, unlike common shell globs. |
802+
| REST or WebSocket request `path` | Case-sensitive URL path glob. | `*` matches within one path segment and `**` crosses `/`. `/repos/**` does not match `/repos` itself. |
803803
| Query value | Case-sensitive decoded value glob. | In allow rules, every duplicate value for a configured key must match. |
804804
| Middleware `endpoints` | Case-insensitive DNS name comparison. | Same as endpoint `host`. Brace alternates are rejected. |
805805

‎docs/sandboxes/manage-policies.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ command changes only that rule:
112112
openshell policy update my-sandbox \
113113
--rule-name github_readonly \
114114
--binary /usr/bin/curl \
115-
--add-allow 'api.github.com:443:POST:/repos/*/issues' \
115+
--add-allow 'api.github.com:443:POST:/repos/*/*/issues' \
116116
--wait
117117
```
118118

0 commit comments

Comments
 (0)