@@ -41,28 +41,25 @@ adding the following endpoint scopes:
41
41
user owns
42
42
* ** yank** : allows yanking and unyanking existing versions of the user's crates
43
43
* ** 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.
44
47
45
48
More endpoint scopes might be added in the future without the need of a
46
49
dedicated RFC.
47
50
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
-
53
51
The crates.io UI will pre-select the scopes needed by the ` cargo ` CLI, which at
54
52
the time of writing this RFC are ` publish-new ` , ` publish-update ` , ` yank ` and
55
53
` change-owners ` . The user will have to explicitly opt into extra scopes or the
56
54
legacy permission model.
57
55
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 .
60
58
61
59
## Crates scope
62
60
63
61
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.
66
63
67
64
The crates scope can be left empty to allow the token to act on all the crates
68
65
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
78
75
with a crates scope, the crates scope will be ignored and the call will be
79
76
authorized.
80
77
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).
84
80
85
81
# Reference-level explanation
86
82
[ reference-level-explanation ] : #reference-level-explanation
@@ -102,6 +98,7 @@ The scopes proposed by this RFC allow access to the following endpoints:
102
98
| ` PUT /crates/:crate_id/:version/unyank ` | ** yank** |
103
99
| ` PUT /crates/:crate_id/owners ` | ** change-owners** |
104
100
| ` DELETE /crates/:crate_id/owners ` | ** change-owners** |
101
+ | everything except ` PUT /me/tokens ` | ** legacy** |
105
102
106
103
Removing an endpoint from a scope or adding an existing endpoint to an existing
107
104
scope will be considered a breaking change. Adding newly created endpoints to
@@ -203,7 +200,6 @@ scoping:
203
200
[ unresolved-questions ] : #unresolved-questions
204
201
205
202
* 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?
207
203
* Is the current behavior of crate scopes on endpoints that don't interact with
208
204
crates the best, or should a token with crate scopes prevent access to
209
205
endpoints that don't act on crates?
0 commit comments