sovereign 0.29.4__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/views/admin.py CHANGED
@@ -1,10 +1,13 @@
1
- import yaml
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 sovereign import config, stats, poller, template_context
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
@@ -92,6 +110,7 @@ def instances(
92
110
  title="Whether the sources should run Modifiers/Global Modifiers prior to being returned",
93
111
  ),
94
112
  ) -> JSONResponse:
113
+ assert poller is not None # how else would there be sources
95
114
  node = mock_discovery_request(service_cluster=service_cluster).node
96
115
  args = {
97
116
  "modify": yaml.safe_load(modified),
sovereign/views/crypto.py CHANGED
@@ -4,7 +4,8 @@ from fastapi import APIRouter, Body
4
4
  from fastapi.responses import JSONResponse
5
5
  from pydantic import BaseModel, Field
6
6
 
7
- from sovereign import json_response_class, logs, server_cipher_container
7
+ from sovereign import logs, server_cipher_container
8
+ from sovereign.response_class import json_response_class
8
9
  from sovereign.schemas import EncryptionConfig
9
10
  from sovereign.utils.crypto.crypto import CipherContainer
10
11
  from sovereign.utils.crypto.suites import EncryptionType
@@ -2,7 +2,8 @@ from typing import List
2
2
  from fastapi import Response
3
3
  from fastapi.routing import APIRouter
4
4
  from fastapi.responses import PlainTextResponse
5
- from sovereign import XDS_TEMPLATES, __version__, json_response_class
5
+ from sovereign import XDS_TEMPLATES, __version__
6
+ from sovereign.response_class import json_response_class
6
7
  from sovereign.utils.mock import mock_discovery_request
7
8
  from sovereign.views.discovery import perform_discovery
8
9
 
@@ -6,7 +6,8 @@ from fastapi.encoders import jsonable_encoder
6
6
  from fastapi.requests import Request
7
7
  from fastapi.responses import HTMLResponse, JSONResponse, RedirectResponse, Response
8
8
 
9
- from sovereign import XDS_TEMPLATES, html_templates, json_response_class, poller
9
+ from sovereign import XDS_TEMPLATES, html_templates, poller, config
10
+ from sovereign.response_class import json_response_class
10
11
  from sovereign.discovery import DiscoveryTypes
11
12
  from sovereign.utils.mock import mock_discovery_request
12
13
  from sovereign.views.discovery import perform_discovery
@@ -18,6 +19,12 @@ all_types = [t.value for t in DiscoveryTypes]
18
19
 
19
20
  @router.get("/")
20
21
  async def ui_main(request: Request) -> HTMLResponse:
22
+ if poller is not None:
23
+ last_update = str(poller.last_updated)
24
+ else:
25
+ # TODO: incorporate with cache? template context?
26
+ last_update = ""
27
+
21
28
  try:
22
29
  return html_templates.TemplateResponse(
23
30
  request=request,
@@ -25,7 +32,7 @@ async def ui_main(request: Request) -> HTMLResponse:
25
32
  media_type="text/html",
26
33
  context={
27
34
  "all_types": all_types,
28
- "last_update": str(poller.last_updated),
35
+ "last_update": last_update,
29
36
  },
30
37
  )
31
38
  except IndexError:
@@ -37,7 +44,7 @@ async def ui_main(request: Request) -> HTMLResponse:
37
44
  "title": "No resource types configured",
38
45
  "message": "A template should be defined for every resource "
39
46
  "type that you want your envoy proxies to discover.",
40
- "doc_link": "https://vsyrakis.bitbucket.io/sovereign/docs/tutorial/templates/",
47
+ "doc_link": "https://developer.atlassian.com/platform/sovereign/tutorial/templates/#templates",
41
48
  },
42
49
  )
43
50
 
