httpbinx 1.8.1__tar.gz → 1.9.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.
Files changed (48) hide show
  1. {httpbinx-1.8.1 → httpbinx-1.9.0}/PKG-INFO +3 -2
  2. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/__init__.py +1 -1
  3. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/routers/__init__.py +4 -11
  4. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/routers/auth.py +2 -4
  5. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/routers/cookies.py +2 -5
  6. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/routers/dynamicdata.py +3 -7
  7. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/routers/inspection/request.py +1 -2
  8. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/routers/inspection/response.py +3 -5
  9. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/routers/redirects.py +2 -6
  10. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/routers/responseformats.py +4 -10
  11. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/routers/statuscodes.py +3 -7
  12. {httpbinx-1.8.1 → httpbinx-1.9.0}/pyproject.toml +3 -2
  13. {httpbinx-1.8.1 → httpbinx-1.9.0}/tests/test_dynamic_data.py +2 -2
  14. {httpbinx-1.8.1 → httpbinx-1.9.0}/tests/test_status_codes.py +1 -2
  15. {httpbinx-1.8.1 → httpbinx-1.9.0}/LICENSE +0 -0
  16. {httpbinx-1.8.1 → httpbinx-1.9.0}/README.md +0 -0
  17. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/cli.py +0 -0
  18. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/constants.py +0 -0
  19. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/examples/__init__.py +0 -0
  20. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/helpers.py +0 -0
  21. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/main.py +0 -0
  22. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/meta.py +0 -0
  23. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/routers/anything.py +0 -0
  24. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/routers/httpmethods.py +0 -0
  25. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/routers/images.py +0 -0
  26. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/routers/inspection/__init__.py +0 -0
  27. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/schemas.py +0 -0
  28. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/static/UTF-8-demo.txt +0 -0
  29. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/static/bombs/bomb-1GB.br +0 -0
  30. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/static/bombs/bomb-1GB.gz +0 -0
  31. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/static/favicon.png +0 -0
  32. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/static/images/httbinx_logo.png +0 -0
  33. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/static/images/httpbinx_cover.png +0 -0
  34. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/static/images/jackal.jpg +0 -0
  35. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/static/images/pig_icon.png +0 -0
  36. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/static/images/svg_logo.svg +0 -0
  37. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/static/images/wolf_1.webp +0 -0
  38. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/templates/moby.html +0 -0
  39. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/templates/sample.xml +0 -0
  40. {httpbinx-1.8.1 → httpbinx-1.9.0}/httpbinx/templates/trackingscripts.html +0 -0
  41. {httpbinx-1.8.1 → httpbinx-1.9.0}/tests/__init__.py +0 -0
  42. {httpbinx-1.8.1 → httpbinx-1.9.0}/tests/common.py +0 -0
  43. {httpbinx-1.8.1 → httpbinx-1.9.0}/tests/test_anything.py +0 -0
  44. {httpbinx-1.8.1 → httpbinx-1.9.0}/tests/test_http_methods.py +0 -0
  45. {httpbinx-1.8.1 → httpbinx-1.9.0}/tests/test_images.py +0 -0
  46. {httpbinx-1.8.1 → httpbinx-1.9.0}/tests/test_redirects.py +0 -0
  47. {httpbinx-1.8.1 → httpbinx-1.9.0}/tests/test_request_inspection.py +0 -0
  48. {httpbinx-1.8.1 → httpbinx-1.9.0}/tests/test_response_formats.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: httpbinx
3
- Version: 1.8.1
3
+ Version: 1.9.0
4
4
  Summary: HTTP Request & Response Service, written in Python + FastAPI.
5
5
  Author-Email: Leo <imleowoo@outlook.com>
6
6
  Maintainer-Email: Leo <imleowoo@outlook.com>
@@ -28,11 +28,12 @@ License: MIT License
28
28
 
29
29
  Classifier: Programming Language :: Python
30
30
  Classifier: Programming Language :: Python :: 3
31
- Classifier: Programming Language :: Python :: 3.8
32
31
  Classifier: Programming Language :: Python :: 3.9
33
32
  Classifier: Programming Language :: Python :: 3.10
34
33
  Classifier: Programming Language :: Python :: 3.11
35
34
  Classifier: Programming Language :: Python :: 3.12
35
+ Classifier: Programming Language :: Python :: 3.13
36
+ Classifier: Programming Language :: Python :: 3.14
36
37
  Classifier: License :: OSI Approved :: MIT License
37
38
  Project-URL: Homepage, https://github.com/imleowoo/httpbinx
