koi-net 1.1.0b6__tar.gz → 1.1.0b7__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.
Potentially problematic release.
This version of koi-net might be problematic. Click here for more details.
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/PKG-INFO +1 -1
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/pyproject.toml +1 -1
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/network/request_handler.py +1 -1
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/protocol/edge.py +4 -1
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/protocol/envelope.py +9 -5
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/protocol/event.py +0 -3
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/server.py +2 -1
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/.github/workflows/publish-to-pypi.yml +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/.gitignore +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/LICENSE +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/README.md +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/examples/coordinator.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/examples/partial.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/requirements.txt +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/__init__.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/config.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/context.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/core.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/default_actions.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/effector.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/identity.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/lifecycle.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/network/__init__.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/network/behavior.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/network/error_handler.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/network/event_queue.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/network/graph.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/network/resolver.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/network/response_handler.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/poller.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/processor/__init__.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/processor/default_handlers.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/processor/handler.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/processor/interface.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/processor/knowledge_object.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/processor/knowledge_pipeline.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/protocol/__init__.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/protocol/api_models.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/protocol/consts.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/protocol/errors.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/protocol/node.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/protocol/secure.py +0 -0
- {koi_net-1.1.0b6 → koi_net-1.1.0b7}/src/koi_net/secure.py +0 -0
|
@@ -119,7 +119,7 @@ class RequestHandler:
|
|
|
119
119
|
)
|
|
120
120
|
|
|
121
121
|
try:
|
|
122
|
-
result = httpx.post(url, data=signed_envelope.model_dump_json())
|
|
122
|
+
result = httpx.post(url, data=signed_envelope.model_dump_json(exclude_none=True))
|
|
123
123
|
except httpx.ConnectError as err:
|
|
124
124
|
logger.debug("Failed to connect")
|
|
125
125
|
self.error_handler.handle_connection_error(node)
|
|
@@ -2,6 +2,7 @@ from enum import StrEnum
|
|
|
2
2
|
from pydantic import BaseModel
|
|
3
3
|
from rid_lib import RIDType
|
|
4
4
|
from rid_lib.ext.bundle import Bundle
|
|
5
|
+
from rid_lib.ext.utils import sha256_hash
|
|
5
6
|
from rid_lib.types import KoiNetEdge, KoiNetNode
|
|
6
7
|
|
|
7
8
|
|
|
@@ -27,7 +28,9 @@ def generate_edge_bundle(
|
|
|
27
28
|
rid_types: list[RIDType],
|
|
28
29
|
edge_type: EdgeType
|
|
29
30
|
) -> Bundle:
|
|
30
|
-
edge_rid = KoiNetEdge
|
|
31
|
+
edge_rid = KoiNetEdge(sha256_hash(
|
|
32
|
+
str(source) + str(target)
|
|
33
|
+
))
|
|
31
34
|
edge_profile = EdgeProfile(
|
|
32
35
|
source=source,
|
|
33
36
|
target=target,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
from typing import Generic, TypeVar
|
|
3
|
-
from pydantic import BaseModel
|
|
3
|
+
from pydantic import BaseModel, ConfigDict
|
|
4
4
|
from rid_lib.types import KoiNetNode
|
|
5
5
|
|
|
6
6
|
from .secure import PrivateKey, PublicKey
|
|
@@ -13,6 +13,8 @@ logger = logging.getLogger(__name__)
|
|
|
13
13
|
T = TypeVar("T", bound=RequestModels | ResponseModels)
|
|
14
14
|
|
|
15
15
|
class SignedEnvelope(BaseModel, Generic[T]):
|
|
16
|
+
model_config = ConfigDict(exclude_none=True)
|
|
17
|
+
|
|
16
18
|
payload: T
|
|
17
19
|
source_node: KoiNetNode
|
|
18
20
|
target_node: KoiNetNode
|
|
@@ -26,24 +28,26 @@ class SignedEnvelope(BaseModel, Generic[T]):
|
|
|
26
28
|
target_node=self.target_node
|
|
27
29
|
)
|
|
28
30
|
|
|
29
|
-
logger.debug(f"Verifying envelope: {unsigned_envelope.model_dump_json()}")
|
|
31
|
+
logger.debug(f"Verifying envelope: {unsigned_envelope.model_dump_json(exclude_none=True)}")
|
|
30
32
|
|
|
31
33
|
pub_key.verify(
|
|
32
34
|
self.signature,
|
|
33
|
-
unsigned_envelope.model_dump_json().encode()
|
|
35
|
+
unsigned_envelope.model_dump_json(exclude_none=True).encode()
|
|
34
36
|
)
|
|
35
37
|
|
|
36
38
|
class UnsignedEnvelope(BaseModel, Generic[T]):
|
|
39
|
+
model_config = ConfigDict(exclude_none=True)
|
|
40
|
+
|
|
37
41
|
payload: T
|
|
38
42
|
source_node: KoiNetNode
|
|
39
43
|
target_node: KoiNetNode
|
|
40
44
|
|
|
41
45
|
def sign_with(self, priv_key: PrivateKey) -> SignedEnvelope[T]:
|
|
42
|
-
logger.debug(f"Signing envelope: {self.model_dump_json()}")
|
|
46
|
+
logger.debug(f"Signing envelope: {self.model_dump_json(exclude_none=True)}")
|
|
43
47
|
logger.debug(f"Type: [{type(self.payload)}]")
|
|
44
48
|
|
|
45
49
|
signature = priv_key.sign(
|
|
46
|
-
self.model_dump_json().encode()
|
|
50
|
+
self.model_dump_json(exclude_none=True).encode()
|
|
47
51
|
)
|
|
48
52
|
|
|
49
53
|
return SignedEnvelope(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|