nya-proxy 0.2.4__tar.gz → 0.2.5__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 (49) hide show
  1. {nya_proxy-0.2.4/nya_proxy.egg-info → nya_proxy-0.2.5}/PKG-INFO +2 -2
  2. nya_proxy-0.2.5/nya/_version.py +1 -0
  3. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/html/login.html +46 -100
  4. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/server/auth.py +0 -1
  5. {nya_proxy-0.2.4 → nya_proxy-0.2.5/nya_proxy.egg-info}/PKG-INFO +2 -2
  6. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya_proxy.egg-info/requires.txt +1 -1
  7. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/pyproject.toml +2 -2
  8. nya_proxy-0.2.4/nya/_version.py +0 -1
  9. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/LICENSE +0 -0
  10. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/README.md +0 -0
  11. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/__init__.py +0 -0
  12. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/common/__init__.py +0 -0
  13. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/common/constants.py +0 -0
  14. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/common/exceptions.py +0 -0
  15. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/common/models.py +0 -0
  16. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/config/__init__.py +0 -0
  17. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/config/manager.py +0 -0
  18. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/config.yaml +0 -0
  19. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/core/__init__.py +0 -0
  20. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/core/factory.py +0 -0
  21. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/core/handler.py +0 -0
  22. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/core/proxy.py +0 -0
  23. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/core/request.py +0 -0
  24. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/core/response.py +0 -0
  25. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/core/streaming.py +0 -0
  26. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/dashboard/__init__.py +0 -0
  27. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/dashboard/api.py +0 -0
  28. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/html/favicon.ico +0 -0
  29. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/html/index.html +0 -0
  30. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/html/static/css/styles.css +0 -0
  31. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/html/static/js/dashboard.js +0 -0
  32. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/html/static/logo.svg +0 -0
  33. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/schema.json +0 -0
  34. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/server/__init__.py +0 -0
  35. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/server/app.py +0 -0
  36. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/services/__init__.py +0 -0
  37. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/services/key.py +0 -0
  38. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/services/lb.py +0 -0
  39. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/services/limit.py +0 -0
  40. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/services/metrics.py +0 -0
  41. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/services/queue.py +0 -0
  42. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/utils/__init__.py +0 -0
  43. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/utils/header.py +0 -0
  44. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya/utils/helper.py +0 -0
  45. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya_proxy.egg-info/SOURCES.txt +0 -0
  46. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya_proxy.egg-info/dependency_links.txt +0 -0
  47. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya_proxy.egg-info/entry_points.txt +0 -0
  48. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/nya_proxy.egg-info/top_level.txt +0 -0
  49. {nya_proxy-0.2.4 → nya_proxy-0.2.5}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nya-proxy
3
- Version: 0.2.4
3
+ Version: 0.2.5
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
@@ -27,7 +27,7 @@ Requires-Dist: brotli>=1.0.9
27
27
  Requires-Dist: jmespath>=1.0.1
28
28
  Requires-Dist: orjson<4,>=3.10
29
29
  Requires-Dist: loguru>=0.7.0
30
- Requires-Dist: nekoconf[remote,schema,server]==1.1.0
30
+ Requires-Dist: nekoconf[remote,schema,server]==1.1.1
31
31
  Provides-Extra: dev
32
32
  Requires-Dist: pytest>=7.0.0; extra == "dev"
33
33
  Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
@@ -0,0 +1 @@
1
+ __version__ = "0.2.5"
@@ -18,8 +18,7 @@
18
18
  --success: #10b981;
19
19
  --input-bg: #ffffff;
20
20
  --card-bg: #ffffff;
21
- --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
22
- 0 2px 4px -1px rgba(0, 0, 0, 0.06);
21
+ --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
23
22
  }
24
23
 
25
24
  .dark {
@@ -34,16 +33,14 @@
34
33
  --success: #34d399;
35
34
  --input-bg: #1f2937;
36
35
  --card-bg: #1f2937;
37
- --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3),
38
- 0 2px 4px -1px rgba(0, 0, 0, 0.2);
36
+ --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
39
37
  }
40
38
 
41
39
  * {
42
40
  margin: 0;
43
41
  padding: 0;
44
42
  box-sizing: border-box;
45
- font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
46
- Roboto, "Helvetica Neue", Arial, sans-serif;
43
+ font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
47
44
  }
48
45
 
