fable-model 0.3.0__tar.gz → 0.4.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fable-model
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: Data models utilized in the FABLE ecosystem's HTTP-based services.
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE
@@ -23,7 +23,7 @@ Description-Content-Type: text/markdown
23
23
 
24
24
  [![PyPI](https://img.shields.io/pypi/v/fable-model?cacheSeconds=0)](https://pypi.org/project/fable-model/)
25
25
  [![Python Versions](https://img.shields.io/pypi/pyversions/fable-model?cacheSeconds=0)](https://pypi.org/project/fable-model/)
26
- ![Code Coverage](https://img.shields.io/badge/Coverage-98%25-brightgreen.svg)
26
+ ![Code Coverage](https://img.shields.io/badge/Coverage-97%25-brightgreen.svg)
27
27
  [![License](https://img.shields.io/pypi/l/fable-model?cacheSeconds=0)](https://pypi.org/project/fable-model/)
28
28
  [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)
29
29
 
@@ -1,6 +1,6 @@
1
1
  [![PyPI](https://img.shields.io/pypi/v/fable-model?cacheSeconds=0)](https://pypi.org/project/fable-model/)
2
2
  [![Python Versions](https://img.shields.io/pypi/pyversions/fable-model?cacheSeconds=0)](https://pypi.org/project/fable-model/)
3
- ![Code Coverage](https://img.shields.io/badge/Coverage-98%25-brightgreen.svg)
3
+ ![Code Coverage](https://img.shields.io/badge/Coverage-97%25-brightgreen.svg)
4
4
  [![License](https://img.shields.io/pypi/l/fable-model?cacheSeconds=0)](https://pypi.org/project/fable-model/)
5
5
  [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)
6
6
 
@@ -75,6 +75,7 @@ from .broker import (
75
75
  ClientResultRequest,
76
76
  MatchedClientVector,
77
77
  ClientResultResponse,
78
+ SessionGetResponse,
78
79
  )
79
80
 
80
81
  __all__ = [
@@ -154,4 +155,5 @@ __all__ = [
154
155
  "MatchedClientVector",
155
156
  "ClientResultResponse",
156
157
  "ServiceBaseInformation",
158
+ "SessionGetResponse",
157
159
  ]
@@ -1,17 +1,25 @@
1
1
  from typing import Annotated
2
2
 
3
- from pydantic import BaseModel, Field
3
+ from pydantic import BaseModel, Field, SecretStr, field_serializer
4
4
 
5
5
  from fable_model.common import BitVectorEntity
6
6
  from fable_model.match import MatchConfig
7
7
 
8
8
 
9
9
  class BaseSessionModel(BaseModel):
10
- session: str
10
+ session: SecretStr
11
+
12
+ @field_serializer("session")
13
+ def serialize_session(self, value: SecretStr) -> str:
14
+ return value.get_secret_value()
11
15
 
12
16
 
13
17
  class BaseAuthenticatedSessionModel(BaseSessionModel):
14
- token: str
18
+ token: SecretStr
19
+
20
+ @field_serializer("token")
21
+ def serialize_token(self, value: SecretStr) -> str:
22
+ return value.get_secret_value()
15
23
 
16
24
 
17
25
  class SessionCreationRequest(BaseSessionModel):
@@ -23,8 +31,16 @@ class SessionUpdateResponse(BaseSessionModel):
23
31
  expires_at: int
24
32
 
25
33
 
34
+ class SessionGetResponse(SessionUpdateResponse):
35
+ match_config: MatchConfig
36
+
37
+
26
38
  class SessionCreationResponse(SessionUpdateResponse):
27
- token: str
39
+ token: SecretStr
40
+
41
+ @field_serializer("token")
42
+ def serialize_token(self, value: SecretStr) -> str:
43
+ return value.get_secret_value()
28
44
 
29
45
 
30
46
  SessionDeletionRequest = BaseAuthenticatedSessionModel
@@ -41,7 +57,11 @@ class MetaBitVectorEntity(BitVectorEntity):
41
57
 
42
58
 
43
59
  class BaseClientModel(BaseSessionModel):
44
- client: str
60
+ client: SecretStr
61
+
62
+ @field_serializer("client")
63
+ def serialize_client(self, value: SecretStr) -> str:
64
+ return value.get_secret_value()
45
65
 
46
66
 
47
67
  class ClientSubmissionRequest(BaseClientModel):
@@ -49,16 +69,24 @@ class ClientSubmissionRequest(BaseClientModel):
49
69
 
50
70
 
51
71
  class ClientVectorBatch(BaseModel):
52
- client: str
72
+ client: SecretStr
53
73
  ids: list[str]
54
74
 
75
+ @field_serializer("client")
76
+ def serialize_client(self, value: SecretStr) -> str:
77
+ return value.get_secret_value()
78
+
55
79
 
56
80
  class VectorMatchBatch(BaseModel):
57
81
  domain: ClientVectorBatch
58
82
  range: list[ClientVectorBatch]
59
- session: str
83
+ session: SecretStr
60
84
  config: MatchConfig
61
85
 
86
+ @field_serializer("session")
87
+ def serialize_session(self, value: SecretStr) -> str:
88
+ return value.get_secret_value()
89
+
62
90
 
63
91
  class ClientResultRequest(BaseClientModel):
64
92
  show_unfinished_results: bool = False
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "fable-model"
3
- version = "0.3.0"
3
+ version = "0.4.0"
4
4
  description = "Data models utilized in the FABLE ecosystem's HTTP-based services."
5
5
  authors = [
6
6
  {name = "Maximilian Jugl"},
File without changes