Encryptors 2.33__tar.gz → 2.35__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.
- {encryptors-2.33 → encryptors-2.35}/PKG-INFO +1 -1
- {encryptors-2.33 → encryptors-2.35}/setup.py +1 -1
- {encryptors-2.33 → encryptors-2.35}/src/Encryptors.egg-info/PKG-INFO +1 -1
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Graphql/Extensions/AuditExtension.py +13 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Helpers/AuditDispatcher.py +1 -1
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Http/APIClient.py +4 -2
- encryptors-2.35/src/Osdental/Models/_Audit.py +14 -0
- encryptors-2.33/src/Osdental/Models/_Audit.py +0 -13
- {encryptors-2.33 → encryptors-2.35}/README.md +0 -0
- {encryptors-2.33 → encryptors-2.35}/setup.cfg +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Encryptors.egg-info/SOURCES.txt +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Encryptors.egg-info/dependency_links.txt +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Encryptors.egg-info/entry_points.txt +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Encryptors.egg-info/requires.txt +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Encryptors.egg-info/top_level.txt +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Cli/__init__.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Database/BaseRepository.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Database/Connection.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Database/__init__.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Decorators/Grpc.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Decorators/Retry.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Decorators/SecureResolver.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Decorators/SqlDataNormalizer.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Decorators/__init__.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Encryptor/Aes.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Encryptor/Argon2.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Encryptor/Bcrypt.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Encryptor/Jwt.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Encryptor/Rsa.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Encryptor/Sha512.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Encryptor/__init__.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Exception/ControlledException.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Exception/__init__.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Graphql/Extensions/__init__.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Graphql/_Exceptions/__init__.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Graphql/_Helpers/_AuditHelper.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Graphql/_Helpers/_ExtractAuthToken.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Graphql/_Helpers/_TenantPolicy.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Graphql/_Helpers/_TokenService.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Graphql/_Helpers/__init__.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Graphql/__init__.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Helpers/KeyVaultService.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Helpers/__init__.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Http/_Exceptions.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Http/__init__.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Messaging/AzureServiceBus.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Messaging/Kafka.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Messaging/RabbitMQ.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Messaging/__init__.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Models/AuditConfig.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Models/Catalog.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Models/Legacy.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Models/Response.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Models/Token.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Models/__init__.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/RedisCache/Redis.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/RedisCache/__init__.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Rest/Context/RequestContext.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Rest/Context/__init__.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Rest/Middlewares/RequestContextMiddleware.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Rest/Middlewares/__init__.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Rest/__init__.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Shared/Enums/Code.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Shared/Enums/Constant.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Shared/Enums/FileType.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Shared/Enums/GrahpqlOperation.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Shared/Enums/Message.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Shared/Enums/Profile.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Shared/Enums/__init__.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Shared/Logger.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Shared/Utils/CaseConverter.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Shared/Utils/CodeGenerator.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Shared/Utils/DataNormalizer.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Shared/Utils/DataUtils.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Shared/Utils/DateUtils.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Shared/Utils/FileMetaData.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Shared/Utils/HashValidator.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Shared/Utils/Mapper.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Shared/Utils/PasswordGenerator.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Shared/Utils/QueryGenerator.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Shared/Utils/TextProcessor.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Shared/Utils/__init__.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Shared/__init__.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Storage/AzureBlobStorage.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Storage/S3Storage.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/Storage/__init__.py +0 -0
- {encryptors-2.33 → encryptors-2.35}/src/Osdental/__init__.py +0 -0
|
@@ -3,12 +3,25 @@ from graphql.pyutils import is_awaitable
|
|
|
3
3
|
from ariadne.types import Extension
|
|
4
4
|
from Osdental.Encryptor.Aes import AES
|
|
5
5
|
from Osdental.Graphql._Helpers._TenantPolicy import TenantPolicy
|
|
6
|
+
from Osdental.Rest.Context.RequestContext import (
|
|
7
|
+
current_context,
|
|
8
|
+
RequestContext
|
|
9
|
+
)
|
|
6
10
|
from Osdental.Graphql._Exceptions import AESKeyNotFound
|
|
7
11
|
from Osdental.Shared.Enums.Constant import Constant
|
|
8
12
|
|
|
9
13
|
class AuditExtension(Extension):
|
|
10
14
|
|
|
11
15
|
def request_started(self, context):
|
|
16
|
+
request = context.request
|
|
17
|
+
self._ctx_token = current_context.set(
|
|
18
|
+
RequestContext(
|
|
19
|
+
request=request,
|
|
20
|
+
request_id=request.headers.get("x-request-id"),
|
|
21
|
+
user=None
|
|
22
|
+
)
|
|
23
|
+
)
|
|
24
|
+
|
|
12
25
|
self.errors = None
|
|
13
26
|
self.request_payload = None
|
|
14
27
|
self.result = None
|
|
@@ -87,7 +87,7 @@ class AuditDispatcher:
|
|
|
87
87
|
request=request,
|
|
88
88
|
audit_config=self._audit_config,
|
|
89
89
|
operation_name=operation_name,
|
|
90
|
-
full_name=request_payload.get("user"),
|
|
90
|
+
full_name=request_payload.get("user", "Joe Doe"),
|
|
91
91
|
payload=request_payload.get("variables")
|
|
92
92
|
)
|
|
93
93
|
request_audit_payload = await AuditHelper.build_request_payload(audit=audit)
|
|
@@ -37,9 +37,11 @@ class APIClient:
|
|
|
37
37
|
**kwargs
|
|
38
38
|
)
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
ctx = current_context.get()
|
|
41
|
+
|
|
42
|
+
if ctx and ctx.request:
|
|
43
|
+
request = ctx.request
|
|
41
44
|
|
|
42
|
-
if request:
|
|
43
45
|
dispatcher = request.app.state.audit_dispatcher
|
|
44
46
|
dispatcher.dispatch(
|
|
45
47
|
request=request,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
from dataclasses import dataclass, field
|
|
2
|
+
from typing import Any, Optional
|
|
3
|
+
from fastapi import Request
|
|
4
|
+
from Osdental.Models.AuditConfig import AuditConfig
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@dataclass
|
|
8
|
+
class Audit:
|
|
9
|
+
request: Request
|
|
10
|
+
audit_config: AuditConfig
|
|
11
|
+
payload: Any = field(default_factory=dict)
|
|
12
|
+
audit_type: str = field(default="MESSAGE_LOG_INTERNAL")
|
|
13
|
+
operation_name: Optional[str] = "Unknown"
|
|
14
|
+
full_name: Optional[str] = "Joe Doe"
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
from dataclasses import dataclass
|
|
2
|
-
from typing import Literal, Any, Optional
|
|
3
|
-
from fastapi import Request
|
|
4
|
-
from Osdental.Models.AuditConfig import AuditConfig
|
|
5
|
-
|
|
6
|
-
@dataclass
|
|
7
|
-
class Audit:
|
|
8
|
-
request: Request
|
|
9
|
-
audit_config: AuditConfig
|
|
10
|
-
payload: Any = {}
|
|
11
|
-
audit_type: Literal["MESSAGE_LOG_INTERNAL", "MESSAGE_LOG_EXTERNAL"] = "MESSAGE_LOG_INTERNAL"
|
|
12
|
-
operation_name: Optional[str] = "Unknown"
|
|
13
|
-
full_name: Optional[str] = "Joe Doe"
|
|
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
|
|
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
|
{encryptors-2.33 → encryptors-2.35}/src/Osdental/Rest/Middlewares/RequestContextMiddleware.py
RENAMED
|
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
|