@@ -159,12 +159,23 @@ directories:
159
159
> package names in ` Cargo.toml ` and the index JSON data are case-sensitive and
160
160
> may contain upper and lower case characters.
161
161
162
- Registries may want to consider enforcing limitations on package names added
163
- to their index. Cargo itself allows names with any [ alphanumeric] , ` - ` , or ` _ `
164
- character. For example, [ crates.io] imposes relatively strict limitations,
165
- such as requiring it to be a valid Rust identifier, only allowing ASCII
166
- characters, under a specific length, and rejects reserved names such as
167
- Windows special filenames like "nul".
162
+ Registries should consider enforcing limitations on package names added to
163
+ their index. Cargo itself allows names with any [ alphanumeric] , ` - ` , or ` _ `
164
+ characters. [ crates.io] imposes its own limitations, including the following:
165
+
166
+ - Only allows ASCII characters.
167
+ - Only alphanumeric, ` - ` , and ` _ ` characters.
168
+ - First character must be alphabetic.
169
+ - Case-insensitive collision detection.
170
+ - Prevent differences of ` - ` vs ` _ ` .
171
+ - Under a specific length (max 64).
172
+ - Rejects reserved names, such as Windows special filenames like "nul".
173
+
174
+ Registries should consider incorporating similar restrictions, and consider
175
+ the security implications, such as [ IDN homograph
176
+ attacks] ( https://en.wikipedia.org/wiki/IDN_homograph_attack ) and other
177
+ concerns in [ UTR36] ( https://www.unicode.org/reports/tr36/ ) and
178
+ [ UTS39] ( https://www.unicode.org/reports/tr39/ ) .
168
179
169
180
Each line in a package file contains a JSON object that describes a published
170
181
version of the package. The following is a pretty-printed example with comments
0 commit comments