aws-python-helper 1.15.0__tar.gz → 1.15.2__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.
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/PKG-INFO +1 -1
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/model_query/base.py +5 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/settings.py +5 -1
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper.egg-info/PKG-INFO +1 -1
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper.egg-info/SOURCES.txt +1 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/pyproject.toml +1 -1
- aws_python_helper-1.15.2/tests/test_model_query_schema.py +57 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/README.md +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/__init__.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/api/__init__.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/api/auth_middleware.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/api/auth_validators.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/api/base.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/api/dispatcher.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/api/exceptions.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/api/fetcher.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/api/handler.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/api/jwt_keys.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/context/__init__.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/context/session.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/context/state_validator.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/database/__init__.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/database/database_proxy.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/database/external_database_proxy.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/database/external_mongo_manager.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/database/mongo_manager.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/fargate/__init__.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/fargate/executor.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/fargate/fetcher.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/fargate/handler.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/fargate/task_base.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/invoker/__init__.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/invoker/api_client.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/invoker/exceptions.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/invoker/lambda_invoker.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/lambda_standalone/__init__.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/lambda_standalone/base.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/lambda_standalone/fetcher.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/lambda_standalone/handler.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/model_index_sync/__init__.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/model_index_sync/base.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/model_query/__init__.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/monitoring/__init__.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/monitoring/run.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/permissions/__init__.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/permissions/catalog.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/repository/__init__.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/repository/audit.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/repository/base.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/sns/__init__.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/sns/publisher.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/sqs/__init__.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/sqs/consumer_base.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/sqs/fetcher.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/sqs/handler.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/utils/__init__.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/utils/json_encoder.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/utils/response.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/utils/serializer.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper.egg-info/dependency_links.txt +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper.egg-info/requires.txt +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper.egg-info/top_level.txt +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/setup.cfg +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/tests/test_audit_stamp.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/tests/test_jwt_keys.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/tests/test_settings.py +0 -0
- {aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/tests/test_sns_publisher.py +0 -0
|
@@ -92,6 +92,11 @@ class _ModelQuerySchema(BaseModel):
|
|
|
92
92
|
# y `extra="ignore"` la descartaba en silencio: la consulta terminaba en la
|
|
93
93
|
# base del estado de la sesión y devolvía vacío sin error.
|
|
94
94
|
database: Optional[str] = None
|
|
95
|
+
# Quién pregunta. Lo usa el servicio que expone esta lambda para recortar lo
|
|
96
|
+
# que devuelve a lo que le corresponde a ese servicio. Declarado por la
|
|
97
|
+
# misma razón que `database`: sin esto `extra="ignore"` lo descarta y el
|
|
98
|
+
# recorte se hace contra un servicio vacío, que es "nada".
|
|
99
|
+
service: Optional[str] = None
|
|
95
100
|
filter: Optional[dict] = None
|
|
96
101
|
pipeline: Optional[list] = None
|
|
97
102
|
fields: Optional[dict] = None
|
|
@@ -31,7 +31,11 @@ from typing import Any, Dict, List, Optional
|
|
|
31
31
|
|
|
32
32
|
logger = logging.getLogger(__name__)
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
# Un solo segmento, y no `/services/settings`, porque para GET el fetcher
|
|
35
|
+
# decide por posición: con dos segmentos el segundo es siempre un id, así que
|
|
36
|
+
# buscaba `api/services/get.py` y devolvía 404. Un sub-recurso GET no existe en
|
|
37
|
+
# esta convención.
|
|
38
|
+
PATH = "/service-settings"
|
|
35
39
|
TIMEOUT_SECONDS = 5
|
|
36
40
|
# Si core no contestó, no se vuelve a preguntar en cada request.
|
|
37
41
|
RETRY_FLOOR_SECONDS = 60
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"""Lo que el payload manda llega al código, o se pierde en silencio.
|
|
2
|
+
|
|
3
|
+
El schema usa `extra="ignore"`, así que un parámetro que no esté declarado
|
|
4
|
+
**desaparece sin error**. Ya pasó dos veces: `database` hacía que la consulta
|
|
5
|
+
fuera a la base equivocada y devolviera vacío, y `service` hacía que el recorte
|
|
6
|
+
por servicio se midiera contra uno vacío y no saliera nada.
|
|
7
|
+
|
|
8
|
+
Las dos veces el síntoma fue el mismo: todo "funciona", la respuesta es 200, y
|
|
9
|
+
lo que falta es justo lo que se pidió.
|
|
10
|
+
|
|
11
|
+
Correr con un intérprete que tenga las dependencias del paquete:
|
|
12
|
+
../constitution-core/venv/bin/python tests/test_model_query_schema.py
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
import os
|
|
16
|
+
import sys
|
|
17
|
+
|
|
18
|
+
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|
19
|
+
|
|
20
|
+
from aws_python_helper.model_query.base import _ModelQuerySchema
|
|
21
|
+
|
|
22
|
+
failures = []
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def check(label, condition):
|
|
26
|
+
print(f" {'ok ' if condition else 'FALLA'} {label}")
|
|
27
|
+
if not condition:
|
|
28
|
+
failures.append(label)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
print("== cada parámetro documentado sobrevive al schema ==")
|
|
32
|
+
parsed = _ModelQuerySchema(
|
|
33
|
+
collection="regions",
|
|
34
|
+
database="core",
|
|
35
|
+
service="dockets",
|
|
36
|
+
pipeline=[{"$match": {"slug": "x"}}],
|
|
37
|
+
skip=10,
|
|
38
|
+
)
|
|
39
|
+
for campo, esperado in (
|
|
40
|
+
("collection", "regions"),
|
|
41
|
+
("database", "core"),
|
|
42
|
+
("service", "dockets"),
|
|
43
|
+
("skip", 10),
|
|
44
|
+
):
|
|
45
|
+
check(f"{campo} = {esperado!r}", getattr(parsed, campo) == esperado)
|
|
46
|
+
|
|
47
|
+
print("\n== y lo que no está declarado sí se descarta ==")
|
|
48
|
+
# Es el comportamiento buscado: lo que sobra se ignora. El problema nunca fue
|
|
49
|
+
# que ignore, sino declarar de menos.
|
|
50
|
+
otro = _ModelQuerySchema(collection="regions", inventado="x")
|
|
51
|
+
check("un parámetro inventado no explota", not hasattr(otro, "inventado"))
|
|
52
|
+
|
|
53
|
+
print()
|
|
54
|
+
if failures:
|
|
55
|
+
print(f"{len(failures)} fallas")
|
|
56
|
+
sys.exit(1)
|
|
57
|
+
print("all good")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/api/auth_middleware.py
RENAMED
|
File without changes
|
{aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/api/auth_validators.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
|
{aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/context/state_validator.py
RENAMED
|
File without changes
|
{aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/database/__init__.py
RENAMED
|
File without changes
|
{aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/database/database_proxy.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/database/mongo_manager.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/fargate/task_base.py
RENAMED
|
File without changes
|
|
File without changes
|
{aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/invoker/api_client.py
RENAMED
|
File without changes
|
{aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/invoker/exceptions.py
RENAMED
|
File without changes
|
{aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/invoker/lambda_invoker.py
RENAMED
|
File without changes
|
|
File without changes
|
{aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/lambda_standalone/base.py
RENAMED
|
File without changes
|
{aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/lambda_standalone/fetcher.py
RENAMED
|
File without changes
|
{aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/lambda_standalone/handler.py
RENAMED
|
File without changes
|
{aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/model_index_sync/__init__.py
RENAMED
|
File without changes
|
{aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/model_index_sync/base.py
RENAMED
|
File without changes
|
{aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/model_query/__init__.py
RENAMED
|
File without changes
|
{aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/monitoring/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/permissions/__init__.py
RENAMED
|
File without changes
|
{aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/permissions/catalog.py
RENAMED
|
File without changes
|
{aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/repository/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/sqs/consumer_base.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper/utils/json_encoder.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper.egg-info/requires.txt
RENAMED
|
File without changes
|
{aws_python_helper-1.15.0 → aws_python_helper-1.15.2}/aws_python_helper.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|