{"id":21690032,"url":"https://github.com/matheus-srego/challenge_itau","last_synced_at":"2026-04-12T03:03:53.437Z","repository":{"id":120977705,"uuid":"445871912","full_name":"matheus-srego/challenge_itau","owner":"matheus-srego","description":"Project for password validation in an API, developed based on the 'back-end challenge' repository from iti/Itaú.","archived":false,"fork":false,"pushed_at":"2024-10-28T03:06:18.000Z","size":155,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-03T21:03:35.962Z","etag":null,"topics":["api-rest","docker-compose","dockerfile","java11","maven","postman","regex","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matheus-srego.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-08T16:34:17.000Z","updated_at":"2024-10-28T03:06:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"656d131c-b10a-4514-a440-9f3296bc48ae","html_url":"https://github.com/matheus-srego/challenge_itau","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/matheus-srego/challenge_itau","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matheus-srego%2Fchallenge_itau","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matheus-srego%2Fchallenge_itau/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matheus-srego%2Fchallenge_itau/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matheus-srego%2Fchallenge_itau/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matheus-srego","download_url":"https://codeload.github.com/matheus-srego/challenge_itau/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matheus-srego%2Fchallenge_itau/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31702582,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T21:17:31.016Z","status":"online","status_checked_at":"2026-04-12T02:00:06.763Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-rest","docker-compose","dockerfile","java11","maven","postman","regex","spring-boot"],"created_at":"2024-11-25T17:28:48.264Z","updated_at":"2026-04-12T03:03:53.420Z","avatar_url":"https://github.com/matheus-srego.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Back-end Challenge (iti // Itaú)\n\n\u003cimg src=\"https://seucreditodigital.com.br/wp-content/uploads/2019/07/iti-itau.jpg\"\u003e \n\n\u003cdiv align=\"center\"\u003e\n\n![Java Version](https://img.shields.io/badge/Java-v11-important)\n![Spring Boot](https://img.shields.io/badge/spring_boot-%236DB33F)\n![Maven](https://img.shields.io/badge/maven-%23C71A36)\n \n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n![Docker](https://img.shields.io/badge/docker-%232496ED)\n![Docker Compose](https://img.shields.io/badge/docker--compose-%230055A4)\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![CI for Fields Validation API to do build with Maven, Dockerfile Java and Docker Compose](https://github.com/matheus-srego/challenge_itau/actions/workflows/ci.yaml/badge.svg)](https://github.com/matheus-srego/challenge_itau/actions/workflows/ci.yaml)\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n**Challenge repository:** [itidigital/backend-challenge](https://github.com/itidigital/backend-challenge)\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[➜ Leia-me em Português](tools/readme/README.pt-BR.md)\n\n\u003c/div\u003e\n\n## Table of Contents\n - [Stack](#stack)\n - [Description](#description)\n - [Problem](#problem)\n - [Solution Details](#solution-details)\n - [Assuming Premises](#assuming-premises)\n - [How to Run the Project](#how-to-run-the-project)\n    - [Using Dockerfile](#using-dockerfile)\n    - [Using Docker Compose](#using-docker-compose)\n - [License](#license)\n\n## Stack\n\n - ```Java 11```\n - ```Spring Boot 2.6.2```\n - ```Maven 3.8.4```\n - ```JUnit```\n - ```RegEx```\n - ```Docker```\n - ```Postman```\n\n\n\u003cdetails\u003e\n    \u003csummary\u003e\u003ch2 id=\"project-tree\"\u003eProject Tree\u003c/h2\u003e\u003c/summary\u003e\n\n```bash\n.\n├── FieldsValidation\n│   ├── Dockerfile\n│   ├── mvnw\n│   ├── mvnw.cmd\n│   ├── pom.xml\n│   ├── src\n│   │   ├── main\n│   │   │   ├── java\n│   │   │   │   └── com\n│   │   │   │       └── challenge\n│   │   │   │           └── itidigital\n│   │   │   │               └── fieldsvalidation\n│   │   │   │                   ├── FieldsValidationApplication.java\n│   │   │   │                   ├── controllers\n│   │   │   │                   │   └── ValidatorController.java\n│   │   │   │                   ├── services\n│   │   │   │                   │   ├── ValidatorFactory.java\n│   │   │   │                   │   ├── ValidatorFieldService.java\n│   │   │   │                   │   ├── ValidatorService.java\n│   │   │   │                   │   └── servicesimpl\n│   │   │   │                   │       ├── ValidatorBlankSpaceServiceImpl.java\n│   │   │   │                   │       ├── ValidatorDigitServiceImpl.java\n│   │   │   │                   │       ├── ValidatorFieldEmptyServiceImpl.java\n│   │   │   │                   │       ├── ValidatorLowercaseLetterServiceImpl.java\n│   │   │   │                   │       ├── ValidatorNumberOfCharactersServiceImpl.java\n│   │   │   │                   │       ├── ValidatorRepeatedCharactersWithinTheSetServiceImpl.java\n│   │   │   │                   │       ├── ValidatorRepeatedDigitInSequenceServiceImpl.java\n│   │   │   │                   │       ├── ValidatorRepeatedLowercaseLetterInSequenceServiceImpl.java\n│   │   │   │                   │       ├── ValidatorRepeatedSpecialCharacterInSequenceServiceImpl.java\n│   │   │   │                   │       ├── ValidatorRepeatedUppercaseLetterInSequenceServiceImpl.java\n│   │   │   │                   │       ├── ValidatorSpecialCharacterServiceImpl.java\n│   │   │   │                   │       └── ValidatorUppercaseLetterServiceImpl.java\n│   │   │   │                   └── utils\n│   │   │   │                       └── CONSTANTS.java\n│   │   │   └── resources\n│   │   │       └── application.properties\n│   │   └── test\n│   │       └── java\n│   │           └── com\n│   │               └── challenge\n│   │                   └── itidigital\n│   │                       └── fieldsvalidation\n│   │                           ├── FieldsValidationApplicationTests.java\n│   │                           └── servicesimpl\n│   │                               └── ValidatorServiceTests.java\n│   └── target\n├── LICENSE\n├── README.md\n├── docker-compose.yml\n└── tools\n    ├── postman\n    │   └── challenge_itau.postman_collection.json\n    ├── readme\n    │   └── README.pt-BR.md\n    └── scripts\n        └── clean.sh\n```\n\u003c/details\u003e\n\n## Description\n\nConsider a password valid if it meets the following criteria:\n\n- Nine or more characters\n- At least 1 digit\n- At least 1 lowercase letter\n- At least 1 uppercase letter\n- At least 1 special character\n  - Consider the following characters as special: !@#$%^\u0026*()-+\n- No repeated characters within the set\n\nExample:\n\n```java\nisValid(\"\") // false  \nisValid(\"aa\") // false  \nisValid(\"ab\") // false  \nisValid(\"AAAbbbCc\") // false  \nisValid(\"AbTp9!foo\") // false  \nisValid(\"AbTp9!foA\") // false\nisValid(\"AbTp9 fok\") // false\nisValid(\"AbTp9!fok\") // true\n```\n\n\u003e **_Note:_**  White spaces should not be considered as valid characters.\n\n## Problem\n\nBuild an application that exposes a web API to validate if a password is valid.\n\n**Input:** A password (string).  \n**Output:** A boolean indicating whether the password is valid.\n\nAlthough our applications are written in Kotlin and C# (.net core), you don't need to use these languages. Use the programming language you are most comfortable with.\n\n## Solution Details\nTo solve the challenge, I used technologies like Java, JUnit, SpringBoot, Maven, and RegEx. Based on how the **Description** and **Problem** were outlined, particularly the part:\n\n \u003e \"Build an application that exposes a web API to validate if a password is valid.\"\n\nI decided to create a project using a monolithic architecture where all validations can be reused, validating the requested fields and being adaptable for other types of fields in a cohesive manner without breaking the architecture. The project structure allows the creation of new classes and validation methods by simply calling the necessary methods from the factory class, enabling the reuse of the password validation logic.\n\n## Assuming Premises\nI assumed that the project could, in the future, receive other types of fields (such as email, CPF, CNPJ, name...) and that the architecture and code should allow password field validations to be reused and customized for each field that might need validation. Thus, I used interfaces, a factory pattern, and transformed each requested validation into a single method so that code reuse is possible.\n\n## How to Run the Project\n\n**Step 0:** Clone the repository\n```bash\ngit clone https://github.com/matheus-srego/challange_itau.git\n```\n\n**Step 1:** Navigate to the project folder with the command below\n```bash\ncd ~/challenge_itau/FieldsValidation/\n```\n### Using Dockerfile\n - Build the application image\n    ```bash\n    docker build -f Dockerfile -t openjdk_11 .\n    ```\n\n- Run the application container\n    ```bash\n    docker run -d --name fields_validation_api -p 8080:8080 -t openjdk_11\n    ```\n\n### Using Docker Compose\n - Run Docker Compose in debug mode\n    ```bash\n    DEBUG=true docker-compose up -d --build\n    ```\n\n - Run Docker Compose without debug mode\n    ```bash\n    DEBUG=false docker-compose up -d --build\n    ```\n    *or simply run the command without 'DEBUG=false'*\n\n\n## Running Unit Tests\n\nThe tests were written to ensure the integrity of the application, trying to cover password validation and its characters as thoroughly as possible. Below is how to run them:\n\n**Run all tests**\n```bash\nmvn test\n```\n\n**Run specific tests**\n```bash\nmvn -Dtest=TestName test\n```\n\n## License\nThis repository is licensed under [MIT Licensed](https://github.com/matheus-srego/challenge_itau/blob/main/LICENSE).\n\n---\n\n### Acknowledgment\n\nI used ChatGPT to assist me in improving the translation of this README to English.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatheus-srego%2Fchallenge_itau","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatheus-srego%2Fchallenge_itau","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatheus-srego%2Fchallenge_itau/lists"}