Skip to content

Commit 1d9527e

Browse files
committed
token-scopes: Remove regular expression implementation details
1 parent fb55797 commit 1d9527e

File tree

1 file changed

+1
-25
lines changed

1 file changed

+1
-25
lines changed

text/0000-crates-io-token-scopes.md

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -104,31 +104,7 @@ existing set of endpoints in that scope.
104104

105105
## Crates scope
106106

107-
The pattern for the crate scope is desugared into a regular expression,
108-
following these rules:
109-
110-
* **`^(`** is added at the start of the pattern, and **`)$`** is added at the end of it.
111-
* **`,`** is desugared into `|`, separating multiple patterns.
112-
* **`*`** is desugared into `.*`, matching zero or more characters greedily.
113-
* All other non-alphanumeric characters are quoted to prevent them from having
114-
a special meaning.
115-
116-
As an example, the following pattern:
117-
118-
```
119-
foo,bar-*
120-
```
121-
122-
... is desugared into the following regex:
123-
124-
```
125-
^(foo|bar\-.*)$
126-
```
127-
128-
Any combination of those characters is allowed, but crates.io might define a
129-
complexity limit for the generated regular expressions.
130-
131-
The pattern will be evaluated during each API call, and if no match is found
107+
The patterns will be evaluated during each API call, and if no match is found
132108
the request will be denied. Because it's evaluated every time, a crates scope
133109
will allow interacting with matching crates published after token creation.
134110

0 commit comments

Comments
 (0)