Skip to content

Commit 0db28df

Browse files
committed
add the legacy scope, replacing legacy tokens
1 parent cffcaf8 commit 0db28df

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

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

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,28 +41,25 @@ adding the following endpoint scopes:
4141
user owns
4242
* **yank**: allows yanking and unyanking existing versions of the user's crates
4343
* **change-owners**: allows inviting new owners or removing existing owners
44+
* **legacy**: allows accessing all the endpoints on crates.io except for
45+
creating new tokens, like tokens created befores the implementation of this
46+
RFC.
4447

4548
More endpoint scopes might be added in the future without the need of a
4649
dedicated RFC.
4750

48-
There will also be an option to opt out of endpoint scopes and retain the
49-
permission model implemented before this RFC (called "legacy"), which allows
50-
access to all (documented and undocumented) crates.io API endpoints except for
51-
adding new tokens.
52-
5351
The crates.io UI will pre-select the scopes needed by the `cargo` CLI, which at
5452
the time of writing this RFC are `publish-new`, `publish-update`, `yank` and
5553
`change-owners`. The user will have to explicitly opt into extra scopes or the
5654
legacy permission model.
5755

58-
Tokens created before the implementation of this RFC will use the legacy
59-
permission model.
56+
Tokens created before the implementation of this RFC will default to the legacy
57+
scope.
6058

6159
## Crates scope
6260

6361
The user will be able to opt into limiting which crates the token can act on by
64-
defining a crates scope. It will be possible to set a crates scope even with
65-
the legacy endpoint scope.
62+
defining a crates scope.
6663

6764
The crates scope can be left empty to allow the token to act on all the crates
6865
owned by the user, or it can contain the comma-separated list of crate names
@@ -78,9 +75,8 @@ it. When an endpoint that doesn't interact with crates is called by a token
7875
with a crates scope, the crates scope will be ignored and the call will be
7976
authorized.
8077

81-
Tokens created before the implementation of this RFC won't have a crates scope,
82-
and it will be possible to use a crates scope in a token with the legacy
83-
endpoint scope.
78+
Tokens created before the implementation of this RFC will default to an empty
79+
crate scope filter (equivalent to no restrictions).
8480

8581
# Reference-level explanation
8682
[reference-level-explanation]: #reference-level-explanation
@@ -102,6 +98,7 @@ The scopes proposed by this RFC allow access to the following endpoints:
10298
| `PUT /crates/:crate_id/:version/unyank` | **yank** |
10399
| `PUT /crates/:crate_id/owners` | **change-owners** |
104100
| `DELETE /crates/:crate_id/owners` | **change-owners** |
101+
| everything except `PUT /me/tokens` | **legacy** |
105102

106103
Removing an endpoint from a scope or adding an existing endpoint to an existing
107104
scope will be considered a breaking change. Adding newly created endpoints to
@@ -203,7 +200,6 @@ scoping:
203200
[unresolved-questions]: #unresolved-questions
204201

205202
* Are there more scopes that would be useful to implement from the start?
206-
* Should crate scopes be allowed on tokens with the legacy endpoint scope?
207203
* Is the current behavior of crate scopes on endpoints that don't interact with
208204
crates the best, or should a token with crate scopes prevent access to
209205
endpoints that don't act on crates?

0 commit comments

Comments
 (0)