49
46
  body {
@@ -266,29 +263,10 @@
266
263
  </head>
267
264
  <body>
268
265
  <button class="theme-toggle" id="theme-toggle" aria-label="Toggle theme">
269
- <svg
270
- xmlns="http://www.w3.org/2000/svg"
271
- viewBox="0 0 24 24"
272
- fill="none"
273
- stroke="currentColor"
274
- stroke-width="2"
275
- stroke-linecap="round"
276
- stroke-linejoin="round"
277
- class="moon"
278
- >
266
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="moon">
279
267
  <path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>
280
268
  </svg>
281
- <svg
282
- xmlns="http://www.w3.org/2000/svg"
283
- viewBox="0 0 24 24"
284
- fill="none"
285
- stroke="currentColor"
286
- stroke-width="2"
287
- stroke-linecap="round"
288
- stroke-linejoin="round"
289
- class="sun"
290
- style="display: none"
291
- >
269
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="sun" style="display: none">
292
270
  <circle cx="12" cy="12" r="5"></circle>
293
271
  <line x1="12" y1="1" x2="12" y2="3"></line>
294
272
  <line x1="12" y1="21" x2="12" y2="23"></line>
@@ -304,12 +282,7 @@
304
282
  <div class="login-card">
305
283
  <div class="header">
306
284
  <div>
307
- <img
308
- class="app-logo"
309
- src="/dashboard/static/logo.svg"
310
- width="70"
311
- height="70"
312
- />
285
+ <img class="app-logo" src="/dashboard/static/logo.svg" width="70" height="70" />
313
286
  </div>
314
287
  <h1>NyaProxy</h1>
315
288
  <p class="subtitle">Enter your API key to access the service</p>
@@ -318,26 +291,11 @@
318
291
  <form id="loginForm" method="post" action="javascript:void(0);">
319
292
  <div class="form-group">
320
293
  <label for="apiKey">API Key</label>
321
- <input
322
- type="password"
323
- id="apiKey"
324
- name="apiKey"
325
- required
326
- autocomplete="off"
327
- placeholder="Enter your API key"
328
- />
294
+ <input type="password" id="apiKey" name="apiKey" required autocomplete="off" placeholder="Enter your API key" />
329
295
  </div>
330
296
 
331
297
  <div id="errorMessage" class="error" style="display: none">
332
- <svg
333
- xmlns="http://www.w3.org/2000/svg"
334
- viewBox="0 0 24 24"
335
- fill="none"
336
- stroke="currentColor"
337
- stroke-width="2"
338
- stroke-linecap="round"
339
- stroke-linejoin="round"
340
- >
298
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
341
299
  <circle cx="12" cy="12" r="10"></circle>
342
300
  <line x1="12" y1="8" x2="12" y2="12"></line>
343
301
  <line x1="12" y1="16" x2="12.01" y2="16"></line>
@@ -354,12 +312,7 @@
354
312
  <div class="footer">
355
313
  <p>
356
314
  Powered by
357
- <a
358
- href="https://github.com/Nya-Foundation/NyaProxy"
359
- target="_blank"
360
- rel="noopener noreferrer"
361
- >NyaProxy</a
362
- >
315
+ <a href="https://github.com/Nya-Foundation/NyaProxy" target="_blank" rel="noopener noreferrer">NyaProxy</a>
363
316
  </p>
364
317
  </div>
365
318
  </div>
@@ -386,9 +339,7 @@
386
339
  };
387
340
 
388
341
  // Check for saved theme preference or respect OS preference
389
- const prefersDark = window.matchMedia(
390
- "(prefers-color-scheme: dark)"
391
- ).matches;
342
+ const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
392
343
  const savedTheme = localStorage.getItem("theme");
393
344
 
394
345
  // Default to dark theme as requested
@@ -411,49 +362,44 @@
411
362
  });
412
363
 
413
364
  // Listen for OS theme changes
414
- window
415
- .matchMedia("(prefers-color-scheme: dark)")
416
- .addEventListener("change", (e) => {
417
- if (!localStorage.theme) {
418
- // Only auto-switch if user hasn't set a preference
419
- setTheme(e.matches);
420
- }
421
- });
365
+ window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", (e) => {
366
+ if (!localStorage.theme) {
367
+ // Only auto-switch if user hasn't set a preference
368
+ setTheme(e.matches);
369
+ }
370
+ });
422
371
 
423
372
  // Form submission