38
39
  Project-URL: Repository, https://github.com/imleowoo/httpbinx
@@ -1,5 +1,5 @@
1
1
  from .main import app
2
2
 
3
- __version__ = '1.8.1'
3
+ __version__ = '1.9.0'
4
4
 
5
5
  app.version = __version__
@@ -6,17 +6,10 @@ from fastapi import APIRouter
6
6
  from starlette import status
7
7
  from starlette.responses import RedirectResponse
8
8
 
9
- from httpbinx.routers import anything
10
- from httpbinx.routers import auth
11
- from httpbinx.routers import cookies
12
- from httpbinx.routers import dynamicdata
13
- from httpbinx.routers import httpmethods
14
- from httpbinx.routers import images
15
- from httpbinx.routers import redirects
16
- from httpbinx.routers import responseformats
17
- from httpbinx.routers import statuscodes
18
- from httpbinx.routers.inspection import request_inspection
19
- from httpbinx.routers.inspection import response_inspection
9
+ from httpbinx.routers import (anything, auth, cookies, dynamicdata,
10
+ httpmethods, images, redirects, responseformats,
11
+ statuscodes)
12
+ from httpbinx.routers.inspection import request_inspection, response_inspection
20
13
 
21
14
  router = APIRouter()
22
15
 
@@ -1,9 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  """Auth"""
3
- from fastapi import APIRouter
4
- from fastapi import HTTPException
5
- from fastapi.security import HTTPBasic
6
- from fastapi.security import HTTPBasicCredentials
3
+ from fastapi import APIRouter, HTTPException
4
+ from fastapi.security import HTTPBasic, HTTPBasicCredentials
7
5
 
8
6
  router = APIRouter(tags=['Auth'],)
9
7
  security = HTTPBasic()
@@ -1,11 +1,8 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  """Cookies"""
3
- from fastapi import APIRouter
4
- from fastapi import Path
5
- from fastapi import Query
3
+ from fastapi import APIRouter, Path, Query
6
4
  from starlette.requests import Request
7
- from starlette.responses import JSONResponse
8
- from starlette.responses import RedirectResponse
5
+ from starlette.responses import JSONResponse, RedirectResponse
9
6
 
10
7
  from httpbinx.constants import ENV_COOKIES
11
8
 
@@ -6,16 +6,12 @@ import binascii
6
6
  import random
7
7
  import uuid
8
8
 
9
- from fastapi import APIRouter
10
- from fastapi import Path
11
- from fastapi import Query
9
+ from fastapi import APIRouter, Path, Query
12
10
  from fastapi.responses import PlainTextResponse
13
11
  from starlette import status
14
12
  from starlette.requests import Request
15
- from starlette.responses import HTMLResponse
16
- from starlette.responses import JSONResponse
17
- from starlette.responses import Response
18
- from starlette.responses import StreamingResponse
13
+ from starlette.responses import (HTMLResponse, JSONResponse, Response,
14
+ StreamingResponse)
19
15
 
20
16
  from httpbinx.constants import AWESOME_BASE64ENCODED
21
17
  from httpbinx.helpers import to_request_info
@@ -4,8 +4,7 @@ from starlette.requests import Request
4
4
  from starlette.responses import JSONResponse
5
5
 
6
6
  from httpbinx.helpers import to_request_info
7
- from httpbinx.schemas import RequestAttrs
8
- from httpbinx.schemas import RequestInfo
7
+ from httpbinx.schemas import RequestAttrs, RequestInfo
9
8
 
10
9
  router = APIRouter(tags=['Request inspection'])
11
10
 
@@ -1,14 +1,12 @@
1
1
  # -*- coding: utf-8 -*-
2
- from email.utils import formatdate
3
2
  import uuid
3
+ from email.utils import formatdate
4
4
 
5
- from fastapi import APIRouter
6
- from fastapi import Path
5
+ from fastapi import APIRouter, Path
7
6
  from starlette import status
8
7
  from starlette.requests import Request
9
8
 
10
- from httpbinx.helpers import parse_multi_value_header
11
- from httpbinx.helpers import status_code_response
9
+ from httpbinx.helpers import parse_multi_value_header, status_code_response
12
10
  from httpbinx.routers import httpmethods
13
11
 
14
12
  router = APIRouter(tags=['Response inspection'],)
@@ -1,13 +1,9 @@
1
- # -*- coding: utf-8 -*-
2
1
  from enum import Enum
3
2
 
