nya-proxy 0.3.0__tar.gz → 0.3.1__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.
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/PKG-INFO +1 -1
- nya_proxy-0.3.1/nya/_version.py +1 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/core/handler.py +12 -2
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya_proxy.egg-info/PKG-INFO +1 -1
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/pyproject.toml +1 -1
- nya_proxy-0.3.0/nya/_version.py +0 -1
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/LICENSE +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/README.md +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/__init__.py +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/common/__init__.py +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/common/constants.py +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/common/exceptions.py +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/common/models.py +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/config/__init__.py +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/config/manager.py +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/config.yaml +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/core/__init__.py +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/core/proxy.py +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/core/queue.py +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/core/request.py +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/core/streaming.py +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/dashboard/__init__.py +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/dashboard/api.py +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/html/favicon.ico +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/html/index.html +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/html/login.html +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/html/static/css/styles.css +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/html/static/js/dashboard.js +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/html/static/logo.svg +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/schema.json +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/server/__init__.py +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/server/app.py +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/server/auth.py +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/services/__init__.py +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/services/control.py +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/services/lb.py +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/services/limit.py +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/services/metrics.py +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/utils/__init__.py +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/utils/header.py +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya/utils/helper.py +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya_proxy.egg-info/SOURCES.txt +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya_proxy.egg-info/dependency_links.txt +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya_proxy.egg-info/entry_points.txt +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya_proxy.egg-info/requires.txt +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/nya_proxy.egg-info/top_level.txt +0 -0
- {nya_proxy-0.3.0 → nya_proxy-0.3.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nya-proxy
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: A lightweight, flexible API proxy with dynamic token rotation, load balancing, and rate limiting capabilities.
|
|
5
5
|
Author-email: "Nya Foundation Team (k3scat)" <k3scat@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.3.1"
|
|
@@ -3,6 +3,7 @@ Request handler for intercepting and forwarding HTTP requests with token rotatio
|
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
5
|
import random
|
|
6
|
+
import orjson
|
|
6
7
|
from typing import Any, Dict, Optional, Tuple
|
|
7
8
|
from urllib.parse import urlparse
|
|
8
9
|
|
|
@@ -164,8 +165,14 @@ class RequestHandler:
|
|
|
164
165
|
|
|
165
166
|
This method can be overridden to implement custom request body modifications.
|
|
166
167
|
"""
|
|
167
|
-
|
|
168
|
+
body_subst_enabled = self.config.get_api_request_body_substitution_enabled(
|
|
169
|
+
request.api_name
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
if not body_subst_enabled:
|
|
173
|
+
return
|
|
168
174
|
|
|
175
|
+
content_type = request.headers.get("content-type", "").lower()
|
|
169
176
|
if "application/json" not in content_type:
|
|
170
177
|
return
|
|
171
178
|
|
|
@@ -173,7 +180,10 @@ class RequestHandler:
|
|
|
173
180
|
if not rules:
|
|
174
181
|
return
|
|
175
182
|
|
|
176
|
-
apply_body_substitutions(request.content, rules)
|
|
183
|
+
modified_content = apply_body_substitutions(request.content, rules)
|
|
184
|
+
request.content = orjson.dumps(modified_content)
|
|
185
|
+
|
|
186
|
+
logger.debug("Request body substitutions applied successfully")
|
|
177
187
|
|
|
178
188
|
async def process_request_headers(self, request: ProxyRequest) -> None:
|
|
179
189
|
"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nya-proxy
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: A lightweight, flexible API proxy with dynamic token rotation, load balancing, and rate limiting capabilities.
|
|
5
5
|
Author-email: "Nya Foundation Team (k3scat)" <k3scat@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "nya-proxy"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.1"
|
|
8
8
|
description = "A lightweight, flexible API proxy with dynamic token rotation, load balancing, and rate limiting capabilities."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [
|
nya_proxy-0.3.0/nya/_version.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.3.0"
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|