aspyx-service 0.10.3__py3-none-any.whl → 0.10.4__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 aspyx-service might be problematic. Click here for more details.
- aspyx_service/__init__.py +28 -4
- aspyx_service/authorization.py +135 -0
- aspyx_service/channels.py +234 -45
- aspyx_service/healthcheck.py +1 -1
- aspyx_service/registries.py +5 -5
- aspyx_service/restchannel.py +15 -18
- aspyx_service/serialization.py +3 -3
- aspyx_service/server.py +139 -69
- aspyx_service/service.py +47 -12
- aspyx_service/session.py +97 -0
- {aspyx_service-0.10.3.dist-info → aspyx_service-0.10.4.dist-info}/METADATA +31 -4
- aspyx_service-0.10.4.dist-info/RECORD +14 -0
- aspyx_service-0.10.3.dist-info/RECORD +0 -12
- {aspyx_service-0.10.3.dist-info → aspyx_service-0.10.4.dist-info}/WHEEL +0 -0
- {aspyx_service-0.10.3.dist-info → aspyx_service-0.10.4.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: aspyx_service
|
|
3
|
-
Version: 0.10.
|
|
3
|
+
Version: 0.10.4
|
|
4
4
|
Summary: Aspyx Service framework
|
|
5
5
|
Author-email: Andreas Ernst <andreas.ernst7@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -26,7 +26,8 @@ License: MIT License
|
|
|
26
26
|
SOFTWARE.
|
|
27
27
|
License-File: LICENSE
|
|
28
28
|
Requires-Python: >=3.9
|
|
29
|
-
Requires-Dist: aspyx>=1.5.
|
|
29
|
+
Requires-Dist: aspyx>=1.5.3
|
|
30
|
+
Requires-Dist: cachetools~=5.5.2
|
|
30
31
|
Requires-Dist: fastapi~=0.115.13
|
|
31
32
|
Requires-Dist: httpx~=0.28.1
|
|
32
33
|
Requires-Dist: msgpack~=1.1.1
|
|
@@ -60,6 +61,8 @@ Description-Content-Type: text/markdown
|
|
|
60
61
|
- [Rest Calls](#rest-calls)
|
|
61
62
|
- [Intercepting calls](#intercepting-calls)
|
|
62
63
|
- [FastAPI server](#fastapi-server)
|
|
64
|
+
- [Session](#session)
|
|
65
|
+
- [Authorization](#authorization)
|
|
63
66
|
- [Implementing Channels](#implementing-channels)
|
|
64
67
|
- [Version History](#version-history)
|
|
65
68
|
|
|
@@ -166,10 +169,24 @@ environment = server.boot(Module)
|
|
|
166
169
|
Of course, service can also be called locally. In case of multiple possible channels, a keyword argument is used to
|
|
167
170
|
determine a specific channel. As a local channel has the name "local", the appropriate call is:
|
|
168
171
|
|
|
172
|
+
**Example**:
|
|
173
|
+
|
|
169
174
|
```python
|
|
170
175
|
service = service_manager.get_service(TestService, preferred_channel="local")
|
|
171
176
|
```
|
|
172
177
|
|
|
178
|
+
The default can be set globally with the method `set_preferred_channel(channel: str)`
|
|
179
|
+
|
|
180
|
+
Injecting services is also possible via the decorator `@inject_service(preferred_channel=""")`
|
|
181
|
+
|
|
182
|
+
**Example**:
|
|
183
|
+
|
|
184
|
+
```python
|
|
185
|
+
@inject_service()
|
|
186
|
+
def set_service(self, service: TestService)
|
|
187
|
+
self.service = service
|
|
188
|
+
```
|
|
189
|
+
|
|
173
190
|
## Features
|
|
174
191
|
|
|
175
192
|
The library offers:
|
|
@@ -352,12 +369,14 @@ Channels implement the possible transport layer protocols. In the sense of a dyn
|
|
|
352
369
|
Several channels are implemented:
|
|
353
370
|
|
|
354
371
|
- `dispatch-json`
|
|
355
|
-
channel that
|
|
372
|
+
channel that posts generic `Request` objects via a `invoke` POST-call
|
|
356
373
|
- `dispatch-msgpack`
|
|
357
|
-
channel that
|
|
374
|
+
channel that posts generic `Request` objects via a `invoke` POST-call after packing the json with msgpack
|
|
358
375
|
- `rest`
|
|
359
376
|
channel that executes regular rest-calls as defined by a couple of decorators.
|
|
360
377
|
|
|
378
|
+
The `dispatch`channels have the big advantage, that you don`t have to deal with additional http decorators!
|
|
379
|
+
|
|
361
380
|
All channels react on changed URLs as provided by the component registry.
|
|
362
381
|
|
|
363
382
|
A so called `URLSelector` is used internally to provide URLs for every single call. Two subclasses exist that offer a different logic
|
|
@@ -482,6 +501,14 @@ class Module():
|
|
|
482
501
|
This setup will also expose all service interfaces decorated with the corresponding http decorators!
|
|
483
502
|
No need to add any FastAPI decorators, since the mapping is already done internally!
|
|
484
503
|
|
|
504
|
+
## Session
|
|
505
|
+
|
|
506
|
+
TODO
|
|
507
|
+
|
|
508
|
+
## Authorization
|
|
509
|
+
|
|
510
|
+
TODO
|
|
511
|
+
|
|
485
512
|
## Implementing Channels
|
|
486
513
|
|
|
487
514
|
To implement a new channel, you only need to derive from one of the possible base classes ( `Channel` or `HTTPXChannel` that already has a `httpx` client)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
aspyx_service/__init__.py,sha256=h9zcGzYaVdU2_mXON-k-mgYErEJ7eIs-wjNDKtet1_s,2488
|
|
2
|
+
aspyx_service/authorization.py,sha256=vBM8uPsAZwMiTilqFZMJ101Qy37gL2Y9vdGTLp-ykFg,3983
|
|
3
|
+
aspyx_service/channels.py,sha256=3Fv6055n1hw8HQ6MKu2BROsq6gmPdKIhayUhQiTRLic,16461
|
|
4
|
+
aspyx_service/healthcheck.py,sha256=vjfY7s5kd5mRJynVpvAJ4BvVF7QY1xrvj94Y-m041LQ,5615
|
|
5
|
+
aspyx_service/registries.py,sha256=bnTjKb40fbZXA52E2lDSEzCWI5_NBKZzQjc8ffufB5g,8039
|
|
6
|
+
aspyx_service/restchannel.py,sha256=wutLGnxqMAS1oX7cc1pvN8qIIpjeBEvPz_hsKeWHVZs,8474
|
|
7
|
+
aspyx_service/serialization.py,sha256=OrwOAUsHQyGDyhYTkTc-0v8urYMbh0_3fgkpTvNOl0o,4214
|
|
8
|
+
aspyx_service/server.py,sha256=_LFRy1XIXTbu7CLoXsoPGQwKHkpSPDh82VV4ppahzr0,9057
|
|
9
|
+
aspyx_service/service.py,sha256=drETAZasbYJZisnmbhAqW0-mHghJ3IWyPaU-7etxvBI,27003
|
|
10
|
+
aspyx_service/session.py,sha256=ytWRTlnu1kDpTkLBCy_WF2i-mdffG-exIqsUQZ1Udo0,2592
|
|
11
|
+
aspyx_service-0.10.4.dist-info/METADATA,sha256=-WA5_ta5gP3AXy8EA0JhFzoFstaS_RgeGjyglOAYqXw,17499
|
|
12
|
+
aspyx_service-0.10.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
13
|
+
aspyx_service-0.10.4.dist-info/licenses/LICENSE,sha256=n4jfx_MNj7cBtPhhI7MCoB_K35cj1icP9yJ4Rh4vlvY,1070
|
|
14
|
+
aspyx_service-0.10.4.dist-info/RECORD,,
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
aspyx_service/__init__.py,sha256=6t24VPrSCG83EAvYlqCKdEcEbyCY3vrSb5GoAx01Ymg,1662
|
|
2
|
-
aspyx_service/channels.py,sha256=p5JIyo7eWyBiR2xQrfsEvq2L89FzeFT1tqKYhvXQbXs,9035
|
|
3
|
-
aspyx_service/healthcheck.py,sha256=8ZPSkAx6ypoYaxDMkJT_MtL2pEN2LcUAishAWPCy-3I,5624
|
|
4
|
-
aspyx_service/registries.py,sha256=JSsD32F8VffZMHyEDuapEWtvmem5SK9kR6bgsFRLFZQ,8002
|
|
5
|
-
aspyx_service/restchannel.py,sha256=Q_7RURjZZW7N2LBLY9BL7qKyS_A62X7yFoGUoE-_0YY,9103
|
|
6
|
-
aspyx_service/serialization.py,sha256=GEgfg1cNSOJ_oe0gEm0ajzugLyUmPiEsp9Qz6Fu4vkA,4207
|
|
7
|
-
aspyx_service/server.py,sha256=PHKx3O90jnxm8dA4z331_51znhU-HlRB2Fa1AikmFXA,7052
|
|
8
|
-
aspyx_service/service.py,sha256=Odl6_nvOOJ2lFjqCLJD8KLPt-sCG55VtQQiKTyNEOPs,26062
|
|
9
|
-
aspyx_service-0.10.3.dist-info/METADATA,sha256=MrWNfy3T2m4G5MyKlV4Spr2yi6N_hE1VLRT3vNJ6Hm0,16955
|
|
10
|
-
aspyx_service-0.10.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
11
|
-
aspyx_service-0.10.3.dist-info/licenses/LICENSE,sha256=n4jfx_MNj7cBtPhhI7MCoB_K35cj1icP9yJ4Rh4vlvY,1070
|
|
12
|
-
aspyx_service-0.10.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|