Skip to content

Commit

Permalink
Reorganize docs, add v0.1.2 report
Browse files Browse the repository at this point in the history
  • Loading branch information
jultty committed Jan 24, 2024
1 parent 94fd4d0 commit 99ee8b7
Show file tree
Hide file tree
Showing 47 changed files with 78 additions and 15 deletions.
52 changes: 42 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-<version>.jar
```

Replace `<version>` 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-<version>.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/)
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 13 additions & 4 deletions docs/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,28 @@
- <https://opentelemetry.io/docs/languages/java/automatic/spring-boot/>
- <https://www.baeldung.com/spring-boot-opentelemetry-setup>

## 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
- Classificação (Médio, Intermediário, Avançado)
- da questão
- do conjunto

## 0.8.0
## 0.9.0
- Repetição espaçada
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions docs/v0.1.2/relatorio.md
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 99ee8b7

Please sign in to comment.