argos-cli 0.3.1__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.
- argos/__init__.py +5 -0
- argos/__main__.py +4 -0
- argos/adapters/__init__.py +9 -0
- argos/adapters/_libreoffice_worker.py +111 -0
- argos/adapters/ai.py +1506 -0
- argos/adapters/ai_remote.py +654 -0
- argos/adapters/attachment_conversion.py +132 -0
- argos/adapters/capabilities.py +31 -0
- argos/adapters/chart_render.py +72 -0
- argos/adapters/docx_pdf.py +2953 -0
- argos/adapters/limesurvey.py +1079 -0
- argos/adapters/model_call.py +274 -0
- argos/adapters/report_publication.py +1530 -0
- argos/adapters/url_fetch.py +146 -0
- argos/adapters/xlsx.py +454 -0
- argos/analytics.py +731 -0
- argos/assets.py +257 -0
- argos/audit_result.py +369 -0
- argos/booleans.py +105 -0
- argos/catalog.py +1205 -0
- argos/cli.py +606 -0
- argos/contracts.py +532 -0
- argos/core.py +325 -0
- argos/default_skills/README.md +23 -0
- argos/default_skills/criar-matriz-planejamento/SKILL.md +200 -0
- argos/default_skills/elaborar-survey-limesurvey/SKILL.md +106 -0
- argos/default_skills/operar-argos/SKILL.md +74 -0
- argos/default_skills/verificar-diretrizes-fiscalizacao/SKILL.md +129 -0
- argos/default_skills/verificar-diretrizes-fiscalizacao/assets/relatorio-avaliacao.md +54 -0
- argos/default_skills/verificar-diretrizes-fiscalizacao/references/contrato-saidas.md +36 -0
- argos/default_skills/verificar-diretrizes-fiscalizacao/references/papeis-das-pastas.md +37 -0
- argos/default_skills/verificar-diretrizes-fiscalizacao/references/roteiro-verificacoes.md +27 -0
- argos/default_skills/verificar-diretrizes-fiscalizacao/scripts/avaliacao.py +253 -0
- argos/engines/__init__.py +3 -0
- argos/engines/adjustments.py +571 -0
- argos/engines/analytics.py +195 -0
- argos/engines/audit.py +2730 -0
- argos/engines/evaluation.py +6088 -0
- argos/engines/index.py +1683 -0
- argos/engines/matrix.py +5736 -0
- argos/engines/matrix_html.py +698 -0
- argos/engines/model_request.py +201 -0
- argos/engines/report_document.py +137 -0
- argos/engines/reports.py +1200 -0
- argos/engines/survey.py +4445 -0
- argos/envfile.py +53 -0
- argos/errors.py +29 -0
- argos/evidence_staging.py +293 -0
- argos/executions.py +565 -0
- argos/findings_matrix.py +2549 -0
- argos/fingerprints.py +487 -0
- argos/index_dsl.py +2100 -0
- argos/matrix_markdown.py +475 -0
- argos/matrix_widths.py +280 -0
- argos/pipeline.py +1745 -0
- argos/products.py +220 -0
- argos/progress.py +221 -0
- argos/project.py +608 -0
- argos/report_config.py +158 -0
- argos/resources/ESPECIFICACAO_MARKDOWN_MATRIZ_ACHADOS.md +539 -0
- argos/resources/ESPECIFICACAO_MARKDOWN_MATRIZ_PLANEJAMENTO.md +1000 -0
- argos/resources/ESPECIFICACAO_UNIFICADA_MATRIZES_V1_3.md +1142 -0
- argos/resources/anexo-evidencias-base.docx +0 -0
- argos/resources/argos-index-dsl-v1.schema.json +539 -0
- argos/resources/argos-report-config-v1.schema.json +113 -0
- argos/resources/diretrizes-projeto.md +476 -0
- argos/resources/env.example +37 -0
- argos/resources/exemplos/matriz_achados_boilerplate.md +61 -0
- argos/resources/exemplos/matriz_achados_draft.md +106 -0
- argos/resources/exemplos/matriz_achados_larguras_v1_3.md +114 -0
- argos/resources/exemplos/matriz_achados_v1_3.md +107 -0
- argos/resources/exemplos/matriz_planejamento_boilerplate.md +64 -0
- argos/resources/exemplos/matriz_planejamento_larguras_v1_3.md +115 -0
- argos/resources/exemplos/matriz_planejamento_v1_3.md +108 -0
- argos/resources/template-base-estilos-sigiloso.docx +0 -0
- argos/resources/template-base-estilos.docx +0 -0
- argos/resources/template-matriz-planejamento.docx +0 -0
- argos/resources/template-relatorio-consolidado-comum.docx +0 -0
- argos/resources/template-relatorio-consolidado-institucional.docx +0 -0
- argos/response_profiles.py +856 -0
- argos/scheduler.py +142 -0
- argos/status.py +367 -0
- argos/store.py +1228 -0
- argos/survey_collection.py +832 -0
- argos/telemetry.py +84 -0
- argos/tui.py +1262 -0
- argos/tui.tcss +827 -0
- argos/tui_models.py +466 -0
- argos/tui_path.py +155 -0
- argos/tui_widgets.py +482 -0
- argos/version.py +3 -0
- argos_cli-0.3.1.dist-info/METADATA +570 -0
- argos_cli-0.3.1.dist-info/RECORD +96 -0
- argos_cli-0.3.1.dist-info/WHEEL +5 -0
- argos_cli-0.3.1.dist-info/entry_points.txt +2 -0
- argos_cli-0.3.1.dist-info/top_level.txt +1 -0
argos/telemetry.py
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"""Saneamento de telemetria nova; não modifica acervos de origem."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
import re
|
|
7
|
+
from collections.abc import Mapping
|
|
8
|
+
from typing import Any
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
_FIELDS = {
|
|
12
|
+
"api_key",
|
|
13
|
+
"apikey",
|
|
14
|
+
"authorization",
|
|
15
|
+
"cookie",
|
|
16
|
+
"cookies",
|
|
17
|
+
"phpsessid",
|
|
18
|
+
"yii_csrf_token",
|
|
19
|
+
"csrf_token",
|
|
20
|
+
"access_token",
|
|
21
|
+
"refresh_token",
|
|
22
|
+
"session_token",
|
|
23
|
+
"password",
|
|
24
|
+
"secret",
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def _environment_secrets() -> tuple[str, ...]:
|
|
29
|
+
values: set[str] = set()
|
|
30
|
+
for name, raw in os.environ.items():
|
|
31
|
+
normalized_name = name.upper()
|
|
32
|
+
if not (
|
|
33
|
+
normalized_name.endswith(("_API_KEY", "_SECRET", "_TOKEN", "_COOKIE"))
|
|
34
|
+
or normalized_name in {"LIMESURVEY_PHPSESSID", "LIMESURVEY_COOKIE"}
|
|
35
|
+
):
|
|
36
|
+
continue
|
|
37
|
+
if not raw:
|
|
38
|
+
continue
|
|
39
|
+
values.add(raw)
|
|
40
|
+
values.update(part.strip() for part in raw.split(",") if part.strip())
|
|
41
|
+
if normalized_name.endswith("_COOKIE"):
|
|
42
|
+
values.update(
|
|
43
|
+
part.partition("=")[2].strip()
|
|
44
|
+
for part in raw.split(";")
|
|
45
|
+
if "=" in part and part.partition("=")[2].strip()
|
|
46
|
+
)
|
|
47
|
+
return tuple(sorted(values, key=len, reverse=True))
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def _sensitive_field(key: Any) -> bool:
|
|
51
|
+
normalized = re.sub(r"[^a-z0-9]+", "_", str(key).casefold()).strip("_")
|
|
52
|
+
return normalized in _FIELDS or normalized.endswith(
|
|
53
|
+
("_api_key", "_secret", "_token", "_cookie", "_password")
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def redact_error(value: str | None) -> str | None:
|
|
58
|
+
if value is None:
|
|
59
|
+
return None
|
|
60
|
+
result = str(value)
|
|
61
|
+
for secret in _environment_secrets():
|
|
62
|
+
result = result.replace(secret, "[REDACTED]")
|
|
63
|
+
return result
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def redact_payload(value: Any) -> Any:
|
|
67
|
+
if isinstance(value, Mapping):
|
|
68
|
+
return {
|
|
69
|
+
str(key): "[REDACTED]" if _sensitive_field(key) else redact_payload(item)
|
|
70
|
+
for key, item in value.items()
|
|
71
|
+
}
|
|
72
|
+
if isinstance(value, (list, tuple)):
|
|
73
|
+
return [redact_payload(item) for item in value]
|
|
74
|
+
if isinstance(value, str):
|
|
75
|
+
# Campos de domínio não são credenciais. Só substituímos valores
|
|
76
|
+
# reconhecíveis em texto livre; erros usam a regra estrita acima.
|
|
77
|
+
result = value
|
|
78
|
+
for secret in _environment_secrets():
|
|
79
|
+
if len(secret) >= 4:
|
|
80
|
+
result = result.replace(secret, "[REDACTED]")
|
|
81
|
+
elif result == secret:
|
|
82
|
+
result = "[REDACTED]"
|
|
83
|
+
return result
|
|
84
|
+
return value
|