sovereign 0.30.0__py3-none-any.whl → 0.31.0__py3-none-any.whl
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.
Potentially problematic release.
This version of sovereign might be problematic. Click here for more details.
- sovereign/dynamic_config/__init__.py +1 -1
- sovereign/views/admin.py +22 -4
- {sovereign-0.30.0.dist-info → sovereign-0.31.0.dist-info}/METADATA +2 -2
- {sovereign-0.30.0.dist-info → sovereign-0.31.0.dist-info}/RECORD +7 -7
- {sovereign-0.30.0.dist-info → sovereign-0.31.0.dist-info}/LICENSE.txt +0 -0
- {sovereign-0.30.0.dist-info → sovereign-0.31.0.dist-info}/WHEEL +0 -0
- {sovereign-0.30.0.dist-info → sovereign-0.31.0.dist-info}/entry_points.txt +0 -0
sovereign/views/admin.py
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
from typing import Any, Dict, List
|
|
1
|
+
import json
|
|
3
2
|
from collections import defaultdict
|
|
3
|
+
from typing import Any, Dict, List
|
|
4
|
+
|
|
5
|
+
import yaml
|
|
4
6
|
from fastapi import APIRouter, Query
|
|
5
|
-
from fastapi.responses import JSONResponse
|
|
6
7
|
from fastapi.encoders import jsonable_encoder
|
|
7
|
-
from
|
|
8
|
+
from fastapi.responses import JSONResponse
|
|
9
|
+
|
|
10
|
+
from sovereign import config, poller, stats, template_context
|
|
8
11
|
from sovereign.discovery import select_template
|
|
9
12
|
from sovereign.utils.mock import mock_discovery_request
|
|
10
13
|
from sovereign.views.discovery import perform_discovery
|
|
@@ -20,6 +23,9 @@ async def display_config(
|
|
|
20
23
|
service_cluster: str = Query(
|
|
21
24
|
"*", title="The clients service cluster to emulate in this XDS request"
|
|
22
25
|
),
|
|
26
|
+
metadata: str = Query(
|
|
27
|
+
None, title="The clients metadata to emulate in this XDS request"
|
|
28
|
+
),
|
|
23
29
|
resource_names: List[str] = Query([], title="Envoy Resource names to request"),
|
|
24
30
|
region: str = Query(
|
|
25
31
|
None, title="The clients region to emulate in this XDS request"
|
|
@@ -29,11 +35,23 @@ async def display_config(
|
|
|
29
35
|
),
|
|
30
36
|
) -> JSONResponse:
|
|
31
37
|
ret: Dict[str, List[Dict[str, Any]]] = defaultdict(list)
|
|
38
|
+
|
|
39
|
+
try:
|
|
40
|
+
if metadata:
|
|
41
|
+
json_decoded_metadata = json.loads(metadata)
|
|
42
|
+
else:
|
|
43
|
+
json_decoded_metadata = {}
|
|
44
|
+
except json.JSONDecodeError:
|
|
45
|
+
return JSONResponse(
|
|
46
|
+
content={"error": "Invalid JSON in query parameter 'metadata'"},
|
|
47
|
+
status_code=400,
|
|
48
|
+
)
|
|
32
49
|
mock_request = mock_discovery_request(
|
|
33
50
|
service_cluster=service_cluster,
|
|
34
51
|
resource_names=resource_names,
|
|
35
52
|
version=version,
|
|
36
53
|
region=region,
|
|
54
|
+
metadata=json_decoded_metadata,
|
|
37
55
|
)
|
|
38
56
|
response = await perform_discovery(mock_request, "v3", xds_type, skip_auth=True)
|
|
39
57
|
ret["resources"] += response.resources
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sovereign
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.31.0
|
|
4
4
|
Summary: Envoy Proxy control-plane written in Python
|
|
5
5
|
Home-page: https://pypi.org/project/sovereign/
|
|
6
6
|
License: Apache-2.0
|
|
@@ -43,7 +43,7 @@ Requires-Dist: cryptography (>=42.0.0,<43.0.0)
|
|
|
43
43
|
Requires-Dist: datadog (>=0.47.0,<0.48.0) ; extra == "statsd"
|
|
44
44
|
Requires-Dist: fastapi (>=0.115.2,<0.116.0)
|
|
45
45
|
Requires-Dist: glom (>=23.3.0,<24.0.0)
|
|
46
|
-
Requires-Dist: gunicorn (>=
|
|
46
|
+
Requires-Dist: gunicorn (>=23.0.0,<24.0.0)
|
|
47
47
|
Requires-Dist: httptools (>=0.6.0,<0.7.0) ; extra == "httptools"
|
|
48
48
|
Requires-Dist: orjson (>=3.9.15,<4.0.0) ; extra == "orjson"
|
|
49
49
|
Requires-Dist: pydantic (>=2.7.2,<3.0.0)
|
|
@@ -3,7 +3,7 @@ sovereign/app.py,sha256=WIetM8_4m5nZ6eD12Kd_jDKeUkcDRqdkk7L4wCKyP40,4257
|
|
|
3
3
|
sovereign/constants.py,sha256=qdWD1lTvkaW5JGF7TmZhfksQHlRAJFVqbG7v6JQA9k8,46
|
|
4
4
|
sovereign/context.py,sha256=qeo1Alb26kuyD3mDqJleh3MTJviQqdm7HE5lvHpVAF4,7009
|
|
5
5
|
sovereign/discovery.py,sha256=iQ3QJzXuxB6su79dDqgjmlzhVWAGrxq4XOrCwwwIPi8,6373
|
|
6
|
-
sovereign/dynamic_config/__init__.py,sha256=
|
|
6
|
+
sovereign/dynamic_config/__init__.py,sha256=IRU-Z24vGNEaBN6MUq7EdMtkqrrHPnENRtWzNhTS9aU,2858
|
|
7
7
|
sovereign/dynamic_config/deser.py,sha256=N3iUvDpuNHWjxUbGFydMVKicx4o8DyfvNukorqnQdt8,1834
|
|
8
8
|
sovereign/dynamic_config/loaders.py,sha256=gPkxTL7gep20HIMRvjgOqAdUWqtb3970VBCAcUrIM4c,2915
|
|
9
9
|
sovereign/error_info.py,sha256=r2KXBYq9Fo7AI2pmIpATWFm0pykr2MqfrKH0WWW5Sfk,1488
|
|
@@ -53,13 +53,13 @@ sovereign/utils/timer.py,sha256=_dUtEasj0BKbWYuQ_T3HFIyjurXXj-La-dNSMAwKMSo,795
|
|
|
53
53
|
sovereign/utils/version_info.py,sha256=vbAiUyz6v3-zSOoS-7HwrvJie729RgIKy0Bt091Z6RE,349
|
|
54
54
|
sovereign/utils/weighted_clusters.py,sha256=bPzuRE7Qgvv04HcR2AhMDvBrFlZ8AfteweLKhY9SvWg,1166
|
|
55
55
|
sovereign/views/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
56
|
-
sovereign/views/admin.py,sha256=
|
|
56
|
+
sovereign/views/admin.py,sha256=LQhz5CPFfEa8PjAp-SSQ_zce1sq-B95x4cG0BC_j-_s,4807
|
|
57
57
|
sovereign/views/crypto.py,sha256=7y0eHWtt-bbr2CwHEkH7odPaJ1IEviU-71U-MYJD0Kc,3360
|
|
58
58
|
sovereign/views/discovery.py,sha256=BmsHsBe_N33_VahkLQda3CfuIqJZAHSA0Bndg9KagQM,6187
|
|
59
59
|
sovereign/views/healthchecks.py,sha256=8BA11nigm1btnBOdtXGN1B04Ow2uswWNNsuKoPLXgh0,1393
|
|
60
60
|
sovereign/views/interface.py,sha256=KoLB3YIZGulrYOV6MA6ucmQzlmSDrYEO8uq045awy1Q,7712
|
|
61
|
-
sovereign-0.
|
|
62
|
-
sovereign-0.
|
|
63
|
-
sovereign-0.
|
|
64
|
-
sovereign-0.
|
|
65
|
-
sovereign-0.
|
|
61
|
+
sovereign-0.31.0.dist-info/LICENSE.txt,sha256=2X125zvAb9AYLjCgdMDQZuufhm0kwcg31A8pGKj_-VY,560
|
|
62
|
+
sovereign-0.31.0.dist-info/METADATA,sha256=_3lQ9SMGUe-JRSnoRuyqg-Jd8w1tGouGpJqh6WazXsA,6194
|
|
63
|
+
sovereign-0.31.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
64
|
+
sovereign-0.31.0.dist-info/entry_points.txt,sha256=CTCjlomxNz2Ii4hYbN-gEZPBrZNUCcmJcb7NYqm4Nn8,1328
|
|
65
|
+
sovereign-0.31.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|