From 7460465f812d874e667e758a47543e64fd84b570 Mon Sep 17 00:00:00 2001 From: Gabriel Felipe Souza Santos Date: Tue, 27 Oct 2026 20:53:09 -0300 Subject: [PATCH] =?UTF-8?q?test(docs):=20ErrorCodeTest=20e=20notas=20de=20?= =?UTF-8?q?seguran=C3=A7a=20em=20plugins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fecha etapas 9–10 do refinamento; engineering_backlog alinhado. Co-authored-by: Cursor --- docs/documentation/09_sistema_de_plugins.md | 6 ++++++ docs/documentation/engineering_backlog.md | 7 ++++--- pitiupi/test/pitiupi/errors/ErrorCodeTest.java | 18 ++++++++++++++++++ 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 pitiupi/test/pitiupi/errors/ErrorCodeTest.java diff --git a/docs/documentation/09_sistema_de_plugins.md b/docs/documentation/09_sistema_de_plugins.md index 8f440fd..a89016e 100644 --- a/docs/documentation/09_sistema_de_plugins.md +++ b/docs/documentation/09_sistema_de_plugins.md @@ -82,6 +82,12 @@ Na `MainShellFrame`, `createPlugin(ConnectionManager, PluginWorkspace)` registra Em abas de **recebimento** (ex. screencast `view:`), `PluginRoutingPanel.bindReceiveSession` deixa IP e forma de envio somente leitura, refletindo o que o remetente usou. +## Segurança e plugins externos (aula) + +- Instale apenas JARs de fontes confiáveis (`PITIUPI_HOME/plugins` ou aba Configurações). +- O núcleo desserializa mensagens de rede com classloader por plugin; mensagens malformadas devem ser ignoradas, mas **não** há sandbox — um JAR malicioso tem o mesmo poder de um programa local. +- Não há atualização automática de plugins pelo núcleo na v1. + ### Avisos de sessão (D24) `SessionNoticeMessage` (núcleo) sinaliza fases `START` / `END` por `pluginId` e canal (`SessionNoticeChannel`, ex. `screen_cast`). Plugins registram o tipo em `getMessages()` e reagem na UI (ex. fechar aba de recebimento ao `END` de compartilhamento). Campos incluem remetente, escopo (broadcast/direto) e `TransportMode` observado. diff --git a/docs/documentation/engineering_backlog.md b/docs/documentation/engineering_backlog.md index a2c62b3..e796b0f 100644 --- a/docs/documentation/engineering_backlog.md +++ b/docs/documentation/engineering_backlog.md @@ -2,10 +2,11 @@ | Item | Prioridade | Notas | | --- | --- | --- | -| Testes JUnit para desserialização e framing TCP | Média | Sem rede real | +| Testes JUnit framing TCP com socket mock | Média | Rede real coberta manualmente na LAN | | CI (GitHub Actions) com `ant jar` + `ant test` | Baixa | Requer imagem com Ant/JDK | -| Captura de tela nativa no WSL | Baixa | Limitação de ambiente; validar em Windows/Linux com display | +| REQ-11 badges na lista lateral | Baixa | D23 — ver `decision-register.md` | +| Automação GUI 2 instâncias / 2 PCs | Baixa | Limitação Swing; aceite manual | -Itens concluídos recentemente: shell com abas e peer actions (D16–D18); chat unificado (D19); docs alinhadas à shell v1 (Onda G); suíte JUnit no núcleo (`ant test`); tutorial Ping em [17_tutorial_ping_aula.md](17_tutorial_ping_aula.md). +**Concluído (refinamento v1):** shell abas + peer actions; SPI `PluginWorkspace`; suíte JUnit no núcleo; tutorial Ping; deploy LAN documentado no repositório de desenvolvimento do mantenedor (fora deste clone). Ao fechar um item, atualizar esta tabela e o doc técnico relacionado. diff --git a/pitiupi/test/pitiupi/errors/ErrorCodeTest.java b/pitiupi/test/pitiupi/errors/ErrorCodeTest.java new file mode 100644 index 0000000..0cc3330 --- /dev/null +++ b/pitiupi/test/pitiupi/errors/ErrorCodeTest.java @@ -0,0 +1,18 @@ +package pitiupi.errors; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class ErrorCodeTest { + + @Test + void userMessagesInPortuguese() { + for (ErrorCode code : ErrorCode.values()) { + String msg = code.getUserMessage(); + assertFalse(msg.isBlank()); + assertTrue(msg.length() > 5); + } + } +}