python / python/cpython

CIDR support for proxy bypass list

Aberta
#149,746 2 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

stdlib triaged type-feature
Linguagem predominante
Python
Estrelas
77.2k
Forks
35.9k
Métricas de merge de PRs
Métricas de PR pendentes

Descrição

Feature or enhancement

Proposal:

I propose adding universal support for CIDR-notation IP addresses when reading NO_PROXY / the OS-specific equivalents.

Currently, support for NO_PROXY is a bit inconsistent, both across the ecosystem and within Python. On MacOS using SystemConfiguration, CIDR is supported out of the box, as is the short notation 10.0. The default implementation and the windows nt ProxyOverride registry key do not. Go and curl and wget all support CIDR notation, so despite not being standardized, there is precedent towards this.

In some environments, all outbound traffic is required to go through a proxy. However, traffic to internal services is allowed to be direct (for performance, or inherent trust, or any other reason). An example NO_PROXY may look like NO_PROXY=localhost,.localhost,127.0.0.1,127.0.0.2,0.0.0.0,169.254.169.254,10.0.0.0/8,.internal.,.internal,.local.,.local.

Has this already been discussed elsewhere?

I have already discussed this feature proposal on Discourse

Links to previous discussion of this feature:

https://discuss.python.org/t/support-cidr-notation-in-no-proxy/66292 - discussion was tepid but leant towards yes if a good PR was proposed. I'm working on that in tandem with this gh ticket.

Windows specifically: https://github.com/python/cpython/issues/149136

More generally: https://about.gitlab.com/blog/we-need-to-talk-no-proxy/

Linked PRs
  • gh-149744
  • gh-156336

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Direção de pesquisa

Comece revisando o trabalho relacionado em gh-149744 e gh-156336; em seguida, leia a discussão relacionada no Discourse e a issue do Windows gh-149136. O resultado solicitado é um tratamento consistente da notação CIDR para NO_PROXY e seus equivalentes específicos do sistema operacional, incluindo os exemplos de redes internas listados.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
python
Domínio
networking
Tipo de issue
Funcionalidade
Dificuldade
4/5
Tempo estimado
3-5 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
25/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.