maleo-foundation 0.1.77__py3-none-any.whl → 0.1.79__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.
- maleo_foundation/authentication.py +3 -3
- maleo_foundation/client/services/encryption/aes.py +11 -11
- maleo_foundation/client/services/encryption/rsa.py +16 -16
- maleo_foundation/client/services/hash/bcrypt.py +12 -12
- maleo_foundation/client/services/hash/hmac.py +12 -12
- maleo_foundation/client/services/hash/sha256.py +12 -12
- maleo_foundation/client/services/key.py +18 -18
- maleo_foundation/client/services/signature.py +16 -16
- maleo_foundation/client/services/token.py +18 -18
- maleo_foundation/expanded_types/encryption/__init__.py +4 -4
- maleo_foundation/expanded_types/encryption/aes.py +6 -6
- maleo_foundation/expanded_types/encryption/rsa.py +6 -6
- maleo_foundation/expanded_types/hash.py +6 -6
- maleo_foundation/expanded_types/key.py +8 -8
- maleo_foundation/expanded_types/signature.py +6 -6
- maleo_foundation/expanded_types/token.py +6 -6
- maleo_foundation/managers/service.py +4 -4
- maleo_foundation/middlewares/authentication.py +2 -2
- maleo_foundation/middlewares/base.py +2 -2
- maleo_foundation/models/schemas/encryption.py +1 -1
- maleo_foundation/models/schemas/hash.py +1 -1
- maleo_foundation/models/schemas/signature.py +1 -1
- maleo_foundation/models/schemas/token.py +1 -1
- maleo_foundation/models/transfers/general/__init__.py +2 -2
- maleo_foundation/models/transfers/general/key.py +3 -3
- maleo_foundation/models/transfers/general/signature.py +3 -3
- maleo_foundation/models/transfers/general/token.py +3 -3
- maleo_foundation/models/transfers/parameters/encryption/__init__.py +4 -4
- maleo_foundation/models/transfers/parameters/encryption/aes.py +7 -7
- maleo_foundation/models/transfers/parameters/encryption/rsa.py +7 -6
- maleo_foundation/models/transfers/parameters/hash/__init__.py +6 -6
- maleo_foundation/models/transfers/parameters/hash/bcrypt.py +5 -5
- maleo_foundation/models/transfers/parameters/hash/hmac.py +7 -7
- maleo_foundation/models/transfers/parameters/hash/sha256.py +5 -5
- maleo_foundation/models/transfers/parameters/key.py +3 -3
- maleo_foundation/models/transfers/parameters/signature.py +8 -8
- maleo_foundation/models/transfers/parameters/token.py +8 -8
- maleo_foundation/models/transfers/results/encryption/__init__.py +4 -4
- maleo_foundation/models/transfers/results/encryption/aes.py +6 -6
- maleo_foundation/models/transfers/results/encryption/rsa.py +4 -4
- maleo_foundation/models/transfers/results/hash.py +4 -4
- maleo_foundation/models/transfers/results/key.py +5 -5
- maleo_foundation/models/transfers/results/signature.py +4 -4
- maleo_foundation/models/transfers/results/token.py +5 -5
- {maleo_foundation-0.1.77.dist-info → maleo_foundation-0.1.79.dist-info}/METADATA +1 -1
- {maleo_foundation-0.1.77.dist-info → maleo_foundation-0.1.79.dist-info}/RECORD +48 -48
- {maleo_foundation-0.1.77.dist-info → maleo_foundation-0.1.79.dist-info}/WHEEL +0 -0
- {maleo_foundation-0.1.77.dist-info → maleo_foundation-0.1.79.dist-info}/top_level.txt +0 -0
@@ -1,13 +1,13 @@
|
|
1
1
|
from typing import Union
|
2
|
-
from maleo_foundation.models.transfers.results.hash import
|
2
|
+
from maleo_foundation.models.transfers.results.hash import MaleoFoundationHashResultsTransfers
|
3
3
|
|
4
|
-
class
|
4
|
+
class MaleoFoundationHashResultsTypes:
|
5
5
|
Hash = Union[
|
6
|
-
|
7
|
-
|
6
|
+
MaleoFoundationHashResultsTransfers.Fail,
|
7
|
+
MaleoFoundationHashResultsTransfers.Hash
|
8
8
|
]
|
9
9
|
|
10
10
|
Verify = Union[
|
11
|
-
|
12
|
-
|
11
|
+
MaleoFoundationHashResultsTransfers.Fail,
|
12
|
+
MaleoFoundationHashResultsTransfers.Verify
|
13
13
|
]
|
@@ -1,18 +1,18 @@
|
|
1
1
|
from typing import Union
|
2
|
-
from maleo_foundation.models.transfers.results.key import
|
2
|
+
from maleo_foundation.models.transfers.results.key import MaleoFoundationKeyResultsTransfers
|
3
3
|
|
4
|
-
class
|
4
|
+
class MaleoFoundationKeyResultsTypes:
|
5
5
|
CreatePrivate = Union[
|
6
|
-
|
7
|
-
|
6
|
+
MaleoFoundationKeyResultsTransfers.Fail,
|
7
|
+
MaleoFoundationKeyResultsTransfers.CreatePrivate
|
8
8
|
]
|
9
9
|
|
10
10
|
CreatePublic = Union[
|
11
|
-
|
12
|
-
|
11
|
+
MaleoFoundationKeyResultsTransfers.Fail,
|
12
|
+
MaleoFoundationKeyResultsTransfers.CreatePublic
|
13
13
|
]
|
14
14
|
|
15
15
|
CreatePair = Union[
|
16
|
-
|
17
|
-
|
16
|
+
MaleoFoundationKeyResultsTransfers.Fail,
|
17
|
+
MaleoFoundationKeyResultsTransfers.CreatePair
|
18
18
|
]
|
@@ -1,13 +1,13 @@
|
|
1
1
|
from typing import Union
|
2
|
-
from maleo_foundation.models.transfers.results.signature import
|
2
|
+
from maleo_foundation.models.transfers.results.signature import MaleoFoundationSignatureResultsTransfers
|
3
3
|
|
4
|
-
class
|
4
|
+
class MaleoFoundationSignatureResultsTypes:
|
5
5
|
Sign = Union[
|
6
|
-
|
7
|
-
|
6
|
+
MaleoFoundationSignatureResultsTransfers.Fail,
|
7
|
+
MaleoFoundationSignatureResultsTransfers.Sign
|
8
8
|
]
|
9
9
|
|
10
10
|
Verify = Union[
|
11
|
-
|
12
|
-
|
11
|
+
MaleoFoundationSignatureResultsTransfers.Fail,
|
12
|
+
MaleoFoundationSignatureResultsTransfers.Verify
|
13
13
|
]
|
@@ -1,13 +1,13 @@
|
|
1
1
|
from typing import Union
|
2
|
-
from maleo_foundation.models.transfers.results.token import
|
2
|
+
from maleo_foundation.models.transfers.results.token import MaleoFoundationTokenResultsTransfers
|
3
3
|
|
4
|
-
class
|
4
|
+
class MaleoFoundationTokenResultsTypes:
|
5
5
|
Encode = Union[
|
6
|
-
|
7
|
-
|
6
|
+
MaleoFoundationTokenResultsTransfers.Fail,
|
7
|
+
MaleoFoundationTokenResultsTransfers.Encode
|
8
8
|
]
|
9
9
|
|
10
10
|
Decode = Union[
|
11
|
-
|
12
|
-
|
11
|
+
MaleoFoundationTokenResultsTransfers.Fail,
|
12
|
+
MaleoFoundationTokenResultsTransfers.Decode
|
13
13
|
]
|
@@ -9,8 +9,8 @@ from typing import Optional
|
|
9
9
|
from maleo_foundation.client.manager import MaleoFoundationClientManager
|
10
10
|
from maleo_foundation.enums import BaseEnums
|
11
11
|
from maleo_foundation.models.schemas.general import BaseGeneralSchemas
|
12
|
-
from maleo_foundation.models.transfers.general.token import
|
13
|
-
from maleo_foundation.models.transfers.parameters.token import
|
12
|
+
from maleo_foundation.models.transfers.general.token import MaleoFoundationTokenGeneralTransfers
|
13
|
+
from maleo_foundation.models.transfers.parameters.token import MaleoFoundationTokenParametersTransfers
|
14
14
|
from maleo_foundation.managers.db import DatabaseConfigurations, DatabaseManager
|
15
15
|
from maleo_foundation.managers.client.google.secret import GoogleSecretManager
|
16
16
|
from maleo_foundation.managers.client.google.storage import GoogleCloudStorage
|
@@ -275,13 +275,13 @@ class ServiceManager:
|
|
275
275
|
|
276
276
|
@property
|
277
277
|
def token(self) -> str:
|
278
|
-
payload =
|
278
|
+
payload = MaleoFoundationTokenGeneralTransfers.BaseEncodePayload(
|
279
279
|
sr=self._credentials.internal.system_role,
|
280
280
|
u_u=self._credentials.internal.username,
|
281
281
|
u_e=self._credentials.internal.email,
|
282
282
|
u_ut=self._credentials.internal.user_type
|
283
283
|
)
|
284
|
-
parameters =
|
284
|
+
parameters = MaleoFoundationTokenParametersTransfers.Encode(key=self._keys.private, password=self._keys.password, payload=payload)
|
285
285
|
result = self._clients.maleo.foundation.services.token.encode(parameters=parameters)
|
286
286
|
if not result.success:
|
287
287
|
raise RuntimeError("Failed encoding payload into token")
|
@@ -7,7 +7,7 @@ from typing import Tuple
|
|
7
7
|
from maleo_foundation.authentication import Credentials, User
|
8
8
|
from maleo_foundation.client.manager import MaleoFoundationClientManager
|
9
9
|
from maleo_foundation.models.schemas import BaseGeneralSchemas
|
10
|
-
from maleo_foundation.models.transfers.parameters.token import
|
10
|
+
from maleo_foundation.models.transfers.parameters.token import MaleoFoundationTokenParametersTransfers
|
11
11
|
from maleo_foundation.utils.exceptions import BaseExceptions
|
12
12
|
from maleo_foundation.utils.logging import MiddlewareLogger
|
13
13
|
|
@@ -27,7 +27,7 @@ class Backend(AuthenticationBackend):
|
|
27
27
|
if scheme != 'Bearer':
|
28
28
|
raise AuthenticationError("Authorization scheme must be Bearer token")
|
29
29
|
|
30
|
-
decode_token_parameters =
|
30
|
+
decode_token_parameters = MaleoFoundationTokenParametersTransfers.Decode(key=self._keys.public, token=token)
|
31
31
|
decode_token_result = self._maleo_foundation.services.token.decode(parameters=decode_token_parameters)
|
32
32
|
if not decode_token_result.success:
|
33
33
|
raise AuthenticationError("Invalid Bearer token, unable to decode token")
|
@@ -12,7 +12,7 @@ from maleo_foundation.authentication import Credentials, User
|
|
12
12
|
from maleo_foundation.client.manager import MaleoFoundationClientManager
|
13
13
|
from maleo_foundation.models.schemas import BaseGeneralSchemas
|
14
14
|
from maleo_foundation.models.responses import BaseResponses
|
15
|
-
from maleo_foundation.models.transfers.parameters.signature import
|
15
|
+
from maleo_foundation.models.transfers.parameters.signature import MaleoFoundationSignatureParametersTransfers
|
16
16
|
from maleo_foundation.utils.extractor import BaseExtractors
|
17
17
|
from maleo_foundation.utils.logging import MiddlewareLogger
|
18
18
|
|
@@ -127,7 +127,7 @@ class BaseMiddleware(BaseHTTPMiddleware):
|
|
127
127
|
response.headers["X-Response-Timestamp"] = response_timestamp.isoformat() #* Define and add response timestamp header
|
128
128
|
#* Generate signature header
|
129
129
|
message = f"{request.method}|{request.url.path}|{request_timestamp.isoformat()}|{response_timestamp.isoformat()}|{str(process_time)}"
|
130
|
-
sign_parameters =
|
130
|
+
sign_parameters = MaleoFoundationSignatureParametersTransfers.Sign(key=self._keys.private, password=self._keys.password, message=message)
|
131
131
|
sign_result = self._maleo_foundation.services.signature.sign(parameters=sign_parameters)
|
132
132
|
if sign_result.success:
|
133
133
|
response.headers["X-Signature"] = sign_result.data.signature
|
@@ -3,7 +3,7 @@ from pydantic import BaseModel, Field
|
|
3
3
|
from maleo_foundation.enums import BaseEnums
|
4
4
|
from maleo_foundation.models.schemas.key import BaseKeySchemas
|
5
5
|
|
6
|
-
class
|
6
|
+
class MaleoFoundationKeyGeneralTransfers:
|
7
7
|
class PrivateKey(BaseKeySchemas.Key):
|
8
8
|
type:BaseEnums.KeyType = Field(BaseEnums.KeyType.PRIVATE, description="Private key's type")
|
9
9
|
|
@@ -11,5 +11,5 @@ class BaseKeyGeneralTransfers:
|
|
11
11
|
type:BaseEnums.KeyType = Field(BaseEnums.KeyType.PUBLIC, description="Public key's type")
|
12
12
|
|
13
13
|
class KeyPair(BaseModel):
|
14
|
-
private:
|
15
|
-
public:
|
14
|
+
private:MaleoFoundationKeyGeneralTransfers.PrivateKey = Field(..., description="Private key's data")
|
15
|
+
public:MaleoFoundationKeyGeneralTransfers.PublicKey = Field(..., description="Public key's data")
|
@@ -1,8 +1,8 @@
|
|
1
1
|
from __future__ import annotations
|
2
|
-
from maleo_foundation.models.schemas.signature import
|
2
|
+
from maleo_foundation.models.schemas.signature import MaleoFoundationSignatureSchemas
|
3
3
|
|
4
4
|
class BaseSignatureGeneralTransfers:
|
5
5
|
class SignaturePackage(
|
6
|
-
|
7
|
-
|
6
|
+
MaleoFoundationSignatureSchemas.Message,
|
7
|
+
MaleoFoundationSignatureSchemas.Signature
|
8
8
|
): pass
|
@@ -2,9 +2,9 @@ from __future__ import annotations
|
|
2
2
|
from pydantic import BaseModel, Field, model_validator
|
3
3
|
from datetime import datetime, timedelta, timezone
|
4
4
|
from maleo_foundation.types import BaseTypes
|
5
|
-
from maleo_foundation.models.schemas.token import
|
5
|
+
from maleo_foundation.models.schemas.token import MaleoFoundationTokenSchemas
|
6
6
|
|
7
|
-
class
|
7
|
+
class MaleoFoundationTokenGeneralTransfers:
|
8
8
|
class BasePayload(BaseModel):
|
9
9
|
sr:str = Field(..., description="System role")
|
10
10
|
u_u:str = Field(..., description="user's username")
|
@@ -20,7 +20,7 @@ class BaseTokenGeneralTransfers:
|
|
20
20
|
exp_dt:datetime = Field(..., description="Expired at (datetime)")
|
21
21
|
exp:int = Field(..., description="Expired at (integet)")
|
22
22
|
|
23
|
-
class BaseEncodePayload(
|
23
|
+
class BaseEncodePayload(MaleoFoundationTokenSchemas.ExpIn, BasePayload): pass
|
24
24
|
|
25
25
|
class EncodePayload(DecodePayload):
|
26
26
|
iat_dt:datetime = Field(datetime.now(timezone.utc), description="Issued at (datetime)")
|
@@ -1,7 +1,7 @@
|
|
1
1
|
from __future__ import annotations
|
2
|
-
from .aes import
|
3
|
-
from .rsa import
|
2
|
+
from .aes import MaleoFoundationAESEncryptionParametersTransfers
|
3
|
+
from .rsa import MaleoFoundationRSAEncryptionParametersTransfers
|
4
4
|
|
5
5
|
class BaseEncryptionParametersTransfers:
|
6
|
-
AES =
|
7
|
-
RSA =
|
6
|
+
AES = MaleoFoundationAESEncryptionParametersTransfers
|
7
|
+
RSA = MaleoFoundationRSAEncryptionParametersTransfers
|
@@ -1,13 +1,13 @@
|
|
1
|
-
from maleo_foundation.models.schemas.encryption import
|
1
|
+
from maleo_foundation.models.schemas.encryption import MaleoFoundationEncryptionSchemas
|
2
2
|
|
3
|
-
class
|
3
|
+
class MaleoFoundationAESEncryptionParametersTransfers:
|
4
4
|
class Encrypt(
|
5
|
-
|
6
|
-
|
5
|
+
MaleoFoundationEncryptionSchemas.Plaintext,
|
6
|
+
MaleoFoundationEncryptionSchemas.Key
|
7
7
|
): pass
|
8
8
|
|
9
9
|
class Decrypt(
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
MaleoFoundationEncryptionSchemas.Ciphertext,
|
11
|
+
MaleoFoundationEncryptionSchemas.InitializationVector,
|
12
|
+
MaleoFoundationEncryptionSchemas.Key
|
13
13
|
): pass
|
@@ -1,12 +1,13 @@
|
|
1
|
-
from maleo_foundation.models.schemas.encryption import
|
1
|
+
from maleo_foundation.models.schemas.encryption import MaleoFoundationEncryptionSchemas
|
2
2
|
|
3
|
-
class
|
3
|
+
class MaleoFoundationRSAEncryptionParametersTransfers:
|
4
4
|
class Encrypt(
|
5
|
-
|
6
|
-
|
5
|
+
MaleoFoundationEncryptionSchemas.Plaintext,
|
6
|
+
MaleoFoundationEncryptionSchemas.Key
|
7
7
|
): pass
|
8
8
|
|
9
9
|
class Decrypt(
|
10
|
-
|
11
|
-
|
10
|
+
MaleoFoundationEncryptionSchemas.Ciphertext,
|
11
|
+
MaleoFoundationEncryptionSchemas.Password,
|
12
|
+
MaleoFoundationEncryptionSchemas.Key
|
12
13
|
): pass
|
@@ -1,9 +1,9 @@
|
|
1
1
|
from __future__ import annotations
|
2
|
-
from .bcrypt import
|
3
|
-
from .hmac import
|
4
|
-
from .sha256 import
|
2
|
+
from .bcrypt import MaleoFoundationBcryptHashParametersTransfers
|
3
|
+
from .hmac import MaleoFoundationHMACHashParametersTransfers
|
4
|
+
from .sha256 import MaleoFoundationSHA256HashParametersTransfers
|
5
5
|
|
6
6
|
class BaseHashParametersTransfers:
|
7
|
-
Bcrypt =
|
8
|
-
HMAC =
|
9
|
-
SHA256 =
|
7
|
+
Bcrypt = MaleoFoundationBcryptHashParametersTransfers
|
8
|
+
HMAC = MaleoFoundationHMACHashParametersTransfers
|
9
|
+
SHA256 = MaleoFoundationSHA256HashParametersTransfers
|
@@ -1,9 +1,9 @@
|
|
1
|
-
from maleo_foundation.models.schemas.hash import
|
1
|
+
from maleo_foundation.models.schemas.hash import MaleoFoundationHashSchemas
|
2
2
|
|
3
|
-
class
|
4
|
-
class Hash(
|
3
|
+
class MaleoFoundationBcryptHashParametersTransfers:
|
4
|
+
class Hash(MaleoFoundationHashSchemas.Message): pass
|
5
5
|
|
6
6
|
class Verify(
|
7
|
-
|
8
|
-
|
7
|
+
MaleoFoundationHashSchemas.Hash,
|
8
|
+
MaleoFoundationHashSchemas.Message
|
9
9
|
): pass
|
@@ -1,13 +1,13 @@
|
|
1
|
-
from maleo_foundation.models.schemas.hash import
|
1
|
+
from maleo_foundation.models.schemas.hash import MaleoFoundationHashSchemas
|
2
2
|
|
3
|
-
class
|
3
|
+
class MaleoFoundationHMACHashParametersTransfers:
|
4
4
|
class Hash(
|
5
|
-
|
6
|
-
|
5
|
+
MaleoFoundationHashSchemas.Message,
|
6
|
+
MaleoFoundationHashSchemas.Key
|
7
7
|
): pass
|
8
8
|
|
9
9
|
class Verify(
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
MaleoFoundationHashSchemas.Hash,
|
11
|
+
MaleoFoundationHashSchemas.Message,
|
12
|
+
MaleoFoundationHashSchemas.Key
|
13
13
|
): pass
|
@@ -1,9 +1,9 @@
|
|
1
|
-
from maleo_foundation.models.schemas.hash import
|
1
|
+
from maleo_foundation.models.schemas.hash import MaleoFoundationHashSchemas
|
2
2
|
|
3
|
-
class
|
4
|
-
class Hash(
|
3
|
+
class MaleoFoundationSHA256HashParametersTransfers:
|
4
|
+
class Hash(MaleoFoundationHashSchemas.Message): pass
|
5
5
|
|
6
6
|
class Verify(
|
7
|
-
|
8
|
-
|
7
|
+
MaleoFoundationHashSchemas.Hash,
|
8
|
+
MaleoFoundationHashSchemas.Message
|
9
9
|
): pass
|
@@ -1,7 +1,7 @@
|
|
1
1
|
from maleo_foundation.models.schemas.key import BaseKeySchemas
|
2
|
-
from maleo_foundation.models.transfers.general.key import
|
2
|
+
from maleo_foundation.models.transfers.general.key import MaleoFoundationKeyGeneralTransfers
|
3
3
|
|
4
|
-
class
|
4
|
+
class MaleoFoundationKeyParametersTransfers:
|
5
5
|
class CreatePrivateOrPair(
|
6
6
|
BaseKeySchemas.Password,
|
7
7
|
BaseKeySchemas.KeySize
|
@@ -9,5 +9,5 @@ class BaseKeyParametersTransfers:
|
|
9
9
|
|
10
10
|
class CreatePublic(
|
11
11
|
BaseKeySchemas.Password,
|
12
|
-
|
12
|
+
MaleoFoundationKeyGeneralTransfers.PrivateKey
|
13
13
|
): pass
|
@@ -1,14 +1,14 @@
|
|
1
|
-
from maleo_foundation.models.schemas.signature import
|
1
|
+
from maleo_foundation.models.schemas.signature import MaleoFoundationSignatureSchemas
|
2
2
|
|
3
|
-
class
|
3
|
+
class MaleoFoundationSignatureParametersTransfers:
|
4
4
|
class Sign(
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
MaleoFoundationSignatureSchemas.Message,
|
6
|
+
MaleoFoundationSignatureSchemas.Password,
|
7
|
+
MaleoFoundationSignatureSchemas.Key
|
8
8
|
): pass
|
9
9
|
|
10
10
|
class Verify(
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
MaleoFoundationSignatureSchemas.Signature,
|
12
|
+
MaleoFoundationSignatureSchemas.Message,
|
13
|
+
MaleoFoundationSignatureSchemas.Key
|
14
14
|
): pass
|
@@ -1,16 +1,16 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
from pydantic import Field
|
3
|
-
from maleo_foundation.models.schemas.token import
|
4
|
-
from maleo_foundation.models.transfers.general.token import
|
3
|
+
from maleo_foundation.models.schemas.token import MaleoFoundationTokenSchemas
|
4
|
+
from maleo_foundation.models.transfers.general.token import MaleoFoundationTokenGeneralTransfers
|
5
5
|
|
6
|
-
class
|
6
|
+
class MaleoFoundationTokenParametersTransfers:
|
7
7
|
class Encode(
|
8
|
-
|
9
|
-
|
8
|
+
MaleoFoundationTokenSchemas.Password,
|
9
|
+
MaleoFoundationTokenSchemas.Key
|
10
10
|
):
|
11
|
-
payload:
|
11
|
+
payload:MaleoFoundationTokenGeneralTransfers.BaseEncodePayload = Field(..., description="Encode payload")
|
12
12
|
|
13
13
|
class Decode(
|
14
|
-
|
15
|
-
|
14
|
+
MaleoFoundationTokenSchemas.Token,
|
15
|
+
MaleoFoundationTokenSchemas.Key
|
16
16
|
): pass
|
@@ -1,7 +1,7 @@
|
|
1
1
|
from __future__ import annotations
|
2
|
-
from .aes import
|
3
|
-
from .rsa import
|
2
|
+
from .aes import MaleoFoundationAESEncryptionResultsTransfers
|
3
|
+
from .rsa import MaleoFoundationRSAEncryptionResultsTransfers
|
4
4
|
|
5
5
|
class BaseEncryptionResultsTransfers:
|
6
|
-
AES =
|
7
|
-
RSA =
|
6
|
+
AES = MaleoFoundationAESEncryptionResultsTransfers
|
7
|
+
RSA = MaleoFoundationRSAEncryptionResultsTransfers
|
@@ -1,18 +1,18 @@
|
|
1
1
|
from pydantic import Field
|
2
2
|
from maleo_foundation.models.transfers.results.service.general import BaseServiceGeneralResultsTransfers
|
3
|
-
from maleo_foundation.models.schemas.encryption import
|
3
|
+
from maleo_foundation.models.schemas.encryption import MaleoFoundationEncryptionSchemas
|
4
4
|
|
5
5
|
class EncryptData(
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
MaleoFoundationEncryptionSchemas.Ciphertext,
|
7
|
+
MaleoFoundationEncryptionSchemas.InitializationVector,
|
8
|
+
MaleoFoundationEncryptionSchemas.Key
|
9
9
|
): pass
|
10
10
|
|
11
|
-
class
|
11
|
+
class MaleoFoundationAESEncryptionResultsTransfers:
|
12
12
|
class Fail(BaseServiceGeneralResultsTransfers.Fail): pass
|
13
13
|
|
14
14
|
class Encrypt(BaseServiceGeneralResultsTransfers.SingleData):
|
15
15
|
data:EncryptData = Field(..., description="Single encryption data")
|
16
16
|
|
17
17
|
class Decrypt(BaseServiceGeneralResultsTransfers.SingleData):
|
18
|
-
data:
|
18
|
+
data:MaleoFoundationEncryptionSchemas.Plaintext = Field(..., description="Single decryption data")
|
@@ -1,12 +1,12 @@
|
|
1
1
|
from pydantic import Field
|
2
2
|
from maleo_foundation.models.transfers.results.service.general import BaseServiceGeneralResultsTransfers
|
3
|
-
from maleo_foundation.models.schemas.encryption import
|
3
|
+
from maleo_foundation.models.schemas.encryption import MaleoFoundationEncryptionSchemas
|
4
4
|
|
5
|
-
class
|
5
|
+
class MaleoFoundationRSAEncryptionResultsTransfers:
|
6
6
|
class Fail(BaseServiceGeneralResultsTransfers.Fail): pass
|
7
7
|
|
8
8
|
class Encrypt(BaseServiceGeneralResultsTransfers.SingleData):
|
9
|
-
data:
|
9
|
+
data:MaleoFoundationEncryptionSchemas.Ciphertext = Field(..., description="Single encryption data")
|
10
10
|
|
11
11
|
class Decrypt(BaseServiceGeneralResultsTransfers.SingleData):
|
12
|
-
data:
|
12
|
+
data:MaleoFoundationEncryptionSchemas.Plaintext = Field(..., description="Single decryption data")
|
@@ -1,13 +1,13 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
from pydantic import Field
|
3
3
|
from maleo_foundation.models.transfers.results.service.general import BaseServiceGeneralResultsTransfers
|
4
|
-
from maleo_foundation.models.schemas.hash import
|
4
|
+
from maleo_foundation.models.schemas.hash import MaleoFoundationHashSchemas
|
5
5
|
|
6
|
-
class
|
6
|
+
class MaleoFoundationHashResultsTransfers:
|
7
7
|
class Fail(BaseServiceGeneralResultsTransfers.Fail): pass
|
8
8
|
|
9
9
|
class Hash(BaseServiceGeneralResultsTransfers.SingleData):
|
10
|
-
data:
|
10
|
+
data:MaleoFoundationHashSchemas.Hash = Field(..., description="Hash data")
|
11
11
|
|
12
12
|
class Verify(BaseServiceGeneralResultsTransfers.SingleData):
|
13
|
-
data:
|
13
|
+
data:MaleoFoundationHashSchemas.IsValid = Field(..., description="Verify data")
|
@@ -1,16 +1,16 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
from pydantic import Field
|
3
3
|
from maleo_foundation.models.transfers.results.service.general import BaseServiceGeneralResultsTransfers
|
4
|
-
from maleo_foundation.models.transfers.general.key import
|
4
|
+
from maleo_foundation.models.transfers.general.key import MaleoFoundationKeyGeneralTransfers
|
5
5
|
|
6
|
-
class
|
6
|
+
class MaleoFoundationKeyResultsTransfers:
|
7
7
|
class Fail(BaseServiceGeneralResultsTransfers.Fail): pass
|
8
8
|
|
9
9
|
class CreatePrivate(BaseServiceGeneralResultsTransfers.SingleData):
|
10
|
-
data:
|
10
|
+
data:MaleoFoundationKeyGeneralTransfers.PrivateKey = Field(..., description="Private key data")
|
11
11
|
|
12
12
|
class CreatePublic(BaseServiceGeneralResultsTransfers.SingleData):
|
13
|
-
data:
|
13
|
+
data:MaleoFoundationKeyGeneralTransfers.PublicKey = Field(..., description="Private key data")
|
14
14
|
|
15
15
|
class CreatePair(BaseServiceGeneralResultsTransfers.SingleData):
|
16
|
-
data:
|
16
|
+
data:MaleoFoundationKeyGeneralTransfers.KeyPair = Field(..., description="Key pair data")
|
@@ -1,12 +1,12 @@
|
|
1
1
|
from pydantic import Field
|
2
2
|
from maleo_foundation.models.transfers.results.service.general import BaseServiceGeneralResultsTransfers
|
3
|
-
from maleo_foundation.models.schemas.signature import
|
3
|
+
from maleo_foundation.models.schemas.signature import MaleoFoundationSignatureSchemas
|
4
4
|
|
5
|
-
class
|
5
|
+
class MaleoFoundationSignatureResultsTransfers:
|
6
6
|
class Fail(BaseServiceGeneralResultsTransfers.Fail): pass
|
7
7
|
|
8
8
|
class Sign(BaseServiceGeneralResultsTransfers.SingleData):
|
9
|
-
data:
|
9
|
+
data:MaleoFoundationSignatureSchemas.Signature = Field(..., description="Single signature data")
|
10
10
|
|
11
11
|
class Verify(BaseServiceGeneralResultsTransfers.SingleData):
|
12
|
-
data:
|
12
|
+
data:MaleoFoundationSignatureSchemas.IsValid = Field(..., description="Single verify data")
|
@@ -1,12 +1,12 @@
|
|
1
1
|
from maleo_foundation.models.transfers.results.service.general import BaseServiceGeneralResultsTransfers
|
2
|
-
from maleo_foundation.models.schemas.token import
|
3
|
-
from maleo_foundation.models.transfers.general.token import
|
2
|
+
from maleo_foundation.models.schemas.token import MaleoFoundationTokenSchemas
|
3
|
+
from maleo_foundation.models.transfers.general.token import MaleoFoundationTokenGeneralTransfers
|
4
4
|
|
5
|
-
class
|
5
|
+
class MaleoFoundationTokenResultsTransfers:
|
6
6
|
class Fail(BaseServiceGeneralResultsTransfers.Fail): pass
|
7
7
|
|
8
8
|
class Encode(BaseServiceGeneralResultsTransfers.SingleData):
|
9
|
-
data:
|
9
|
+
data:MaleoFoundationTokenSchemas.Token
|
10
10
|
|
11
11
|
class Decode(BaseServiceGeneralResultsTransfers.SingleData):
|
12
|
-
data:
|
12
|
+
data:MaleoFoundationTokenGeneralTransfers.DecodePayload
|