Skip to content

Commit

Permalink
clarify that token scopes allow interacting with future matches
Browse files Browse the repository at this point in the history
  • Loading branch information
pietroalbini committed Jun 24, 2020
1 parent d0ee1db commit d4cad47
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions text/0000-crates-io-token-scopes.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ the token can interact with. Crate names can contain `*` to match one or more
characters.

For example, a crates scope of `serde,serde-*` allows the token to act on the
`serde` crate or any crate starting with `serde-`, if the user is an owner of
those crates.
`serde` crate or any present or future crates starting with `serde-`, if the
user is an owner of those crates.

The crates scope will allow access to all present and future crates matching
it. When an endpoint that doesn't interact with crates is called by a token
Expand Down Expand Up @@ -132,9 +132,9 @@ foo,foo-*
Any combination of those characters is allowed, but crates.io might define a
complexity limit for the generated regular expressions.

Every time an endpoint acting on a crate is called the regex is desugared,
compiled and used to match the crate name. If no match is found the request is
denied.
The pattern will be evaluated during each API call, and if no match is found
the request will be denied. Because it's evaluated every time, a crates scope
will allow interacting with matching crates published after token creation.

The check for the crates scope is separate from crate ownership: having a scope
that technically permits to interact with a crate the user doesn't own will be
Expand Down

0 comments on commit d4cad47

Please sign in to comment.