| 1 |
<!-- |
| 2 |
We welcome your pull request, but because this crate is downloaded about 1.7 million times per month (see https://crates.io/crates/zip), |
| 3 |
and because ZIP file processing has caused security issues in the past (see |
| 4 |
https://www.cvedetails.com/vulnerability-search.php?f=1&vendor=&product=zip&cweid=&cvssscoremin=&cvssscoremax=&publishdatestart=&publishdateend=&updatedatestart=&updatedateend=&cisaaddstart=&cisaaddend=&cisaduestart=&cisadueend=&page=1 |
| 5 |
for the gory details), we have some requirements that help ensure we maintain developers' and their clients' trust. |
| 6 |
This implies some requirements that a lot of PRs don't initially meet. |
| 7 |
|
| 8 |
This crate doesn't filter out "ZIP bombs" because extreme compression ratios and shallow file copies have legitimate uses; but |
| 9 |
I expect the tools the crate provides for checking that extraction is safe, such as the `ZipArchive::decompressed_size` method in |
| 10 |
https://github.com/zip-rs/zip2/blob/master/src/read.rs, to remain reliably effective. I also expect all the crate's methods to |
| 11 |
remain panic-free, so that this crate can be used on servers without creating a denial-of-service vulnerability. |
| 12 |
|
| 13 |
These are our requirements for PRs, in addition to the usual functionality and readability requirements: |
| 14 |
- This codebase sometimes changes rapidly. Please rebase your branch before opening a pull request, and |
| 15 |
grant @Pr0methean write access to the source branch (so I can fix later conflicts without being subject |
| 16 |
to the limitations of the web UI) if EITHER of the following apply: |
| 17 |
- It has been at least 24 hours since you forked the repo or previously rebased the branch; or |
| 18 |
- 5 or more pull requests are already open at https://github.com/zip-rs/zip2/pulls. PRs are merged in the order they become |
| 19 |
eligible (reviewed, passing CI tests, and no conflicts with the base branch). I will attempt to fix merge |
| 20 |
conflicts, but this is best-effort. |
| 21 |
- Please make sure your PR's target repo is `zip-rs/zip2` and not `zip-rs/zip-old`. The latter |
| 22 |
repo is no longer maintained, and I will archive it after closing the pre-existing issues. |
| 23 |
- Your changes must build against the MSRV (see README.md) AND the latest stable Rust version AND the latest nightly Rust version. |
| 24 |
- PRs must pass all the checks specified in `.github/workflows/ci.yaml`, which include: |
| 25 |
- Unit tests, run with `--no-default-features` AND with `--all-features` AND with the default features, each run |
| 26 |
against the MSRV (see README.md) AND the latest stable Rust version AND the latest nightly Rust version, on Windows, MacOS |
| 27 |
AND Ubuntu (yes, that's a 3-dimensional matrix). |
| 28 |
- `cargo clippy --all-targets` and `cargo doc --no-deps` must pass with `--no-default-features` AND with `--all-features` |
| 29 |
AND with the default features. |
| 30 |
- `cargo fmt --check --all` must pass. |
| 31 |
- If the above checks force you to add a new `#[allow]` attribute, please place a comment on the same line or just above it, |
| 32 |
explaining what the exception applies to and why it's needed. |
| 33 |
- Commit messages and the PR title must conform to [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) and start |
| 34 |
with one of the types specified by the [Angular convention](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#type). |
| 35 |
- All commits must be signed and display a "Verified" badge; see |
| 36 |
https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification. |
| 37 |
If any of your commits don't have a "Verified" badge, here's how to fix this: |
| 38 |
1. Generate a GPG key if you don't already have one, by following |
| 39 |
https://docs.github.com/en/authentication/managing-commit-signature-verification/generating-a-new-gpg-key. |
| 40 |
2. If you use GitHub's email privacy feature, associate the key with your users.noreply.github.com email address by following |
| 41 |
https://docs.github.com/en/authentication/managing-commit-signature-verification/associating-an-email-with-your-gpg-key. |
| 42 |
3. Configure Git to use your signing key by following |
| 43 |
https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key |
| 44 |
4. Add the key to your GitHub account by following |
| 45 |
https://docs.github.com/en/authentication/managing-commit-signature-verification/adding-a-gpg-key-to-your-github-account |
| 46 |
5. Enable commit signing by following |
| 47 |
https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits |
| 48 |
6. Squash your PR into one commit or run `git commit --amend --no-edit`, because enabling commit signing isn't retroactive |
| 49 |
even for unpushed commits. |
| 50 |
|
| 51 |
Thanks in advance for submitting a bug fix or proposed feature that meets these requirements! |
| 52 |
--> |