424
- document
425
- .getElementById("loginForm")
426
- .addEventListener("submit", async function (e) {
427
- e.preventDefault();
428
-
429
- const apiKey = document.getElementById("apiKey").value;
430
- const submitButton = document.getElementById("submitButton");
431
- const errorElem = document.getElementById("errorMessage");
432
-
433
- // Show loading state
434
- submitButton.classList.add("loading");
435
- submitButton.disabled = true;
436
- errorElem.style.display = "none";
437
-
438
- try {
439
- // Simulate a slight delay for better UX
440
- await new Promise((resolve) => setTimeout(resolve, 800));
441
-
442
- // Set the API key as a cookie with path=/
443
- document.cookie = `nyaproxy_api_key=${apiKey}; path=/; max-age=3600; SameSite=Strict`;
444
-
445
- // Redirect back to the original path
446
- window.location.href = "{{ return_path }}";
447
- } catch (error) {
448
- document.getElementById("errorText").textContent =
449
- "Error during authentication. Please try again.";
450
- errorElem.style.display = "flex";
451
-
452
- // Reset button state
453
- submitButton.classList.remove("loading");
454
- submitButton.disabled = false;
455
- }
456
- });
373
+ document.getElementById("loginForm").addEventListener("submit", async function (e) {
374
+ e.preventDefault();
375
+
376
+ const apiKey = document.getElementById("apiKey").value;
377
+ const submitButton = document.getElementById("submitButton");
378
+ const errorElem = document.getElementById("errorMessage");
379
+
380
+ // Show loading state
381
+ submitButton.classList.add("loading");
382
+ submitButton.disabled = true;
383
+ errorElem.style.display = "none";
384
+
385
+ try {
386
+ // Simulate a slight delay for better UX
387
+ await new Promise((resolve) => setTimeout(resolve, 800));
388
+
389
+ // Set the API key as a cookie with path=/
390
+ document.cookie = `nyaproxy_api_key=${apiKey}; path=/; max-age=7200; SameSite=Strict`;
391
+
392
+ // Redirect back to the original path
393
+ window.location.href = "{{ return_path }}";
394
+ } catch (error) {
395
+ document.getElementById("errorText").textContent = "Error during authentication. Please try again.";
396
+ errorElem.style.display = "flex";
397
+
398
+ // Reset button state
399
+ submitButton.classList.remove("loading");
400
+ submitButton.disabled = false;
401
+ }
402
+ });
457
403
 
458
404
  // Add focus animation to input
459
405
  const input = document.getElementById("apiKey");
@@ -4,7 +4,6 @@ Provides authentication mechanisms and middleware.
4
4
  """
5
5
 
6
6
  import importlib.resources
7
- from typing import Optional
8
7
 
9
8
  from fastapi import Depends, HTTPException, Request
10
9
  from fastapi.security import APIKeyHeader
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nya-proxy
3
- Version: 0.2.4
3
+ Version: 0.2.5
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
@@ -27,7 +27,7 @@ Requires-Dist: brotli>=1.0.9
27
27
  Requires-Dist: jmespath>=1.0.1
28
28
  Requires-Dist: orjson<4,>=3.10
29
29
  Requires-Dist: loguru>=0.7.0
30
- Requires-Dist: nekoconf[remote,schema,server]==1.1.0
30
+ Requires-Dist: nekoconf[remote,schema,server]==1.1.1
31
31
  Provides-Extra: dev
32
32
  Requires-Dist: pytest>=7.0.0; extra == "dev"
33
33
  Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
@@ -9,7 +9,7 @@ brotli>=1.0.9
9
9
  jmespath>=1.0.1
10
10
  orjson<4,>=3.10
11
11
  loguru>=0.7.0
12
- nekoconf[remote,schema,server]==1.1.0
12
+ nekoconf[remote,schema,server]==1.1.1
13
13
 
14
14
  [dev]
15
15
  pytest>=7.0.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "nya-proxy"
7
- version = "0.2.4"
7
+ version = "0.2.5"
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 = [
@@ -35,7 +35,7 @@ dependencies = [
35
35
  "jmespath>=1.0.1",
36
36
  "orjson>=3.10,<4",
37
37
  "loguru>=0.7.0",
38
- "nekoconf[remote,schema,server]==1.1.0",
38
+ "nekoconf[remote,schema,server]==1.1.1",
39
39
  ]
40
40
 
41
41
  [project.optional-dependencies]
@@ -1 +0,0 @@
1
- __version__ = "0.2.4"
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