Skip to content

Commit 48d7d6a

Browse files
authored
Add "crates.io Policy Update" RFC (#3463)
* Add "crates.io Policy Update" RFC * crates.io Policy Update: Integrate RFC feedback * crates.io Policy Update: Remove controversial "misinformation" clause * crates.io Policy Update: Add "embedding executable binaries" open question * crates.io Policy Update: Clarify crate deletion and author notification policy * crates.io Policy Update: Integrate "excessive bulk activity" feedback * crates.io Policy Update: Import "Sexually Obscene Content" policy from GitHub
1 parent 4254063 commit 48d7d6a

File tree

1 file changed

+256
-0
lines changed

1 file changed

+256
-0
lines changed

text/3463-crates-io-policy-update.md

+256
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,256 @@
1+
- Start Date: 2023-07-24
2+
- RFC PR: [rust-lang/rfcs#3463](https://github.com/rust-lang/rfcs/pull/3463)
3+
4+
# Summary
5+
[summary]: #summary
6+
7+
The Rust community has outgrown the current crates.io policies. This RFC proposes a new "Terms of Use" policy based on prior work by PyPI, npm and GitHub.
8+
9+
# Motivation
10+
[motivation]: #motivation
11+
12+
> Why are we doing this? What use cases does it support? What is the expected outcome?
13+
14+
crates.io has a "[Package Policies](https://crates.io/policies)" page, which describes the current, organically grown policies. A lot of support requests or questionable uses of crates.io however need explicit decisions from the crates.io team, since many cases are currently not covered by these policies. Additionally, decisions made by the team may be seen as arbitrary without written guidelines.
15+
16+
The situation around name squatting has lately also reached unsustainable levels, and while [namespaces](https://github.com/rust-lang/rfcs/pull/3243) might help with some parts of the problem we would still need policies for name squatting namespaces then.
17+
18+
The main motivation for this RFC is to give the crates.io team a fixed set of rules to determine if a project is using crates.io in a reasonable way, or if the user should get a warning and the project potentially be removed. It is mostly codifying the existing practices of the team, except for being more strict regarding name squatting.
19+
20+
# Proposal
21+
[guide-level-explanation]: #guide-level-explanation
22+
23+
The following is a proposed new "Terms of Use" policy for crates.io, replacing <https://crates.io/policies> and <https://crates.io/data-access>.
24+
25+
-------------------------------------------------------------------------------
26+
27+
# Terms of Use
28+
29+
**Short version:** _crates.io is a critical resource for the Rust ecosystem,
30+
which hosts a variety of packages from a diverse group of users. That resource
31+
is only effective when our users are able to work together as part of a
32+
community in good faith. While using crates.io, you must comply with our
33+
Acceptable Use Policies, which include some restrictions on content and conduct
34+
on crates.io related to user safety, intellectual property, privacy,
35+
authenticity, and other limitations. In short, be excellent to each other!_
36+
37+
We do not allow content or activity on crates.io that:
38+
39+
- violates the [Code of Conduct](https://www.rust-lang.org/policies/code-of-conduct)
40+
of the Rust project
41+
- is unlawful or promotes unlawful activities, incurring legal liability in the
42+
countries the Rust Foundation officially operates in
43+
- is libelous, defamatory, or fraudulent
44+
- amounts to phishing or attempted phishing
45+
- infringes any proprietary right of any party, including patent, trademark,
46+
trade secret, copyright, right of publicity, or other right
47+
- unlawfully shares unauthorized product licensing keys, software for
48+
generating unauthorized product licensing keys, or software for bypassing
49+
checks for product licensing keys, including extension of a free license
50+
beyond its trial period
51+
- contains malicious code, such as computer viruses, computer worms, rootkits,
52+
back doors, or spyware, including content submitted for research purposes
53+
(tools designed and documented explicitly to assist in security research are
54+
acceptable, but exploits and malware that use the crates.io registry as a
55+
deployment or delivery vector are not)
56+
- uses obfuscation to hide or mask functionality
57+
- is discriminatory toward, harasses or abuses another individual or group
58+
- threatens or incites violence toward any individual or group, especially on
59+
the basis of who they are
60+
- is using crates.io as a platform for propagating abuse on other platforms
61+
- violates the privacy of any third party, such as by posting another person's
62+
personal information without consent
63+
- gratuitously depicts or glorifies violence, including violent images
64+
- is sexually obscene or relates to sexual exploitation or abuse, including of
65+
minors (see "Sexually Obscene Content" section below)
66+
- is off-topic, or interacts with platform features in a way that significantly
67+
or repeatedly disrupts the experience of other users
68+
- exists only to reserve a name for a prolonged period of time (often called
69+
"name squatting") without having any genuine functionality, purpose, or
70+
significant development activity on the corresponding repository
71+
- is related to buying, selling, or otherwise trading of package names or any
72+
other names on crates.io for money or other compensation
73+
- impersonates any person or entity, including through false association with
74+
crates.io, or by fraudulently misrepresenting your identity or site's purpose
75+
- is related to inauthentic interactions, such as fake accounts and automated
76+
inauthentic activity
77+
- is using our servers for any form of excessive automated bulk activity, to
78+
place undue burden on our servers through automated means, or to relay any
79+
form of unsolicited advertising or solicitation through our servers, such as
80+
get-rich-quick schemes
81+
- is using our servers for other automated excessive bulk activity or
82+
coordinated inauthentic activity, such as
83+
- spamming
84+
- cryptocurrency mining
85+
- is not functionally compatible with the cargo build tool (for example, a
86+
"package" cannot simply be a PNG or JPEG image, a movie file, or a text
87+
document uploaded directly to the registry)
88+
- is abusing the package index for purposes it was not intended
89+
90+
You are responsible for using crates.io in compliance with all applicable laws,
91+
regulations, and all of our policies. These policies may be updated from time to
92+
time. We will interpret our policies and resolve disputes in favor of protecting
93+
users as a whole. The crates.io team reserves the possibility to evaluate each
94+
instance on a case-by-case basis.
95+
96+
For issues such as DMCA violations, or trademark and copyright infringements,
97+
the crates.io team will respect the legal decisions of the
98+
[Rust Foundation](https://rustfoundation.org/) as the official legal entity
99+
providing the crates.io service.
100+
101+
102+
## Package Ownership
103+
104+
crates.io has a first-come, first-serve policy on crate names. Upon publishing a
105+
package, the publisher will be made owner of the package on crates.io.
106+
107+
If you want to take over a package, we require you to first try and contact the
108+
current owner directly. If the current owner agrees, they can add you as an
109+
owner of the crate, and you can then remove them, if necessary. If the current
110+
owner is not reachable or has not published any contact information the
111+
crates.io team may reach out to help mediate the process of the ownership
112+
transfer.
113+
114+
Crate deletion by their owners is not possible to keep the registry as immutable
115+
as possible. If you want to flag your crate as open for transferring ownership
116+
to others, you can publish a new version with a message in the README or
117+
description communicating to the crates.io support team that you consent to
118+
transfer the crate to the first person who asks for it:
119+
120+
> I consent to the transfer of this crate to the first person who asks
121+
122+
123+
The crates.io team may delete crates from the registry that do not comply with
124+
the policies on this document. In larger cases of squatting attacks this may
125+
happen without prior notification to the author, but in most cases the team will
126+
first give the author the chance to justify the purpose of the crate.
127+
128+
129+
## Data Access
130+
131+
If you need access to a large subset of the crates.io database we recommend
132+
first looking at the **crates.io [index repository](https://github.com/rust-lang/crates.io-index)**.
133+
This repository is updated live whenever new versions are published and contains
134+
all the information needed for cargo to run the dependency resolution algorithm.
135+
136+
In case the index dataset is insufficient for your purposes, we also publish a
137+
**database dump** every 24 hours. This includes the majority of data from our
138+
database except for sensitive private information. The latest database dump is
139+
available at <https://static.crates.io/db-dump.tar.gz> and information on using
140+
the content is contained in the tarball. Please note that while we aim to keep
141+
the data structure somewhat stable, we can not give any stability guarantees on
142+
the exact database table layouts.
143+
144+
If the index repository and the database dump are insufficient you may also use
145+
the crates.io API directly, though it is at the discretion of the crates.io to
146+
block any excessive usage. We require users of the crates.io API to limit
147+
themselves to a maximum of 1 request per second.
148+
149+
We also require all API users to provide a user-agent header that allows us to
150+
uniquely identify your application. This allows us to more accurately monitor
151+
any impact your application may have on our service. Providing a user agent that
152+
only identifies your HTTP client library (such as `request/0.9.1`) increases the
153+
likelihood that we will block your traffic.
154+
155+
It is recommended, to include contact information in your user-agent header:
156+
157+
- Bad: `User-Agent: reqwest/0.9.1`
158+
- Better: `User-Agent: my_bot`
159+
- Best: `User-Agent: my_bot (my_bot.com/info)` or `User-Agent: my_bot (help@my_bot.com)`
160+
161+
This allows us to contact you if we would like a change in your application's
162+
behavior without having to block your traffic.
163+
164+
We reserve the right to block traffic from any client that we determine to be in
165+
violation of this policy or causing an impact on the integrity of our service.
166+
167+
168+
## Security
169+
170+
Safety is one of the core principles of Rust, and to that end, we would like to
171+
ensure that cargo and crates.io have secure implementations. To learn more about
172+
disclosing security vulnerabilities for these tools, please reference the
173+
[Rust Security policy](https://www.rust-lang.org/policies/security) for more
174+
details.
175+
176+
Note that this policy only applies to official Rust projects like crates.io and
177+
cargo, and not individual crates. The crates.io team and the Security Response
178+
working group are not responsible for the disclosure of vulnerabilities to
179+
specific crates, and if any issues are found, you should seek guidance from
180+
the individual crate owners and their specific policies instead.
181+
182+
Thank you for taking the time to responsibly disclose any issues you find.
183+
184+
185+
## Sexually Obscene Content
186+
187+
We do not tolerate content associated with sexual exploitation or abuse of
188+
another individual, including where minors are concerned. We do not allow
189+
sexually themed or suggestive content that serves little or no purpose other
190+
than to solicit an erotic or shocking response, particularly where that content
191+
is amplified by its placement in profiles or other social contexts.
192+
193+
This includes:
194+
195+
- Pornographic content
196+
- Non-consensual intimate imagery
197+
- Graphic depictions of sexual acts including photographs, video, animation,
198+
drawings, computer-generated images, or text-based content
199+
200+
We recognize that not all nudity or content related to sexuality is obscene.
201+
We may allow visual and/or textual depictions in artistic, educational,
202+
historical or journalistic contexts, or as it relates to victim advocacy. In
203+
some cases a disclaimer can help communicate the context of the project.
204+
205+
206+
## Violations and Enforcement
207+
208+
crates.io retains full discretion to take action in response to a violation of
209+
these policies, including account suspension, account termination, or removal of
210+
content.
211+
212+
We will however not be proactively monitoring the site for these kinds of
213+
violations, but instead relying on the community to draw them to our attention.
214+
215+
While the majority of interactions between individuals in the Rust community
216+
falls within our policies, violations of those policies do occur at times.
217+
When they do, the crates.io team may need to take enforcement action to address
218+
the violations. In all cases, content and account deletion is permanent and there
219+
is no basis to reverse these moderation actions taken by the crates.io team.
220+
Account suspension may be lifted at the team's discretion however, for example in
221+
the case of someone's account being compromised.
222+
223+
224+
## Credits & License
225+
226+
This policy is partially based on [PyPI’s Acceptable Use Policy](https://github.com/pypi/warehouse/blob/3c404ada9fed7a03bbf7c3c74e86c383f705d96a/policies/acceptable-use-policy.md)
227+
and modified from its original form.
228+
229+
Licensed under the [Creative Commons Attribution 4.0 International
230+
license](https://creativecommons.org/licenses/by/4.0/).
231+
232+
-------------------------------------------------------------------------------
233+
234+
# Prior art
235+
[prior-art]: #prior-art
236+
237+
As the "Credits & License" says, the main inspiration for the proposed policy is the [Acceptable Use Policy](https://pypi.org/policy/acceptable-use-policy/) of the Python Package Index (PyPI). Their policy in turn is based on the [Acceptable Use Policies](https://docs.github.com/en/site-policy/acceptable-use-policies/) of GitHub. Both of these policies are licensed under the [Creative Commons Attribution 4.0 International license](https://creativecommons.org/licenses/by/4.0/), so we can happily reuse them.
238+
239+
[PEP 541](https://peps.python.org/pep-0541/) (Python Enhancement Proposal) was also mixed into the document above, specifically the [Invalid Projects](https://peps.python.org/pep-0541/#invalid-projects) section.
240+
241+
The third source of material are the "[Open-Source Terms](https://docs.npmjs.com/policies/open-source-terms)" from npm, from which a few more rules on "Acceptable Content" were imported.
242+
243+
RubyGems, Maven Central, Packagist (PHP) and Nuget (C#) were also investigated, but they did not appear to have written rules published in easy-to-find places.
244+
245+
246+
# Unresolved questions
247+
[unresolved-questions]: #unresolved-questions
248+
249+
- Is the wording of the "name reservation" clause sufficient to discourage name squatting in the future?
250+
- Are there any current legitimate uses of crates.io that would suddenly be forbidden by these new rules?
251+
- Should the crates.io policies forbid embedding executable binaries in the crate files?
252+
253+
# Future possibilities
254+
[future-possibilities]: #future-possibilities
255+
256+
- [PEP 541](https://peps.python.org/pep-0541/) also defines rules for abandoned projects and how people could continue maintenance for them. Introducing something like that would be a large deviation for crates.io though, and something that would need a dedicated RFC. Nevertheless, it is worth thinking about if the majority of the Rust community would prefer having such a ruleset.

0 commit comments

Comments
 (0)