httpx-secure 1.1.0__tar.gz → 1.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,454 @@
1
+ # File created using '.gitignore Generator' for Visual Studio Code: https://bit.ly/vscode-gig
2
+ # Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,linux,c,cmake,direnv,dotenv,node,python,rust
3
+ # Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,linux,c,cmake,direnv,dotenv,node,python,rust
4
+
5
+ ### C ###
6
+ # Prerequisites
7
+ *.d
8
+
9
+ # Object files
10
+ *.o
11
+ *.ko
12
+ *.obj
13
+ *.elf
14
+
15
+ # Linker output
16
+ *.ilk
17
+ *.map
18
+ *.exp
19
+
20
+ # Precompiled Headers
21
+ *.gch
22
+ *.pch
23
+
24
+ # Libraries
25
+ *.lib
26
+ *.a
27
+ *.la
28
+ *.lo
29
+
30
+ # Shared objects (inc. Windows DLLs)
31
+ *.dll
32
+ *.so
33
+ *.so.*
34
+ *.dylib
35
+
36
+ # Executables
37
+ *.exe
38
+ *.out
39
+ *.app
40
+ *.i*86
41
+ *.x86_64
42
+ *.hex
43
+
44
+ # Debug files
45
+ *.dSYM/
46
+ *.su
47
+ *.idb
48
+ *.pdb
49
+
50
+ # Kernel Module Compile Results
51
+ *.mod*
52
+ *.cmd
53
+ .tmp_versions/
54
+ modules.order
55
+ Module.symvers
56
+ Mkfile.old
57
+ dkms.conf
58
+
59
+ ### CMake ###
60
+ CMakeLists.txt.user
61
+ CMakeCache.txt
62
+ CMakeFiles
63
+ CMakeScripts
64
+ Testing
65
+ Makefile
66
+ cmake_install.cmake
67
+ install_manifest.txt
68
+ compile_commands.json
69
+ CTestTestfile.cmake
70
+ _deps
71
+
72
+ ### CMake Patch ###
73
+ CMakeUserPresets.json
74
+
75
+ # External projects
76
+ *-prefix/
77
+
78
+ ### direnv ###
79
+ .direnv
80
+ .envrc
81
+
82
+ ### dotenv ###
83
+ .env
84
+
85
+ ### Linux ###
86
+ *~
87
+
88
+ # temporary files which can be created if a process still has a handle open of a deleted file
89
+ .fuse_hidden*
90
+
91
+ # KDE directory preferences
92
+ .directory
93
+
94
+ # Linux trash folder which might appear on any partition or disk
95
+ .Trash-*
96
+
97
+ # .nfs files are created when an open file is removed but is still being accessed
98
+ .nfs*
99
+
100
+ ### Node ###
101
+ # Logs
102
+ logs
103
+ *.log
104
+ npm-debug.log*
105
+ yarn-debug.log*
106
+ yarn-error.log*
107
+ lerna-debug.log*
108
+ .pnpm-debug.log*
109
+
110
+ # Diagnostic reports (https://nodejs.org/api/report.html)
111
+ report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
112
+
113
+ # Runtime data
114
+ pids
115
+ *.pid
116
+ *.seed
117
+ *.pid.lock
118
+
119
+ # Directory for instrumented libs generated by jscoverage/JSCover
120
+ lib-cov
121
+
122
+ # Coverage directory used by tools like istanbul
123
+ coverage
124
+ *.lcov
125
+
126
+ # nyc test coverage
127
+ .nyc_output
128
+
129
+ # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
130
+ .grunt
131
+
132
+ # Bower dependency directory (https://bower.io/)
133
+ bower_components
134
+
135
+ # node-waf configuration
136
+ .lock-wscript
137
+
138
+ # Compiled binary addons (https://nodejs.org/api/addons.html)
139
+ build/Release
140
+
141
+ # Dependency directories
142
+ node_modules/
143
+ jspm_packages/
144
+
145
+ # Snowpack dependency directory (https://snowpack.dev/)
146
+ web_modules/
147
+
148
+ # TypeScript cache
149
+ *.tsbuildinfo
150
+
151
+ # Optional npm cache directory
152
+ .npm
153
+
154
+ # Optional eslint cache
155
+ .eslintcache
156
+
157
+ # Optional stylelint cache
158
+ .stylelintcache
159
+
160
+ # Microbundle cache
161
+ .rpt2_cache/
162
+ .rts2_cache_cjs/
163
+ .rts2_cache_es/
164
+ .rts2_cache_umd/
165
+
166
+ # Optional REPL history
167
+ .node_repl_history
168
+
169
+ # Output of 'npm pack'
170
+ *.tgz
171
+
172
+ # Yarn Integrity file
173
+ .yarn-integrity
174
+
175
+ # dotenv environment variable files
176
+ .env.development.local
177
+ .env.test.local
178
+ .env.production.local
179
+ .env.local
180
+
181
+ # parcel-bundler cache (https://parceljs.org/)
182
+ .cache
183
+ .parcel-cache
184
+
185
+ # Next.js build output
186
+ .next
187
+ out
188
+
189
+ # Nuxt.js build / generate output
190
+ .nuxt
191
+ dist
192
+
193
+ # Gatsby files
194
+ .cache/
195
+ # Comment in the public line in if your project uses Gatsby and not Next.js
196
+ # https://nextjs.org/blog/next-9-1#public-directory-support
197
+ # public
198
+
199
+ # vuepress build output
200
+ .vuepress/dist
201
+
202
+ # vuepress v2.x temp and cache directory
203
+ .temp
204
+
205
+ # Docusaurus cache and generated files
206
+ .docusaurus
207
+
208
+ # Serverless directories
209
+ .serverless/
210
+
211
+ # FuseBox cache
212
+ .fusebox/
213
+
214
+ # DynamoDB Local files
215
+ .dynamodb/
216
+
217
+ # TernJS port file
218
+ .tern-port
219
+
220
+ # Stores VSCode versions used for testing VSCode extensions
221
+ .vscode-test
222
+
223
+ # yarn v2
224
+ .yarn/cache
225
+ .yarn/unplugged
226
+ .yarn/build-state.yml
227
+ .yarn/install-state.gz
228
+ .pnp.*
229
+
230
+ ### Node Patch ###
231
+ # Serverless Webpack directories
232
+ .webpack/
233
+
234
+ # Optional stylelint cache
235
+
236
+ # SvelteKit build / generate output
237
+ .svelte-kit
238
+
239
+ ### Python ###
240
+ # Byte-compiled / optimized / DLL files
241
+ __pycache__/
242
+ *.py[cod]
243
+ *$py.class
244
+
245
+ # C extensions
246
+
247
+ # Distribution / packaging
248
+ .Python
249
+ build/
250
+ develop-eggs/
251
+ dist/
252
+ downloads/
253
+ eggs/
254
+ .eggs/
255
+ lib/
256
+ lib64/
257
+ parts/
258
+ sdist/
259
+ var/
260
+ wheels/
261
+ share/python-wheels/
262
+ *.egg-info/
263
+ .installed.cfg
264
+ *.egg
265
+ MANIFEST
266
+
267
+ # PyInstaller
268
+ # Usually these files are written by a python script from a template
269
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
270
+ *.manifest
271
+ *.spec
272
+
273
+ # Installer logs
274
+ pip-log.txt
275
+ pip-delete-this-directory.txt
276
+
277
+ # Unit test / coverage reports
278
+ htmlcov/
279
+ .tox/
280
+ .nox/
281
+ .coverage
282
+ .coverage.*
283
+ nosetests.xml
284
+ coverage.xml
285
+ *.cover
286
+ *.py,cover
287
+ .hypothesis/
288
+ .pytest_cache/
289
+ cover/
290
+
291
+ # Translations
292
+ *.mo
293
+ *.pot
294
+
295
+ # Django stuff:
296
+ local_settings.py
297
+ db.sqlite3
298
+ db.sqlite3-journal
299
+
300
+ # Flask stuff:
301
+ instance/
302
+ .webassets-cache
303
+
304
+ # Scrapy stuff:
305
+ .scrapy
306
+
307
+ # Sphinx documentation
308
+ docs/_build/
309
+
310
+ # PyBuilder
311
+ .pybuilder/
312
+ target/
313
+
314
+ # Jupyter Notebook
315
+ .ipynb_checkpoints
316
+
317
+ # IPython
318
+ profile_default/
319
+ ipython_config.py
320
+
321
+ # pyenv
322
+ # For a library or package, you might want to ignore these files since the code is
323
+ # intended to run in multiple environments; otherwise, check them in:
324
+ # .python-version
325
+
326
+ # pipenv
327
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
328
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
329
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
330
+ # install all needed dependencies.
331
+ #Pipfile.lock
332
+
333
+ # poetry
334
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
335
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
336
+ # commonly ignored for libraries.
337
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
338
+ #poetry.lock
339
+
340
+ # pdm
341
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
342
+ #pdm.lock
343
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
344
+ # in version control.
345
+ # https://pdm.fming.dev/#use-with-ide
346
+ .pdm.toml
347
+
348
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
349
+ __pypackages__/
350
+
351
+ # Celery stuff
352
+ celerybeat-schedule
353
+ celerybeat.pid
354
+
355
+ # SageMath parsed files
356
+ *.sage.py
357
+
358
+ # Environments
359
+ .venv
360
+ env/
361
+ venv/
362
+ ENV/
363
+ env.bak/
364
+ venv.bak/
365
+
366
+ # Spyder project settings
367
+ .spyderproject
368
+ .spyproject
369
+
370
+ # Rope project settings
371
+ .ropeproject
372
+
373
+ # mkdocs documentation
374
+ /site
375
+
376
+ # mypy
377
+ .mypy_cache/
378
+ .dmypy.json
379
+ dmypy.json
380
+
381
+ # Pyre type checker
382
+ .pyre/
383
+
384
+ # pytype static type analyzer
385
+ .pytype/
386
+
387
+ # Cython debug symbols
388
+ cython_debug/
389
+
390
+ # PyCharm
391
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
392
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
393
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
394
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
395
+ #.idea/
396
+
397
+ ### Python Patch ###
398
+ # Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
399
+ poetry.toml
400
+
401
+ # ruff
402
+ .ruff_cache/
403
+
404
+ # LSP config files
405
+ pyrightconfig.json
406
+
407
+ ### Rust ###
408
+ # Generated by Cargo
409
+ # will have compiled files and executables
410
+ debug/
411
+
412
+ # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
413
+ # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
414
+ Cargo.lock
415
+
416
+ # These are backup files generated by rustfmt
417
+ **/*.rs.bk
418
+
419
+ # MSVC Windows builds of rustc generate these, which store debugging information
420
+
421
+ ### VisualStudioCode ###
422
+ .vscode/*
423
+ !.vscode/settings.json
424
+ !.vscode/tasks.json
425
+ !.vscode/launch.json
426
+ !.vscode/extensions.json
427
+ !.vscode/*.code-snippets
428
+
429
+ # Local History for Visual Studio Code
430
+ .history/
431
+
432
+ # Built Visual Studio Code Extensions
433
+ *.vsix
434
+
435
+ ### VisualStudioCode Patch ###
436
+ # Ignore all local history of files
437
+ .history
438
+ .ionide
439
+
440
+ # End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,linux,c,cmake,direnv,dotenv,node,python,rust
441
+
442
+ # Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)
443
+
444
+ !.envrc
445
+
446
+ .codex
447
+ repomix-output.xml
448
+ uv.lock
449
+ vendor/
450
+
451
+ githead/tests/git/HEAD
452
+ h2corn/bench/*.bin
453
+ h2corn/bench/results/*_summary.json
454
+ jinja2-htmlmin/tests/templates/.*
@@ -1,12 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: httpx-secure
3
- Version: 1.1.0
3
+ Version: 1.3.0
4
4
  Summary: Drop-in SSRF protection for httpx
5
- Project-URL: Repository, https://github.com/Zaczero/httpx-secure
6
- Project-URL: Issues, https://github.com/Zaczero/httpx-secure/issues
5
+ Project-URL: Issues, https://github.com/Zaczero/pkgs/issues
6
+ Project-URL: Repository, https://github.com/Zaczero/pkgs/tree/main/httpx-secure
7
7
  Author-email: Kamil Monicz <kamil@monicz.dev>
8
8
  License-Expression: 0BSD
9
- License-File: LICENSE
10
9
  Keywords: anyio,async,asyncio,client,dns,dns-cache,http,httpx,security,ssrf,ssrf-protection,trio,web-security
11
10
  Classifier: Development Status :: 5 - Production/Stable
12
11
  Classifier: Framework :: AnyIO
@@ -15,7 +14,6 @@ Classifier: Framework :: Trio
15
14
  Classifier: Intended Audience :: Developers
16
15
  Classifier: License :: OSI Approved :: Zero-Clause BSD (0BSD)
17
16
  Classifier: Operating System :: OS Independent
18
- Classifier: Programming Language :: Python :: 3
19
17
  Classifier: Programming Language :: Python :: 3.9
20
18
  Classifier: Programming Language :: Python :: 3.10
21
19
  Classifier: Programming Language :: Python :: 3.11
@@ -29,15 +27,13 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
29
27
  Classifier: Topic :: System :: Networking
30
28
  Classifier: Typing :: Typed
31
29
  Requires-Python: >=3.9
32
- Requires-Dist: anyio
33
- Requires-Dist: httpx
30
+ Requires-Dist: anyio>=3.0.0
31
+ Requires-Dist: httpx>=0.20.0
34
32
  Description-Content-Type: text/markdown
35
33
 
36
34
  # httpx-secure
37
35
 
38
36
  [![PyPI - Python Version](https://shields.monicz.dev/pypi/pyversions/httpx-secure)](https://pypi.org/p/httpx-secure)
39
- [![Liberapay Patrons](https://shields.monicz.dev/liberapay/patrons/Zaczero?logo=liberapay&label=Patrons)](https://liberapay.com/Zaczero/)
40
- [![GitHub Sponsors](https://shields.monicz.dev/github/sponsors/Zaczero?logo=github&label=Sponsors&color=%23db61a2)](https://github.com/sponsors/Zaczero)
41
37
 
42
38
  Drop-in SSRF protection for httpx.
43
39
 
@@ -52,7 +48,7 @@ Drop-in SSRF protection for httpx.
52
48
 
53
49
  ## Installation
54
50
 
55
- ```bash
51
+ ```sh
56
52
  pip install httpx-secure
57
53
  ```
58
54
 
@@ -65,7 +61,7 @@ from httpx_secure import httpx_ssrf_protection
65
61
  client = httpx_ssrf_protection(
66
62
  httpx.AsyncClient(),
67
63
  dns_cache_size=1000, # Cache up to 1000 DNS resolutions
68
- dns_cache_ttl=300, # Cache for 5 minutes
64
+ dns_cache_ttl=600, # Cache for 10 minutes
69
65
  )
70
66
 
71
67
  await client.get("https://public.domain") # Allowed
@@ -1,8 +1,6 @@
1
1
  # httpx-secure
2
2
 
3
3
  [![PyPI - Python Version](https://shields.monicz.dev/pypi/pyversions/httpx-secure)](https://pypi.org/p/httpx-secure)
4
- [![Liberapay Patrons](https://shields.monicz.dev/liberapay/patrons/Zaczero?logo=liberapay&label=Patrons)](https://liberapay.com/Zaczero/)
5
- [![GitHub Sponsors](https://shields.monicz.dev/github/sponsors/Zaczero?logo=github&label=Sponsors&color=%23db61a2)](https://github.com/sponsors/Zaczero)
6
4
 
7
5
  Drop-in SSRF protection for httpx.
8
6
 
@@ -17,7 +15,7 @@ Drop-in SSRF protection for httpx.
17
15
 
18
16
  ## Installation
19
17
 
20
- ```bash
18
+ ```sh
21
19
  pip install httpx-secure
22
20
  ```
23
21
 
@@ -30,7 +28,7 @@ from httpx_secure import httpx_ssrf_protection
30
28
  client = httpx_ssrf_protection(
31
29
  httpx.AsyncClient(),
32
30
  dns_cache_size=1000, # Cache up to 1000 DNS resolutions
33
- dns_cache_ttl=300, # Cache for 5 minutes
31
+ dns_cache_ttl=600, # Cache for 10 minutes
34
32
  )
35
33
 
36
34
  await client.get("https://public.domain") # Allowed