This repository is dedicated to improving the learning experience in the Go programming language.
The main objective of this repository is to develop a user-friendly API that effectively filters out sensitive information from JSON objects. By utilizing this API, users can confidently send JSON data, knowing that any sensitive data will be securely removed.
The filtering process will identify and exclude sensitive data fields, ensuring the privacy and confidentiality of the information.
This repository serves as a Proof of Concept (POC), showcasing the capabilities and potential of learning enhancements and sensitive data filtering in Go.
go run main.go
The application will provide an API running on port 7777
POST /filter
Parâmetro | Descrição | Mandatory |
---|---|---|
fields |
Defines the fields to be removed | N |
nodes |
Defines the nodes to be removed | N |
data |
Defines the data | Y |
{
"fields": "age,name",
"nodes": ["address"],
"data": {
"name": "John Doe",
"email": "johndoe@example.com",
"age": 30,
"address": {
"street": "123 Main St",
"city": "New York"
}
}
}
Note: There should be no spaces between the fields entered.
{
"email": "johndoe@example.com"
}
{
"fields": "",
"nodes": ["address"],
"data": {
"name": "John Doe",
"email": "johndoe@example.com",
"age": 30,
"address": {
"street": "123 Main St",
"city": "New York"
}
}
}
{
"age": 30,
"email": "johndoe@example.com",
"name": "John Doe"
}
{
"fields": "email",
"nodes": [""],
"data": {
"name": "John Doe",
"email": "johndoe@example.com",
"age": 30,
"address": {
"street": "123 Main St",
"city": "New York"
}
}
}
{
"address": {
"city": "New York",
"street": "123 Main St"
},
"age": 30,
"name": "John Doe"
}
{
"fields": "age,name,email",
"nodes": ["address"],
"data": {
"name": "John Doe",
"email": "johndoe@example.com",
"age": 30,
"address": {
"street": "123 Main St",
"city": "New York"
}
}
}
{}
To run the tests, run the following command in the project root folder
go test ./tests/...
ok github.com/rromulos/go-clean-sensitive-data/tests