Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/douglasmoraisdev/url_regex_validation
A microservice for url validation based on regex whitelist. This python microservice receive and validate regex and urls via RabbitMq Queues, and persists on Mysql Databases. A Docker-compose file is used for orquestration.
https://github.com/douglasmoraisdev/url_regex_validation
Last synced: about 2 months ago
JSON representation
A microservice for url validation based on regex whitelist. This python microservice receive and validate regex and urls via RabbitMq Queues, and persists on Mysql Databases. A Docker-compose file is used for orquestration.
- Host: GitHub
- URL: https://github.com/douglasmoraisdev/url_regex_validation
- Owner: douglasmoraisdev
- Created: 2020-03-23T22:02:16.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-23T22:56:37.000Z (almost 5 years ago)
- Last Synced: 2024-05-14T00:31:45.506Z (8 months ago)
- Language: Python
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Url Regex Validator
A microservice for url validation based on regex whitelist. This python microservice receive and validate regex and urls via RabbitMq Queues, and persists on Mysql Databases. A Docker-compose file is used for orquestration.
# Running service
> $ docker-compose up
# Running unit tests
Using Docker
> $ docker exec -it python -m unittestStandalone service
> $ python -m unittest# Configuration
Use these files for configuration:
When running with docker-compose (default)
> src/.docker.envWhen running only the microservice (external Mysql and/or Rabbitmq)
> src/.envTo configure automated tests env variables
> src/tests/.env# Inserting new regex on Whitelist
Post this payload on RabbitMQ. Queue: $INSERTION_QUEUE (.env):```json
{"client": , "regex": }
```
```client```
A client name (string), if 'null', will be saved on 'global' whitelist```regex```
A url format regex for whitelist# Validating Urls
Post this payload on RabbitMQ. Queue: $VALIDATION_QUEUE (.env):```json
{"client": , "url": , "correlationId": }
```
```client:```
A client name (string), if 'null', will be match on 'global' whitelist```url:```
A url for validation```correlationId:```
A UUID for relation queries and responses# Validating results (Response)
This payload will be post on RabbitMQ response routing key ($RESPONSE_ROUTING_KEY), when a validating occured.
```json
{"match": , "regex": , "correlationId": }
``````match:```
Result of whitelist validation: true or false```regex:```
The matched regex. If no match found will be 'null'```correlationId:```
The correlationId origin of validation