tba-concrete-administrator-identity 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,14 @@
1
+ Metadata-Version: 2.4
2
+ Name: tba-concrete-administrator-identity
3
+ Version: 0.4.0.dev2
4
+ Summary: Standalone concrete administrative identity model.
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
+ Requires-Dist: tba-bases-identity (==0.4.0.dev2)
14
+ Requires-Dist: tba-contracts-identity (==0.4.0.dev2)
@@ -0,0 +1,12 @@
1
+ [project]
2
+ name = "tba-concrete-administrator-identity"
3
+ version = "0.4.0.dev2"
4
+ description = "Standalone concrete administrative identity model."
5
+ requires-python = ">=3.10,<3.15"
6
+ license = "Apache-2.0"
7
+ dependencies = ["tba-contracts-identity==0.4.0.dev2", "tba-bases-identity==0.4.0.dev2"]
8
+ [build-system]
9
+ requires = ["poetry-core>=1.0.0"]
10
+ build-backend = "poetry.core.masonry.api"
11
+ [tool.poetry]
12
+ packages = [{ include = "tba_concrete_administrator_identity", from = "src" }]
@@ -0,0 +1,20 @@
1
+ from dataclasses import dataclass, field
2
+ from tba_contracts_identity.authority import AuthorityRole
3
+ from tba_contracts_identity.principals import PrincipalKind
4
+ from tba_bases_identity import IdentityBase
5
+ from tba_primitives_identity import new_model_id
6
+
7
+
8
+ @dataclass(frozen=True, slots=True, kw_only=True)
9
+ class AdminIdentity(IdentityBase):
10
+ id: str = field(default_factory=new_model_id)
11
+ kind: PrincipalKind = field(default=PrincipalKind.USER, init=False)
12
+
13
+ def __post_init__(self) -> None:
14
+ object.__setattr__(
15
+ self, "roles", tuple(sorted({AuthorityRole.ADMIN.value, *self.roles}))
16
+ )
17
+ IdentityBase.__post_init__(self)
18
+
19
+
20
+ __all__ = ["AdminIdentity"]