@@ -109,6 +116,15 @@ async def resources(
109
116
  ret["resources"] = [{"sovereign_error": str(e)}]
110
117
  else:
111
118
  ret["resources"] = response.deserialize_resources()
119
+
120
+ if poller is not None:
121
+ last_update = str(poller.last_updated)
122
+ match_keys = poller.match_keys
123
+ else:
124
+ # TODO: incorporate with cache? template context?
125
+ last_update = ""
126
+ match_keys = config.expected_service_clusters
127
+
112
128
  return html_templates.TemplateResponse(
113
129
  request=request,
114
130
  name="resources.html",
@@ -123,8 +139,8 @@ async def resources(
123
139
  "version": envoy_version,
124
140
  "available_versions": list(XDS_TEMPLATES.keys()),
125
141
  "service_cluster": service_cluster,
126
- "available_service_clusters": poller.match_keys,
127
- "last_update": str(poller.last_updated),
142
+ "available_service_clusters": match_keys,
143
+ "last_update": last_update,
128
144
  },
129
145
  )
130
146
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sovereign
3
- Version: 0.29.4
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 (>=22.0.0,<23.0.0)
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)
@@ -51,60 +51,70 @@ Requires-Dist: pydantic-settings (<2.6.0)
51
51
  Requires-Dist: redis (<=5.0.0)
52
52
  Requires-Dist: requests (>=2.31.0,<3.0.0)
53
53
  Requires-Dist: sentry-sdk (>=2.14.0,<3.0.0) ; extra == "sentry"
54
+ Requires-Dist: starlette-context (>=0.3.6,<0.4.0)
54
55
  Requires-Dist: structlog (>=23.1.0,<24.0.0)
55
56
  Requires-Dist: ujson (>=5.8.0,<6.0.0) ; extra == "ujson"
56
57
  Requires-Dist: uvicorn (>=0.23.2,<0.24.0)
57
58
  Requires-Dist: uvloop (>=0.19.0,<0.20.0)
58
- Project-URL: Documentation, https://vsyrakis.bitbucket.io/sovereign/docs/
59
+ Project-URL: Documentation, https://developer.atlassian.com/platform/sovereign/
59
60
  Project-URL: Repository, https://bitbucket.org/atlassian/sovereign/src/master/
60
61
  Description-Content-Type: text/markdown
61
62
 
62
63
  sovereign
63
64
  =========
64
65
 
66
+
65
67
  Mission statement
66
68
  -----------------
67
69
  This project implements a JSON control-plane based on the [envoy](https://envoyproxy.io) [data-plane-api](https://github.com/envoyproxy/data-plane-api)
68
70
 
69
- The purpose of `sovereign` is to supply downstream envoy proxies with
70
- configuration in near-realtime by responding to discovery requests.
71
+ The purpose of `sovereign` is to supply downstream envoy proxies with dynamic configuration.
72
+
71
73
 
72
74
  Mechanism of Operation
73
75
  ----------------------
74
- tl;dr version:
75
- ```
76
- * Polls HTTP/File/Other for data
77
- * (optional) Applies transforms to the data
78
- * Uses the data to generate Envoy configuration from templates
79
- ```
76
+ Sovereign allows you to define templates that represent each resource type
77
+ provided by Envoy. For example, clusters, routes, listeners, secrets,
78
+ extension_configs, etc.
79
+
80
+ In order to enrich the templates with data, Sovereign has ways of polling data
81
+ out-of-band which it then includes as variables that can be accessed within the
82
+ templates.
83
+
84
+ This allows Sovereign to provide configuration to Envoy that changes over time
85
+ depending on the data sources, without needing to redeploy the control-plane.
80
86
 
81
- In a nutshell, Sovereign
82
- gathers contextual data (*"sources"* and *"template context"*),
83
- optionally applies transforms to that data (using *"modifiers"*) and finally
84
- uses the data to generate envoy configuration from either python code, or jinja2 templates.
87
+ Sovereign provides some built-in ways of polling data (such as over HTTP, or
88
+ on-disk) but also exposes extension points, allowing you to write your own
89
+ plugins in Python.
85
90
 
86
- This is performed in a semi-stateless way, where the only state is data cached in memory.
87
91
 
88
- Template context is intended to be statically configured, whereas *Sources*
89
- are meant to be dynamic - for example, fetching from an API, an S3 bucket,
90
- or a file that receives updates.
92
+ Support
93
+ ------------
94
+ [Submit new issues here](https://bitbucket.org/atlassian/sovereign/issues/new)
95
+
96
+ If you're unable to submit an issue on Bitbucket, send an email to [vsyrakis@atlassian.com](mailto:vsyrakis@atlassian.com)
97
+
91
98
 
92
- *Modifiers* can mutate the data retrieved from sources, just in case the data
93
- is in a less than favorable structure.
99
+ Release
100
+ ------------
101
+ See [RELEASE.md]
94
102
 
95
- Both modifiers and sources are pluggable, i.e. it's easy to write your own and
96
- plug them into Sovereign for your use-case.
97
103
 
98
- Currently, Sovereign supports only providing configuration to Envoy as JSON.
99
- That is to say, gRPC is not supported yet. Contributions in this area are highly
100
- appreciated!
104
+ Roadmap
105
+ ------------
106
+ * Performance improvements
107
+ * Data persistence
108
+ * Push API (versus polling)
109
+ * Client for Sovereign
110
+ * gRPC
101
111
 
102
- The JSON configuration can be viewed in real-time with Sovereign's read-only web interface.
103
112
 
104
113
  Requirements
105
114
  ------------
106
115
  * Python 3.8+
107
116
 
117
+
108
118
  Installation
109
119
  ------------
110
120
  ```
@@ -113,62 +123,52 @@ pip install sovereign
113
123
 
114
124
  Documentation
115
125
  -------------
116
- [Read the docs here!](https://vsyrakis.bitbucket.io/sovereign/docs/)
126
+ [Read the docs here!](https://developer.atlassian.com/platform/sovereign/)
117
127
 
118
- :new: Read-only user interface
119
- ------------------------
120
- Added in `v0.5.3`!
121
128
 
122
- This interface allows you to browse the resources currently returned by Sovereign.
123
-
124
- ![Sovereign User Interface Screenshot](https://bitbucket.org/atlassian/sovereign/src/master/assets/sovereign_ui.png)
125
129
 
126
130
  Local development
127
131
  =================
128
132
 
133
+
129
134
  Requirements
130
135
  ------------
136
+ * Poetry
131
137
  * Docker
132
138
  * Docker-compose
133
139
 
140
+
134
141
  Installing dependencies for dev
135
142
  -------------------------------
136
- I recommend creating a virtualenv before doing any dev work
137
-
143
+ Dependencies and creation of virtualenv is handled by poetry
138
144
  ```
139
- python3 -m venv venv
140
- source venv/bin/activate
141
- pip install -r requirements-dev.txt
145
+ poetry install
146
+ poetry shell
142
147
  ```
143
148
 
144
149
  Running locally
145
150
  ---------------
146
151
  Running the test env
147
-
148
152
  ```
149
153
  make run
150
154
  ```
151
155
 
152
156
  Running the test env daemonized
153
-
154
157
  ```
155
158
  make run-daemon
156
159
  ```
157
160
 
158
161
  Pylint
159
-
160
162
  ```
161
163
  make lint
162
164
  ```
163
165
 
164
166
  Unit tests
165
-
166
167
  ```
167
168
  make unit
168
169
  ```
169
170
 
170
171
  Acceptance tests
171
-
172
172
  ```
173
173
  make run-daemon acceptance
174
174
  ```
@@ -176,7 +176,6 @@ make run-daemon acceptance
176
176
 
177
177
  Contributors
178
178
  ============
179
-
180
179
  Pull requests, issues and comments welcome. For pull requests:
181
180
 
182
181
  * Add tests for new features and bug fixes
@@ -205,7 +204,6 @@ those contributing as an individual.
205
204
 
206
205
  License
207
206
  ========
208
-
209
207
  Copyright (c) 2018 Atlassian and others.
210
208
  Apache 2.0 licensed, see [LICENSE.txt](LICENSE.txt) file.
211
209
 
@@ -1,49 +1,49 @@
1
- sovereign/__init__.py,sha256=L0PLw5Su5XX_HdSEXCJVtbCitxUMjZP5nlyl21sQ3eA,3256
2
- sovereign/app.py,sha256=udDhuprAcJdYNgXufl94-oh-G74H9hXVzr8cKhgdQYI,4087
3
- sovereign/configuration.py,sha256=BCezlWYIpTsFRZwQIBwU-XrfBk1MdjTKMLA8huN-VPg,2484
1
+ sovereign/__init__.py,sha256=AEvYuDWafstmB6K9OqBA_hf1RPFUqiq9_PeVCfpshso,2994
2
+ sovereign/app.py,sha256=WIetM8_4m5nZ6eD12Kd_jDKeUkcDRqdkk7L4wCKyP40,4257
4
3
  sovereign/constants.py,sha256=qdWD1lTvkaW5JGF7TmZhfksQHlRAJFVqbG7v6JQA9k8,46
5
- sovereign/context.py,sha256=Vwr-Jmo1I_05rFraxv6GoYEC83oFl87LG16px4R7IfA,6461
6
- sovereign/discovery.py,sha256=LrgrojgehyZIObZl4wICi_s5PHwIl73wSym3tSNBkfI,6409
7
- sovereign/dynamic_config/__init__.py,sha256=QoRNcuCAqV26zeyHm0iavsR55K3TwMohabWpPGIq_rM,2838
8
- sovereign/dynamic_config/deser.py,sha256=CYTP9UNx8falCXU_bEaWGNatyQlYrV4T57NPXNhTn0o,1842
9
- sovereign/dynamic_config/loaders.py,sha256=HxDT-6hlqg_ewPjrFu2RaWi6O1mmJ_Mpnu8AQk_enNg,2923
4
+ sovereign/context.py,sha256=qeo1Alb26kuyD3mDqJleh3MTJviQqdm7HE5lvHpVAF4,7009
5
+ sovereign/discovery.py,sha256=iQ3QJzXuxB6su79dDqgjmlzhVWAGrxq4XOrCwwwIPi8,6373
6
+ sovereign/dynamic_config/__init__.py,sha256=IRU-Z24vGNEaBN6MUq7EdMtkqrrHPnENRtWzNhTS9aU,2858
7
+ sovereign/dynamic_config/deser.py,sha256=N3iUvDpuNHWjxUbGFydMVKicx4o8DyfvNukorqnQdt8,1834
8
+ sovereign/dynamic_config/loaders.py,sha256=gPkxTL7gep20HIMRvjgOqAdUWqtb3970VBCAcUrIM4c,2915
10
9
  sovereign/error_info.py,sha256=r2KXBYq9Fo7AI2pmIpATWFm0pykr2MqfrKH0WWW5Sfk,1488
11
- sovereign/logging/access_logger.py,sha256=JMMzQvi7doFJGA__YYqyasdfAT9W31Ycu_oZ2ovAMis,2565
12
- sovereign/logging/application_logger.py,sha256=VI8EBRv_dB8vvTnSh3n-IaFtVh-GaNN4atjtLJdr2kI,1843
13
- sovereign/logging/base_logger.py,sha256=T-nZVv0_K8wtB2DY7dpQp1FOfBt9zpEc9OLEX9IQ_Zg,1918
14
- sovereign/logging/bootstrapper.py,sha256=6Az0Mn9uXzrtCFIzs7Ph6p9ShV2-tkWYfUyXLhqKPi4,1185
10
+ sovereign/logging/access_logger.py,sha256=G-R6kSPDQlrunSh34qXIT3LwbamAhdASuPgPOaXCRdM,2983
11
+ sovereign/logging/application_logger.py,sha256=HjrGTi2zZ06AaToDVdSv4MNIF6aWN6vFW5heAdfqwlk,1800
12
+ sovereign/logging/base_logger.py,sha256=ScOzHs8Rt1RZaUZGvaJSAlDEjD0BxkD5sLKSm2GgM0I,1243
13
+ sovereign/logging/bootstrapper.py,sha256=m2arNfP0MgAeZC1slp3Sqtcwpye8pnZ-i5VTzYt50mo,1185
15
14
  sovereign/logging/types.py,sha256=rGqJAEVvgvzHy4aPfvEH6yQ-yblXNkEcWG7G8l9ALEA,282
16
- sovereign/middlewares.py,sha256=UoLdfhqMj_E6jXgtr-n0maQIBYe9n95s3BwaQZfebHo,3097
15
+ sovereign/middlewares.py,sha256=tQazHAtIdUc1hWhopg33x83-g-JcilU4HdjzoxFe6NU,3053
17
16
  sovereign/modifiers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
- sovereign/modifiers/lib.py,sha256=DbXsxrrjnFE4Y7rbwpeiM5tS5w5NBwSdYH58AtDTP0I,2884
17
+ sovereign/modifiers/lib.py,sha256=Cx0VrpTKbSjb3YmHyG4Jy6YEaPlrwpeqNaom3zu1_hw,2885
19
18
  sovereign/response_class.py,sha256=beMAFV-4L6DwyWzJzy71GkEW4gb7fzH1jd8-Tul13cU,427
20
- sovereign/schemas.py,sha256=NfbBub6Fnozrb-cQNwchwIH0FRlVozycOhmm6Vyqpb4,31286
19
+ sovereign/schemas.py,sha256=XY5UQiAwy3TgxMqZt0HxsiytRnvaIx-rgBe3stEMYJg,33473
21
20
  sovereign/server.py,sha256=z8Uz1UYIZix0S40Srk774WIMDN2jl2SozO8irib0wc4,1402
22
21
  sovereign/sources/__init__.py,sha256=g9hEpFk8j5i1ApHQpbc9giTyJW41Ppgsqv5P9zGxOJk,78
23
22
  sovereign/sources/file.py,sha256=prUThsDCSPNwZaZpkKXhAm-GVRZWbBoGKGU0It4HHXs,690
24
- sovereign/sources/inline.py,sha256=bNqVZyelcUofYBWHFOUIhOUU9az32CdBEfaYRzNzFFE,1002
25
- sovereign/sources/lib.py,sha256=LIbnlKkL0bQT10y4GT2E8yypjYxqfJYbB9FkGB5C2oc,1030
26
- sovereign/sources/poller.py,sha256=61zV8oHzvC0x453kN8dyfJaOSnykgXHuKiMtLRAHt0w,11059
23
+ sovereign/sources/inline.py,sha256=pP77m7bHjqE3sSoqZthcuw1ARVMf9gooVwbz4B8OAek,1003
24
+ sovereign/sources/lib.py,sha256=0hk_G6mKJrB65WokVZnqF5kdJ3vsQZMNPuJqJO0mBsI,1031
25
+ sovereign/sources/poller.py,sha256=SdpWRb79-ronyNjX-bYVviQ9r-z12MQxbOTmKR1uESw,10891
26
+ sovereign/static/panel.js,sha256=fgAGJo2d_MvAG5rcraY9rvY-TgmTtBbCs4SvzugYssE,2005
27
27
  sovereign/static/sass/style.scss,sha256=tPHPEm3sZeBFGDyyn3pHcA-nbaKT-h-UsSTsf6dHNDU,1158
28
+ sovereign/static/search_filter.js,sha256=StfTXTu9mGnkwObkIbuWk1DfwFTheXzrQ6OVq_7E3v4,697
28
29
  sovereign/static/style.css,sha256=vG8HPsbCbPIZfHgy7gSeof97Pnp0okkyaXyJzIEEW-8,447517
29
30
  sovereign/statistics.py,sha256=Xfj4oWMfCkbYc2ibF7rDUpbw6Zw6dI4N5BpCLDQc4j4,2336
30
31
  sovereign/templates/base.html,sha256=5vw3-NmN291pXRdArpCwhSce9bAYBWCJVRhvO5EmE9g,2296
31
32
  sovereign/templates/err.html,sha256=a3cEzOqyqWOIe3YxfTEjkxbTfxBxq1knD6GwzEFljfs,603
32
- sovereign/templates/resources.html,sha256=_mcqw3POMEI0uWR4xF1QlCsdmzgWheYT5zklJhHdPqE,7857
33
- sovereign/templates/ul_filter.html,sha256=LrzZv5408Qq5UP4lcHVRwY2G6lXd3IiSNiJn1aH7Yqo,666
33
+ sovereign/templates/resources.html,sha256=feN7iClAUccPu7WQ-xIOyDZ7qEaTK5l5NahxzFGv2Wg,7803
34
34
  sovereign/testing/loaders.py,sha256=mcmErhI9ZkJUBZl8jv2qP-PCBRFeAIgyBFlfCgU4Vvk,199
35
35
  sovereign/testing/modifiers.py,sha256=7_c2hWXn_sYJ6997N1_uSWtClOikcOzu1yRCY56-l-4,361
36
- sovereign/tracing.py,sha256=KHpqddxUm8A6ucIqnY7xo44ULH7K6ZGdyayObOdDwcw,2239
36
+ sovereign/tracing.py,sha256=Xo3npgh6yesACSlynv9j6qnXxvYEBzXv5LL4Zkc1QDw,2446
37
37
  sovereign/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
38
  sovereign/utils/auth.py,sha256=sQC8eLPWtk0RIXKwwxnYqILUvUCOaEGtGrtdJflat8E,1692
39
39
  sovereign/utils/crypto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
40
40
  sovereign/utils/crypto/crypto.py,sha256=s6qYB3cmY5f4Sacq1LlSARzIWMTys7l2o9mMsCGLfmU,4526
41
41
  sovereign/utils/crypto/suites/__init__.py,sha256=smMvNa1VsQ0PvsNj6lnRNh4ktB7dMnas1CqeTOFqgGA,526
42
42
  sovereign/utils/crypto/suites/aes_gcm_cipher.py,sha256=Yjfj1LCQDGTzHBjrZR3-koh29L_N34v65kPoIfta0aw,1239
43
- sovereign/utils/crypto/suites/base_cipher.py,sha256=xJWey-Wy7RFnIH6E3yBSSnn3OAi9PZEZNSJEY9R5ftQ,494
43
+ sovereign/utils/crypto/suites/base_cipher.py,sha256=kUOZh_ZIILyo5zv99-qzbJZDpeMmt76vhkBDEPvAt4A,454
44
44
  sovereign/utils/crypto/suites/disabled_cipher.py,sha256=0_vzydVdVIUlX4pYEAMgB_RvHpyZ25uDC4pz1jRJ5wE,573
45
45
  sovereign/utils/crypto/suites/fernet_cipher.py,sha256=rP6M5ys1vctyadOxDGNFoyerWPUOunLQdZ2jjS1pxzc,701
46
- sovereign/utils/dictupdate.py,sha256=JkDjg16u7sW6A_4Q2oX1PY_MtJU7m1VivZWn9VLZ9V8,2559
46
+ sovereign/utils/dictupdate.py,sha256=Bi7QaC7en-k3EOepwNJqpOKRNBgp6ZsBZVOvH_0nMtc,2558
47
47
  sovereign/utils/eds.py,sha256=sCEDj1y-0Crs40cHZLiPGVb7ed1f8vFqgHLY5R2LMbw,4377
48
48
  sovereign/utils/entry_point_loader.py,sha256=BEVodk-um70RvT1nSOu_IB-hr1K4ppthXod0VZEiZJ8,526
49
49
  sovereign/utils/mock.py,sha256=M4hvNKSS3c4wYwHgVaHtwMspoufzZR4rCx_3TB-HD4U,1261
@@ -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=DlazEqI8P9M3h1llVUgRoAnUlmjYH3f1UZnrQmzLXI8,4261
57
- sovereign/views/crypto.py,sha256=o8NSyiUBy7v1pMOXt_1UBi68FNcGkXSlEVg9C18y8kY,3324
56
+ sovereign/views/admin.py,sha256=LQhz5CPFfEa8PjAp-SSQ_zce1sq-B95x4cG0BC_j-_s,4807
57
+ sovereign/views/crypto.py,sha256=7y0eHWtt-bbr2CwHEkH7odPaJ1IEviU-71U-MYJD0Kc,3360
58
58
  sovereign/views/discovery.py,sha256=BmsHsBe_N33_VahkLQda3CfuIqJZAHSA0Bndg9KagQM,6187
59
- sovereign/views/healthchecks.py,sha256=_WkMunlrFpqGTLgtNtRr7gCsDCv5kiuYxCyTi-dMEKM,1357
60
- sovereign/views/interface.py,sha256=CPKitUWDk9Hgm7ljF-pH2MroVfn8lXoRXOTM3Emspbo,7255
61
- sovereign-0.29.4.dist-info/LICENSE.txt,sha256=2X125zvAb9AYLjCgdMDQZuufhm0kwcg31A8pGKj_-VY,560
62
- sovereign-0.29.4.dist-info/METADATA,sha256=iOKQp2qSZTz6H2wVGHJpIg00JZNsp2DyA7JfzrNNwTM,6650
63
- sovereign-0.29.4.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
64
- sovereign-0.29.4.dist-info/entry_points.txt,sha256=2mUHQjqeXEokMF6ZjDmvqQ9Fxk-Or2S4eC0h70ZxKmk,1201
65
- sovereign-0.29.4.dist-info/RECORD,,
59
+ sovereign/views/healthchecks.py,sha256=8BA11nigm1btnBOdtXGN1B04Ow2uswWNNsuKoPLXgh0,1393
60
+ sovereign/views/interface.py,sha256=KoLB3YIZGulrYOV6MA6ucmQzlmSDrYEO8uq045awy1Q,7712
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,,
@@ -5,7 +5,9 @@ sovereign=sovereign.server:main
5
5
  jinja=sovereign.dynamic_config.deser:JinjaDeserializer
6
6
  jinja2=sovereign.dynamic_config.deser:JinjaDeserializer
7
7
  json=sovereign.dynamic_config.deser:JsonDeserializer
8
+ none=sovereign.dynamic_config.deser:PassthroughDeserializer
8
9
  orjson=sovereign.dynamic_config.deser:OrjsonDeserializer
10
+ passthrough=sovereign.dynamic_config.deser:PassthroughDeserializer
9
11
  raw=sovereign.dynamic_config.deser:PassthroughDeserializer
10
12
  string=sovereign.dynamic_config.deser:StringDeserializer
11
13
  ujson=sovereign.dynamic_config.deser:UjsonDeserializer
@@ -1,66 +0,0 @@
1
- import os
2
- from typing import Any, Mapping
3
-
4
- from pydantic import ValidationError
5
-
6
- from sovereign import dynamic_config
7
- from sovereign.context import TemplateContext
8
- from sovereign.logging.bootstrapper import LoggerBootstrapper
9
- from sovereign.schemas import SovereignAsgiConfig, SovereignConfig, SovereignConfigv2
10
- from sovereign.sources import SourcePoller
11
- from sovereign.statistics import configure_statsd
12
- from sovereign.utils.crypto.crypto import CipherContainer
13
- from sovereign.utils.dictupdate import merge # type: ignore
14
-
15
-
16
- def parse_raw_configuration(path: str) -> Mapping[Any, Any]:
17
- ret: Mapping[Any, Any] = dict()
18
- for p in path.split(","):
19
- spec = dynamic_config.Loadable.from_legacy_fmt(p)
20
- ret = merge(obj_a=ret, obj_b=spec.load(), merge_lists=True)
21
- return ret
22
-
23
-
24
- def load_sovereign_configuration() -> SovereignConfigv2:
25
- config_path = os.getenv("SOVEREIGN_CONFIG", "file:///etc/sovereign.yaml")
26
- try:
27
- return SovereignConfigv2(**parse_raw_configuration(config_path))
28
- except ValidationError:
29
- old_config = SovereignConfig(**parse_raw_configuration(config_path))
30
- return SovereignConfigv2.from_legacy_config(old_config)
31
-
32
-
33
- CONFIG = load_sovereign_configuration()
34
- ASGI_CONFIG = SovereignAsgiConfig()
35
- XDS_TEMPLATES = CONFIG.xds_templates()
36
-
37
- LOGS = LoggerBootstrapper(CONFIG)
38
- STATS = configure_statsd(config=CONFIG.statsd)
39
- ENCRYPTION_CONFIGS = CONFIG.authentication.encryption_configs
40
- CIPHER_CONTAINER = CipherContainer.from_encryption_configs(
41
- encryption_configs=ENCRYPTION_CONFIGS,
42
- logger=LOGS.application_logger.logger,
43
- )
44
-
45
- POLLER = SourcePoller(
46
- sources=CONFIG.sources,
47
- matching_enabled=CONFIG.matching.enabled,
48
- node_match_key=CONFIG.matching.node_key,
49
- source_match_key=CONFIG.matching.source_key,
50
- source_refresh_rate=CONFIG.source_config.refresh_rate,
51
- logger=LOGS.application_logger.logger,
52
- stats=STATS,
53
- )
54
- TEMPLATE_CONTEXT = TemplateContext(
55
- refresh_rate=CONFIG.template_context.refresh_rate,
56
- refresh_cron=CONFIG.template_context.refresh_cron,
57
- refresh_num_retries=CONFIG.template_context.refresh_num_retries,
58
- refresh_retry_interval_secs=CONFIG.template_context.refresh_retry_interval_secs,
59
- configured_context=CONFIG.template_context.context,
60
- poller=POLLER,
61
- encryption_suite=CIPHER_CONTAINER,
62
- logger=LOGS.application_logger.logger,
63
- stats=STATS,
64
- )
65
- POLLER.lazy_load_modifiers(CONFIG.modifiers)
66
- POLLER.lazy_load_global_modifiers(CONFIG.global_modifiers)
@@ -1,22 +0,0 @@
1
- <script>
2
- function filter_results(id, list) {
3
- // Declare variables
4
- let input, filter, container, iterable, resource, i, txtValue;
5
- input = document.getElementById(id);
6
- filter = input.value.toUpperCase();
7
-
8
- container = document.getElementById(list);
9
- iterable = container.getElementsByTagName("a");
10
-
11
- // Loop through all list items, and hide those who don't match the search query
12
- for (i = 0; i < iterable.length; i++) {
13
- resource = iterable[i];
14
- txtValue = resource.textContent;
15
- if (txtValue.toUpperCase().indexOf(filter) > -1) {
16
- iterable[i].style.display = "";
17
- } else {
18
- iterable[i].style.display = "none";
19
- }
20
- }
21
- }
22
- </script>