tba-contracts-security-event 0.4.0.dev2__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.
@@ -0,0 +1,18 @@
1
+ Metadata-Version: 2.4
2
+ Name: tba-contracts-security-event
3
+ Version: 0.4.0.dev2
4
+ Summary: Protocol-neutral security-event contracts.
5
+ License-Expression: Apache-2.0
6
+ Requires-Python: >=3.10,<3.15
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Programming Language :: Python :: 3.10
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Classifier: Programming Language :: Python :: 3.13
12
+ Classifier: Programming Language :: Python :: 3.14
13
+ Description-Content-Type: text/markdown
14
+
15
+ # tba-contracts-security-event
16
+
17
+ Owns security-event values, subjects, subscriptions, delivery records, and semantic ports.
18
+
@@ -0,0 +1,3 @@
1
+ # tba-contracts-security-event
2
+
3
+ Owns security-event values, subjects, subscriptions, delivery records, and semantic ports.
@@ -0,0 +1,15 @@
1
+ [project]
2
+ name = "tba-contracts-security-event"
3
+ version = "0.4.0.dev2"
4
+ description = "Protocol-neutral security-event contracts."
5
+ readme = "README.md"
6
+ requires-python = ">=3.10,<3.15"
7
+ license = "Apache-2.0"
8
+ dependencies = []
9
+
10
+ [build-system]
11
+ requires = ["poetry-core>=1.0.0"]
12
+ build-backend = "poetry.core.masonry.api"
13
+
14
+ [tool.poetry]
15
+ packages = [{ include = "tba_contracts_security_event", from = "src" }]
@@ -0,0 +1,14 @@
1
+ """Canonical protocol-neutral security-event contracts."""
2
+
3
+ from .events import SecurityEvent, SecurityEventSubject
4
+ from .ports import SecurityEventReceiverPort, SecurityEventTransmitterPort
5
+ from .subscriptions import SecurityEventDelivery, SecurityEventSubscription
6
+
7
+ __all__ = [
8
+ "SecurityEvent",
9
+ "SecurityEventDelivery",
10
+ "SecurityEventReceiverPort",
11
+ "SecurityEventSubject",
12
+ "SecurityEventSubscription",
13
+ "SecurityEventTransmitterPort",
14
+ ]
@@ -0,0 +1,25 @@
1
+ """Canonical security-event value contracts."""
2
+
3
+ from dataclasses import dataclass, field
4
+ from datetime import datetime
5
+ from typing import Mapping
6
+
7
+
8
+ @dataclass(frozen=True, slots=True)
9
+ class SecurityEventSubject:
10
+ format: str
11
+ identifiers: Mapping[str, str]
12
+
13
+
14
+ @dataclass(frozen=True, slots=True)
15
+ class SecurityEvent:
16
+ event_type: str
17
+ issuer: str
18
+ audience: tuple[str, ...]
19
+ token_id: str
20
+ issued_at: datetime
21
+ subject: SecurityEventSubject | None = None
22
+ data: Mapping[str, object] = field(default_factory=dict)
23
+
24
+
25
+ __all__ = ["SecurityEvent", "SecurityEventSubject"]
@@ -0,0 +1,16 @@
1
+ """Canonical security-event delivery ports."""
2
+
3
+ from typing import Protocol
4
+
5
+ from .events import SecurityEvent
6
+
7
+
8
+ class SecurityEventTransmitterPort(Protocol):
9
+ def transmit(self, event: SecurityEvent, subscriber: str, /) -> str: ...
10
+
11
+
12
+ class SecurityEventReceiverPort(Protocol):
13
+ def receive(self, encoded_event: str | bytes, /) -> SecurityEvent: ...
14
+
15
+
16
+ __all__ = ["SecurityEventReceiverPort", "SecurityEventTransmitterPort"]
@@ -0,0 +1,23 @@
1
+ """Canonical security-event subscription contracts."""
2
+
3
+ from dataclasses import dataclass
4
+ from datetime import datetime
5
+
6
+
7
+ @dataclass(frozen=True, slots=True)
8
+ class SecurityEventSubscription:
9
+ subscriber: str
10
+ event_types: tuple[str, ...]
11
+ delivery_method: str
12
+
13
+
14
+ @dataclass(frozen=True, slots=True)
15
+ class SecurityEventDelivery:
16
+ event_id: str
17
+ subscriber: str
18
+ attempted_at: datetime
19
+ accepted: bool
20
+ response_code: int | None = None
21
+
22
+
23
+ __all__ = ["SecurityEventDelivery", "SecurityEventSubscription"]