4
- from fastapi import APIRouter
5
- from fastapi import Path
6
- from fastapi import Query
3
+ from fastapi import APIRouter, Path, Query
7
4
  from starlette import status
8
5
  from starlette.requests import Request
9
- from starlette.responses import RedirectResponse
10
- from starlette.responses import Response
6
+ from starlette.responses import RedirectResponse, Response
11
7
 
12
8
  router = APIRouter(tags=['Redirects'])
13
9
 
@@ -1,24 +1,18 @@
1
- # -*- coding: utf-8 -*-
2
1
  """Response Formats"""
3
2
  import gzip
4
3
  import zlib
5
4
 
6
5
  import brotli
7
- from fastapi import APIRouter
8
- from fastapi import Depends
6
+ from fastapi import APIRouter, Depends
9
7
  from fastapi.encoders import jsonable_encoder
10
- from fastapi.responses import HTMLResponse
11
- from fastapi.responses import PlainTextResponse
12
- from fastapi.responses import Response
8
+ from fastapi.responses import HTMLResponse, PlainTextResponse, Response
13
9
  from starlette import status
14
10
  from starlette.requests import Request
15
11
  from starlette.responses import JSONResponse
16
12
  from starlette.templating import Jinja2Templates
17
13
 
18
- from httpbinx.constants import ANGRY_ASCII
19
- from httpbinx.constants import ROBOT_TXT
20
- from httpbinx.helpers import get_templates
21
- from httpbinx.helpers import to_request_info
14
+ from httpbinx.constants import ANGRY_ASCII, ROBOT_TXT
15
+ from httpbinx.helpers import get_templates, to_request_info
22
16
  from httpbinx.schemas import RequestInfo
23
17
 
24
18
  router = APIRouter(tags=['Response formats'])
@@ -1,11 +1,7 @@
1
- # -*- coding: utf-8 -*-
2
- from fastapi import APIRouter
3
- from fastapi import Path
4
- from starlette.responses import PlainTextResponse
5
- from starlette.responses import Response
1
+ from fastapi import APIRouter, Path
2
+ from starlette.responses import PlainTextResponse, Response
6
3
 
7
- from httpbinx.helpers import status_code_response
8
- from httpbinx.helpers import weighted_choice
4
+ from httpbinx.helpers import status_code_response, weighted_choice
9
5
 
10
6
  router = APIRouter(tags=['Status codes'])
11
7
 
@@ -27,14 +27,15 @@ maintainers = [
27
27
  classifiers = [
28
28
  "Programming Language :: Python",
29
29
  "Programming Language :: Python :: 3",
30
- "Programming Language :: Python :: 3.8",
31
30
  "Programming Language :: Python :: 3.9",
32
31
  "Programming Language :: Python :: 3.10",
33
32
  "Programming Language :: Python :: 3.11",
34
33
  "Programming Language :: Python :: 3.12",
34
+ "Programming Language :: Python :: 3.13",
35
+ "Programming Language :: Python :: 3.14",
35
36
  "License :: OSI Approved :: MIT License",
36
37
  ]
37
- version = "1.8.1"
38
+ version = "1.9.0"
38
39
 
39
40
  [project.license]
40
41
  file = "LICENSE"
@@ -2,9 +2,9 @@
2
2
  """
3
3
  Tag: Dynamic Data
4
4
  """
5
- from base64 import b64encode
6
5
  import time
7
6
  import uuid
7
+ from base64 import b64encode
8
8
 
9
9
  from fastapi.testclient import TestClient
10
10
  from starlette import status
@@ -40,7 +40,7 @@ def test_bytes():
40
40
  # Retrieve large bytes.
41
41
  n = 2 ** 10 * 1000
42
42
  response = client.get(f'/bytes/{n}')
43
- assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY
43
+ assert response.status_code == status.HTTP_422_UNPROCESSABLE_CONTENT
44
44
 
45
45
 
46
46
  def test_delay():
@@ -1,4 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
1
  """
3
2
  Tag: Status Codes
4
3
  """
@@ -14,7 +13,7 @@ client = TestClient(app)
14
13
 
15
14
  def test_status_codes():
16
15
  # All HTTP Codes
17
- for name in [c for c in dir(status) if c.startswith('HTTP')]:
16
+ for name in [c for c in dir(status) if c.startswith('HTTP') and c not in status.__deprecated__]:
18
17
  target_code = getattr(status, name)
19
18
  for method in ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'TRACE']:
20
19
  response = client.request(method=method, url=f'/status/{target_code}')
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes