aio-kong 3.0.0__py3-none-any.whl → 3.3.1__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.
- {aio_kong-3.0.0.dist-info → aio_kong-3.3.1.dist-info}/LICENSE +1 -1
- {aio_kong-3.0.0.dist-info → aio_kong-3.3.1.dist-info}/METADATA +3 -6
- aio_kong-3.3.1.dist-info/RECORD +17 -0
- {aio_kong-3.0.0.dist-info → aio_kong-3.3.1.dist-info}/WHEEL +1 -1
- kong/__init__.py +1 -1
- kong/auths.py +0 -1
- kong/client.py +1 -1
- kong/py.typed +0 -0
- kong/routes.py +11 -11
- aio_kong-3.0.0.dist-info/RECORD +0 -16
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: aio-kong
|
3
|
-
Version: 3.
|
3
|
+
Version: 3.3.1
|
4
4
|
Summary: Asynchronous Kong Client
|
5
5
|
License: BSD-3-Clause
|
6
6
|
Author: Luca
|
@@ -17,9 +17,6 @@ Classifier: Programming Language :: Python
|
|
17
17
|
Classifier: Programming Language :: Python :: 3
|
18
18
|
Classifier: Programming Language :: Python :: 3.10
|
19
19
|
Classifier: Programming Language :: Python :: 3.11
|
20
|
-
Classifier: Programming Language :: Python :: 3
|
21
|
-
Classifier: Programming Language :: Python :: 3.10
|
22
|
-
Classifier: Programming Language :: Python :: 3.11
|
23
20
|
Classifier: Topic :: Software Development
|
24
21
|
Classifier: Topic :: Software Development :: Libraries
|
25
22
|
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
@@ -37,11 +34,11 @@ Description-Content-Type: text/markdown
|
|
37
34
|
[](https://badge.fury.io/py/aio-kong)
|
38
35
|
[](https://pypi.org/project/aio-kong)
|
39
36
|
[](https://github.com/quantmind/aio-kong/actions?query=workflow%3Abuild)
|
40
|
-
[](https://codecov.io/gh/quantmind/aio-kong)
|
41
38
|
[](https://pypi.org/project/aio-kong/)
|
42
39
|
|
43
40
|
|
44
|
-
Tested with [kong][] v3.
|
41
|
+
Tested with [kong][] v3.3
|
45
42
|
|
46
43
|
## Installation & Testing
|
47
44
|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
kong/__init__.py,sha256=vdv-cfsgeGr34QVY6y3BSJQEdqEL73gXPn4si6yPkOc,54
|
2
|
+
kong/auths.py,sha256=QcY6pT_4Jf9R8KNafMoAHNV-ixjew5Nq63dlgo3wadc,2314
|
3
|
+
kong/certificates.py,sha256=MFRmFz7X2oqZN434VD7BzB7ozsUj-HD0Jv5anZZkYHw,278
|
4
|
+
kong/cli.py,sha256=OMTNQ50kEI6WqWjWlAA9HcBWRb5eqEFqgUmtUKvuVQM,1986
|
5
|
+
kong/client.py,sha256=JWky7Eu4b9ED0FQihy6jKLbV20XtXni3izro9davHVY,3783
|
6
|
+
kong/components.py,sha256=JrQrxkVSdq7ZsBvb_nG28TMEL8uFpNsdApODRr0T5o4,5342
|
7
|
+
kong/consumers.py,sha256=PRIa07WU8xNRfod5XmeK2V_f59wfTlOP6ZK8iR1iAkY,2720
|
8
|
+
kong/plugins.py,sha256=QlxPuWmui64iiauJ-pXTjZd84wrNARe45v1yIMGCPAU,2685
|
9
|
+
kong/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
|
+
kong/routes.py,sha256=GkNfaKZDuO9BDDhri3Ah3b2qy_VfAHcAmamRHlbOA0k,1482
|
11
|
+
kong/services.py,sha256=ForaPLtEKyITZb9GqVb-XJUf4iOvKYh26YZSfo1SY6k,2514
|
12
|
+
kong/snis.py,sha256=UfEVp_PAwXYVH9mK-ND7HCtf_H6T9RqUEoHU2sne_bY,665
|
13
|
+
kong/utils.py,sha256=j3KmyZ4dtszteIl5saaxJa0JJaNTSearIAHOZrw8O7M,931
|
14
|
+
aio_kong-3.3.1.dist-info/LICENSE,sha256=4S4Rfy2EEQkrBsn1cu8_EZkf2Q8XfOoxjabtI0BOhdQ,1461
|
15
|
+
aio_kong-3.3.1.dist-info/METADATA,sha256=Maz8MGtOZ86cDDkVGn-o9HOqG4yQpDuB0Sy2dfUnf_Q,3452
|
16
|
+
aio_kong-3.3.1.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
17
|
+
aio_kong-3.3.1.dist-info/RECORD,,
|
kong/__init__.py
CHANGED
kong/auths.py
CHANGED
kong/client.py
CHANGED
kong/py.typed
ADDED
File without changes
|
kong/routes.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
from itertools import zip_longest
|
2
1
|
from typing import cast
|
3
2
|
|
4
3
|
from .components import UUID, CrudComponent, JsonType
|
@@ -19,26 +18,27 @@ class Routes(CrudComponent):
|
|
19
18
|
await route.plugins.delete_all()
|
20
19
|
return await super().delete(id_)
|
21
20
|
|
22
|
-
async def apply_json(self, data: JsonType, clear: bool = True) -> list:
|
21
|
+
async def apply_json(self, data: JsonType, clear: bool = True) -> list[dict]:
|
23
22
|
if not isinstance(data, list):
|
24
23
|
data = [data]
|
25
24
|
routes = await self.get_list()
|
25
|
+
route_map = {r.name: r for r in routes}
|
26
26
|
result = []
|
27
|
-
for entry
|
28
|
-
|
29
|
-
|
30
|
-
await self.delete(route.id)
|
31
|
-
continue
|
27
|
+
for entry in data:
|
28
|
+
name = entry.get("name")
|
29
|
+
route = route_map.pop(name, None) if name else None
|
32
30
|
entry = entry.copy()
|
33
31
|
plugins = entry.pop("plugins", [])
|
34
32
|
as_list("hosts", entry)
|
35
33
|
as_list("paths", entry)
|
36
34
|
as_list("methods", entry)
|
37
|
-
if
|
38
|
-
|
39
|
-
|
40
|
-
entity = await self.update(route.id, **entry)
|
35
|
+
if route:
|
36
|
+
await self.delete(route.id)
|
37
|
+
entity = await self.create(**entry)
|
41
38
|
route = cast(KongEntityWithPlugins, entity)
|
42
39
|
route.data["plugins"] = await route.plugins.apply_json(plugins)
|
43
40
|
result.append(route.data)
|
41
|
+
if clear:
|
42
|
+
for route in route_map.values():
|
43
|
+
await self.delete(route.id)
|
44
44
|
return result
|
aio_kong-3.0.0.dist-info/RECORD
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
kong/__init__.py,sha256=5y4ePzpFZonyo2nkrdaBr9B4_ZL5nh1-0jtqmUbd-JU,54
|
2
|
-
kong/auths.py,sha256=ANGfR6gxL9GWyUECW7EVu763qSbkOqhms1B9JbQd-V8,2315
|
3
|
-
kong/certificates.py,sha256=MFRmFz7X2oqZN434VD7BzB7ozsUj-HD0Jv5anZZkYHw,278
|
4
|
-
kong/cli.py,sha256=OMTNQ50kEI6WqWjWlAA9HcBWRb5eqEFqgUmtUKvuVQM,1986
|
5
|
-
kong/client.py,sha256=QuhfctA9YSCoKwSarJJ4mh3TfcTaIqWxY6gG8htAQE8,3785
|
6
|
-
kong/components.py,sha256=JrQrxkVSdq7ZsBvb_nG28TMEL8uFpNsdApODRr0T5o4,5342
|
7
|
-
kong/consumers.py,sha256=PRIa07WU8xNRfod5XmeK2V_f59wfTlOP6ZK8iR1iAkY,2720
|
8
|
-
kong/plugins.py,sha256=QlxPuWmui64iiauJ-pXTjZd84wrNARe45v1yIMGCPAU,2685
|
9
|
-
kong/routes.py,sha256=9TrP2xS-pbUBKdPH6onuvEw3HI4A4PwpRhVz_k6Gd2o,1461
|
10
|
-
kong/services.py,sha256=ForaPLtEKyITZb9GqVb-XJUf4iOvKYh26YZSfo1SY6k,2514
|
11
|
-
kong/snis.py,sha256=UfEVp_PAwXYVH9mK-ND7HCtf_H6T9RqUEoHU2sne_bY,665
|
12
|
-
kong/utils.py,sha256=j3KmyZ4dtszteIl5saaxJa0JJaNTSearIAHOZrw8O7M,931
|
13
|
-
aio_kong-3.0.0.dist-info/METADATA,sha256=kQX1uoNpz7EEhLOoSEXJF50TF0c_KKRYJBcKjNR6XUE,3587
|
14
|
-
aio_kong-3.0.0.dist-info/LICENSE,sha256=EoHxNd1ly7t_8uzEQiWVO2jSiheGTvKXCOIs9Yw2PEw,1461
|
15
|
-
aio_kong-3.0.0.dist-info/WHEEL,sha256=vVCvjcmxuUltf8cYhJ0sJMRDLr1XsPuxEId8YDzbyCY,88
|
16
|
-
aio_kong-3.0.0.dist-info/RECORD,,
|