|
| 1 | +PEP: 583 |
| 2 | +Title: Vote for trusted packages |
| 3 | +Version: $Revision$ |
| 4 | +Last-Modified: $Date$ |
| 5 | +Author: Hervé Beraud < [email protected]> |
| 6 | +Status: Draft |
| 7 | +Type: Standards Track |
| 8 | +Content-Type: text/x-rst |
| 9 | +Created: 25-Jun-2018 |
| 10 | +Python-Version: 3.8 |
| 11 | + |
| 12 | + |
| 13 | +Abstract |
| 14 | +======== |
| 15 | + |
| 16 | +This PEP outlines the voting mechanism to define trusted packages. |
| 17 | +It's the continuity of the PEP-582 and it's the methodoly part of the set |
| 18 | +of the functionality defined for the new behavior of the package management. |
| 19 | + |
| 20 | + |
| 21 | +Motivation |
| 22 | +========== |
| 23 | + |
| 24 | +Packages namespaces introduced by the PEP-582 need to define a voting |
| 25 | +system to remove namespaces on mainstream packages or on none forked |
| 26 | +packages. |
| 27 | + |
| 28 | +With this feature we can introduce trusted packages by allow install/search |
| 29 | +without namespace and add namespaces on untrusted packages like the |
| 30 | +docker behavior (`docker pull nginx` or `docker pull 4383/nginx`). |
| 31 | + |
| 32 | +Also, project namespace and trusted packages help us to reduce some |
| 33 | +security risks, like typo squatting (example_, `pypa github discussion`_). |
| 34 | + |
| 35 | +.. _example: http://www.nbu.gov.sk/skcsirt-sa-20170909-pypi/index.html |
| 36 | +.. _pypa_github_discussion: https://github.com/pypa/pypi-legacy/issues/644 |
| 37 | + |
| 38 | + |
| 39 | +Rationale |
| 40 | +========= |
| 41 | + |
| 42 | +With this mechanism we can introduce trusted packages by allowing |
| 43 | +install/search without namespace and add namespaces on untrusted packages like |
| 44 | +the docker command behavior (`docker pull nginx` or `docker pull 4383/nginx`). |
| 45 | + |
| 46 | + |
| 47 | +How to work docker command? |
| 48 | +--------------------------- |
| 49 | + |
| 50 | +On docker a trusted package is package maintained by the docker team himeself. |
| 51 | +Namespace does not exist when the package is maintained by the docker team. |
| 52 | +When a package is maintain by a third user namespace appear into the name. |
| 53 | + |
| 54 | + |
| 55 | +How to work inside the python community? |
| 56 | +---------------------------------------- |
| 57 | + |
| 58 | +The goal of this PEP is not to delegate the trusted projects maintainance |
| 59 | +to the pypa team or to a specific python contributor team. Projects rest |
| 60 | +owned and maintained by their original teams. |
| 61 | + |
| 62 | +This PEP propose to create a specific repository on github to manage/elect |
| 63 | +trusted projects. The repository need to be hosted under the |
| 64 | +pypa organisation and can be named `pypa/trusted`. |
| 65 | + |
| 66 | + |
| 67 | +How to define the namespace? |
| 68 | +---------------------------- |
| 69 | + |
| 70 | +By default the used namespace is the username of the pypa account. |
| 71 | + |
| 72 | + |
| 73 | +how to define if a project is trusted? |
| 74 | +-------------------------------------- |
| 75 | + |
| 76 | +Projects can being trusted by sending a pull request on the `pypa/trusted` |
| 77 | +repository. |
| 78 | + |
| 79 | +A pull request need to be a formalized file where projects teams can define |
| 80 | +a project owning. |
| 81 | + |
| 82 | +A unique pull request by project need to send and a robot can check if the |
| 83 | +project was already trusted to reduce boring tasks. |
| 84 | + |
| 85 | +A review must be realized on these pull requests and if the pypa team decide to |
| 86 | +accept the project become automaticaly trusted. |
| 87 | + |
| 88 | +Merge a pull request allow Pypa to remove the namespace automaticaly. |
| 89 | +To define if a project is trusted project the maintainers need to send |
| 90 | +a formalized pull request to the `pypa/trusted` repository. |
| 91 | + |
| 92 | +Reviewer accept or reject the pull request. We can require a minimum number of |
| 93 | +review to ensure that is a really trusted package. |
| 94 | + |
| 95 | + |
| 96 | +How to standardize informations sended with the pull request? |
| 97 | +------------------------------------------------------------- |
| 98 | + |
| 99 | +Like PEPs repository, `pypa/trusted` must contains a file by project who ask |
| 100 | +to become trusted. |
| 101 | + |
| 102 | +Each files must be named with the same name of the project without prefixed |
| 103 | +by the namespace. The mechanisme avoid two person to ask the same name for |
| 104 | +two different projects (forks use case...). |
| 105 | + |
| 106 | +Each files must contains the following information in yaml format (by example): |
| 107 | +- name: the project name |
| 108 | +- namespace: the project namespace |
| 109 | +- author_email: the email of the author to be sure that correspond |
| 110 | + to package informations. |
| 111 | + |
| 112 | + |
| 113 | +How reviewers must validate pull requests? |
| 114 | +------------------------------------------ |
| 115 | + |
| 116 | +Each reviewer need to verify that informations correspond to the original |
| 117 | +project maintainer (none forked project), that project is not a typo squatting |
| 118 | +(cf. requests/request). |
| 119 | + |
| 120 | + |
| 121 | +What's the impact on the python ecosystem? |
| 122 | +------------------------------------------ |
| 123 | + |
| 124 | +- Warehouse need to be updated to deal with namespaces |
| 125 | +- pip need to be updated to deal with namespaces |
| 126 | + |
| 127 | +I don't think that distutils or setuptools are impacted by this. |
| 128 | + |
| 129 | + |
| 130 | +Benefits |
| 131 | +======== |
| 132 | + |
| 133 | +- Improve project trust |
| 134 | +- Improve package trusting and reduce the risk that users deal with |
| 135 | + a miscellaneous package |
| 136 | +- Allow users to provide forked version of an official project |
| 137 | +- Allow users to test that packaging work fine on pypi |
| 138 | + |
| 139 | + |
| 140 | +Copyright |
| 141 | +========= |
| 142 | + |
| 143 | +This document has been placed in the public domain. |
| 144 | + |
| 145 | + |
| 146 | + |
| 147 | +.. |
| 148 | + Local Variables: |
| 149 | + mode: indented-text |
| 150 | + indent-tabs-mode: nil |
| 151 | + sentence-end-double-space: t |
| 152 | + fill-column: 70 |
| 153 | + coding: utf-8 |
| 154 | + End: |
| 155 | +
|
0 commit comments