diff --git a/README.md b/README.md index 873c908..db283c3 100644 --- a/README.md +++ b/README.md @@ -8,21 +8,53 @@ A document explaining v0.1.0 can be found in the [docs](docs) directory. This cu ## Running -To set a specific port when running: +After cloning or downloading this repository, you can use the included gradlew wrapper file to build it: ```sh -java -Dserver.port=8888 -jar target/api-0.1.0-SNAPSHOT.jar +./gradlew build +``` + +If you have Gradle locally installed, `gradle build` will work as well. + +This will build Java `.jar` files in the `build/libs` directory. + +Once built, you can start the server using: + +```sh +java -jar target/mirante-spring-.jar +``` + +Replace `` with the current version. + +HTML forms meant as a minimal working front-end are available under `src/web/`. Given default port `8080` is usually in use, the forms send requests to port 8888 instead. + +To use them, set port 8888 when running: + +```sh +java -Dserver.port=8888 -jar target/mirante-spring-.jar ``` ## Development -If you have [Nix](https://nixos.org/manual/nix/stable/introduction) available on your system, you can use the flake file to setup a development environment with JDK 21 and Gradle using `nix develop`. +Gradle is used to resolve dependencies and build this project. You can use the included wrapper or [install Gradle locally](https://gradle.org/install/). + +To build and run the server: + +```sh +gradle bootRun +``` + +To build only: + +```sh +gradle build +``` + +To see all available options: + +```sh +gradle tasks +``` -### Code analysis tools for review +If you have [Nix](https://nixos.org/manual/nix/stable/introduction) available on your system and flake support enabled, you can use the flake file to setup a development environment with JDK 21 and Gradle using `nix develop`. -- [dependency-check](http://jeremylong.github.io/DependencyCheck) -- [renovate](https://github.com/renovatebot/renovate) -- [SpotBugs](https://spotbugs.readthedocs.io/) -- [Error Prone](https://errorprone.info/) -- [NullAway](https://github.com/uber/NullAway) -- [Infer](https://fbinfer.com/docs/getting-started/) diff --git a/build.gradle.kts b/build.gradle.kts index abe5581..49d42c3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,7 +6,7 @@ plugins { } group = "dev.jutty.mirante.server" -version = "0.1.1-SNAPSHOT" +version = "0.1.2-SNAPSHOT" java { sourceCompatibility = JavaVersion.VERSION_17 diff --git a/docs/roadmap.md b/docs/roadmap.md index 5b07482..659cfcf 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -7,13 +7,22 @@ - - -## 0.5.0 -- Duplicar um conjunto para derivar outro +## 0.5.0 +- Análise de código automatizada + - [dependency-check](http://jeremylong.github.io/DependencyCheck) + - [renovate](https://github.com/renovatebot/renovate) + - [SpotBugs](https://spotbugs.readthedocs.io/) + - [Error Prone](https://errorprone.info/) + - [NullAway](https://github.com/uber/NullAway) + - [Infer](https://fbinfer.com/docs/getting-started/) ## 0.6.0 -- Deduplicação de questões +- Duplicar um conjunto para derivar outro ## 0.7.0 +- Deduplicação de questões + +## 0.8.0 - Dificuldade (manual e pela porcentagem de acertos) - da questão - do conjunto @@ -21,5 +30,5 @@ - da questão - do conjunto -## 0.8.0 +## 0.9.0 - Repetição espaçada diff --git a/docs/img/class-account.png b/docs/v0.1.1/img/class-account.png similarity index 100% rename from docs/img/class-account.png rename to docs/v0.1.1/img/class-account.png diff --git a/docs/img/class-account.puml b/docs/v0.1.1/img/class-account.puml similarity index 100% rename from docs/img/class-account.puml rename to docs/v0.1.1/img/class-account.puml diff --git a/docs/img/class-event.png b/docs/v0.1.1/img/class-event.png similarity index 100% rename from docs/img/class-event.png rename to docs/v0.1.1/img/class-event.png diff --git a/docs/img/class-event.puml b/docs/v0.1.1/img/class-event.puml similarity index 100% rename from docs/img/class-event.puml rename to docs/v0.1.1/img/class-event.puml diff --git a/docs/img/class-exercise.png b/docs/v0.1.1/img/class-exercise.png similarity index 100% rename from docs/img/class-exercise.png rename to docs/v0.1.1/img/class-exercise.png diff --git a/docs/img/class-exercise.puml b/docs/v0.1.1/img/class-exercise.puml similarity index 100% rename from docs/img/class-exercise.puml rename to docs/v0.1.1/img/class-exercise.puml diff --git a/docs/img/class.png b/docs/v0.1.1/img/class.png similarity index 100% rename from docs/img/class.png rename to docs/v0.1.1/img/class.png diff --git a/docs/img/class.puml b/docs/v0.1.1/img/class.puml similarity index 100% rename from docs/img/class.puml rename to docs/v0.1.1/img/class.puml diff --git a/docs/img/events-database-view.png b/docs/v0.1.1/img/events-database-view.png similarity index 100% rename from docs/img/events-database-view.png rename to docs/v0.1.1/img/events-database-view.png diff --git a/docs/img/interfaces-map.png b/docs/v0.1.1/img/interfaces-map.png similarity index 100% rename from docs/img/interfaces-map.png rename to docs/v0.1.1/img/interfaces-map.png diff --git a/docs/img/sequence-system.png b/docs/v0.1.1/img/sequence-system.png similarity index 100% rename from docs/img/sequence-system.png rename to docs/v0.1.1/img/sequence-system.png diff --git a/docs/img/sequence-system.puml b/docs/v0.1.1/img/sequence-system.puml similarity index 100% rename from docs/img/sequence-system.puml rename to docs/v0.1.1/img/sequence-system.puml diff --git a/docs/img/sequence-system_account.png b/docs/v0.1.1/img/sequence-system_account.png similarity index 100% rename from docs/img/sequence-system_account.png rename to docs/v0.1.1/img/sequence-system_account.png diff --git a/docs/img/sequence-system_account.puml b/docs/v0.1.1/img/sequence-system_account.puml similarity index 100% rename from docs/img/sequence-system_account.puml rename to docs/v0.1.1/img/sequence-system_account.puml diff --git a/docs/img/sequence-system_deletion.png b/docs/v0.1.1/img/sequence-system_deletion.png similarity index 100% rename from docs/img/sequence-system_deletion.png rename to docs/v0.1.1/img/sequence-system_deletion.png diff --git a/docs/img/sequence-system_deletion.puml b/docs/v0.1.1/img/sequence-system_deletion.puml similarity index 100% rename from docs/img/sequence-system_deletion.puml rename to docs/v0.1.1/img/sequence-system_deletion.puml diff --git a/docs/img/sequence-system_event.png b/docs/v0.1.1/img/sequence-system_event.png similarity index 100% rename from docs/img/sequence-system_event.png rename to docs/v0.1.1/img/sequence-system_event.png diff --git a/docs/img/sequence-system_event.puml b/docs/v0.1.1/img/sequence-system_event.puml similarity index 100% rename from docs/img/sequence-system_event.puml rename to docs/v0.1.1/img/sequence-system_event.puml diff --git a/docs/img/sequence-system_exercise.png b/docs/v0.1.1/img/sequence-system_exercise.png similarity index 100% rename from docs/img/sequence-system_exercise.png rename to docs/v0.1.1/img/sequence-system_exercise.png diff --git a/docs/img/sequence-system_exercise.puml b/docs/v0.1.1/img/sequence-system_exercise.puml similarity index 100% rename from docs/img/sequence-system_exercise.puml rename to docs/v0.1.1/img/sequence-system_exercise.puml diff --git a/docs/img/sequence-user_account.png b/docs/v0.1.1/img/sequence-user_account.png similarity index 100% rename from docs/img/sequence-user_account.png rename to docs/v0.1.1/img/sequence-user_account.png diff --git a/docs/img/sequence-user_account.puml b/docs/v0.1.1/img/sequence-user_account.puml similarity index 100% rename from docs/img/sequence-user_account.puml rename to docs/v0.1.1/img/sequence-user_account.puml diff --git a/docs/img/sequence-user_answer.png b/docs/v0.1.1/img/sequence-user_answer.png similarity index 100% rename from docs/img/sequence-user_answer.png rename to docs/v0.1.1/img/sequence-user_answer.png diff --git a/docs/img/sequence-user_answer.puml b/docs/v0.1.1/img/sequence-user_answer.puml similarity index 100% rename from docs/img/sequence-user_answer.puml rename to docs/v0.1.1/img/sequence-user_answer.puml diff --git a/docs/img/sequence-user_exercise.png b/docs/v0.1.1/img/sequence-user_exercise.png similarity index 100% rename from docs/img/sequence-user_exercise.png rename to docs/v0.1.1/img/sequence-user_exercise.png diff --git a/docs/img/sequence-user_exercise.puml b/docs/v0.1.1/img/sequence-user_exercise.puml similarity index 100% rename from docs/img/sequence-user_exercise.puml rename to docs/v0.1.1/img/sequence-user_exercise.puml diff --git a/docs/img/ui-exercise-runner-console.png b/docs/v0.1.1/img/ui-exercise-runner-console.png similarity index 100% rename from docs/img/ui-exercise-runner-console.png rename to docs/v0.1.1/img/ui-exercise-runner-console.png diff --git a/docs/img/ui-exercise-runner.png b/docs/v0.1.1/img/ui-exercise-runner.png similarity index 100% rename from docs/img/ui-exercise-runner.png rename to docs/v0.1.1/img/ui-exercise-runner.png diff --git a/docs/img/ui-new-account.png b/docs/v0.1.1/img/ui-new-account.png similarity index 100% rename from docs/img/ui-new-account.png rename to docs/v0.1.1/img/ui-new-account.png diff --git a/docs/img/ui-new-exercise.png b/docs/v0.1.1/img/ui-new-exercise.png similarity index 100% rename from docs/img/ui-new-exercise.png rename to docs/v0.1.1/img/ui-new-exercise.png diff --git a/docs/img/ui-new-option-a.png b/docs/v0.1.1/img/ui-new-option-a.png similarity index 100% rename from docs/img/ui-new-option-a.png rename to docs/v0.1.1/img/ui-new-option-a.png diff --git a/docs/img/ui-new-option-b.png b/docs/v0.1.1/img/ui-new-option-b.png similarity index 100% rename from docs/img/ui-new-option-b.png rename to docs/v0.1.1/img/ui-new-option-b.png diff --git a/docs/img/ui-new-option-c.png b/docs/v0.1.1/img/ui-new-option-c.png similarity index 100% rename from docs/img/ui-new-option-c.png rename to docs/v0.1.1/img/ui-new-option-c.png diff --git a/docs/img/ui-new-option-d.png b/docs/v0.1.1/img/ui-new-option-d.png similarity index 100% rename from docs/img/ui-new-option-d.png rename to docs/v0.1.1/img/ui-new-option-d.png diff --git a/docs/img/ui-new-option-e.png b/docs/v0.1.1/img/ui-new-option-e.png similarity index 100% rename from docs/img/ui-new-option-e.png rename to docs/v0.1.1/img/ui-new-option-e.png diff --git a/docs/img/ui-new-set.png b/docs/v0.1.1/img/ui-new-set.png similarity index 100% rename from docs/img/ui-new-set.png rename to docs/v0.1.1/img/ui-new-set.png diff --git a/docs/img/ui-set-selection.png b/docs/v0.1.1/img/ui-set-selection.png similarity index 100% rename from docs/img/ui-set-selection.png rename to docs/v0.1.1/img/ui-set-selection.png diff --git a/docs/img/use-case-diagram.drawio b/docs/v0.1.1/img/use-case-diagram.drawio similarity index 100% rename from docs/img/use-case-diagram.drawio rename to docs/v0.1.1/img/use-case-diagram.drawio diff --git a/docs/img/use-case-diagram.drawio.png b/docs/v0.1.1/img/use-case-diagram.drawio.png similarity index 100% rename from docs/img/use-case-diagram.drawio.png rename to docs/v0.1.1/img/use-case-diagram.drawio.png diff --git a/docs/relatorio.pdf b/docs/v0.1.1/relatorio.pdf similarity index 100% rename from docs/relatorio.pdf rename to docs/v0.1.1/relatorio.pdf diff --git a/docs/relatorio.typ b/docs/v0.1.1/relatorio.typ similarity index 100% rename from docs/relatorio.typ rename to docs/v0.1.1/relatorio.typ diff --git a/docs/slides/slides.odp b/docs/v0.1.1/slides/slides.odp similarity index 100% rename from docs/slides/slides.odp rename to docs/v0.1.1/slides/slides.odp diff --git a/docs/slides/slides.pdf b/docs/v0.1.1/slides/slides.pdf similarity index 100% rename from docs/slides/slides.pdf rename to docs/v0.1.1/slides/slides.pdf diff --git a/docs/v0.1.2/relatorio.md b/docs/v0.1.2/relatorio.md new file mode 100644 index 0000000..ea781d8 --- /dev/null +++ b/docs/v0.1.2/relatorio.md @@ -0,0 +1,22 @@ +# Mirante: Relatório para v0.1.2 + +## Tarefas +- [ ] Organizar estruturas de dados existentes +- [ ] Revisar estrutura de dados para questões de ordenação +- [ ] Adicionar estruturas de dados para contas +- [ ] Adicionar etruturas de dados para nĩíveis de acesso +- [ ] Adicionar estruturas de dados para receber resultados + +## Desenvolvimento + +Foram levantadas as opções atuais para o armazenamento seguro de senhas. Conforme [recomedações da OWASP][#1] e da própria [documentação do framework Spring][#2], a opção selecionada foi o algoritmo Argon2, que fornece forte segurança criptográfica resistente a ataques de força bruta, com [suporte nativo][#3] no framework através do Spring Security. + +A implementação utilizou a classe `Argon2PasswordEncoder` do Spring, que fornece os métodos `encode` e `matches`, permitindo armazenar apenas o resultado de uma operação unidirecional de _hashing_, de tal forma que o sistema nunca armazena a senha em si, mas apenas o resultado de sua codificação. + +A classe utilizada cuida da geração de um _salt_ para tornar a senha armazenada resistente a ataques por _rainbow table_, armazenado na mesma saída do método `encode`. + +Durante a implementação, um erro inicial enfrentado após o _commit_ `0b41f38` foi que as senhas eram gravadas no banco como valores nulos. + +[#1]: https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html +[#2]: https://docs.spring.io/spring-security/reference/features/authentication/password-storage.html#authentication-password-storage-argon2 +[#3]: https://docs.spring.io/spring-security/site/docs/6.2.1/api/org/springframework/security/crypto/argon2/Argon2PasswordEncoder.html#encode(java.lang.CharSequence)