-
Notifications
You must be signed in to change notification settings - Fork 41
Updating the project #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
riquellopes
wants to merge
75
commits into
davedash:master
Choose a base branch
from
riquellopes:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
75 commits
Select commit
Hold shift + click to select a range
0c56c87
init
cshlopes 74393c2
adding new rules
riquellopes 731a55e
creating simple tasks
riquellopes f0c3f3c
pep validation
riquellopes eff9c90
starting refactoring
riquellopes 13adecc
creating the first test for get_truncates
riquellopes 6875784
fixing a bug
riquellopes fe1a693
fixing a bug
riquellopes 97d4bdb
writing a new test for sql delete
riquellopes e8c6c91
covering def listify
riquellopes 7c0dc6e
updating the default domain and creating a simple test
riquellopes 32a642c
adding a comment
riquellopes adcf6da
Refactoring
cshlopes 15ac475
adding ci support
cshlopes ca93a06
adding the status ci image
cshlopes 21775a7
fix the install command
cshlopes 97a7779
changing import package at top
cshlopes f42a92a
refactoring
riquellopes 1093e9b
refactoring
riquellopes 1ffc9fb
adding support to dynamic primary key
riquellopes e29e989
setting the log on project
riquellopes 85f29ff
refactoring code to improve the tests
riquellopes ec3d17d
breaking de code into small parts
riquellopes 0a86f30
adding new random fields
riquellopes 92c4b55
adding ipdb
riquellopes 253f7ae
copy sample files to package
riquellopes 8164d2b
refactoring code
riquellopes 6feccff
updating the documentation and add requires at setup
riquellopes 0a10e1f
adding exception support for sql
cshlopes 0687936
updating readme
cshlopes fd9e076
updating readme
cshlopes 5595782
updating readme
cshlopes 93bd9c0
updating readme
cshlopes 03162ba
updating readme
cshlopes a4246d6
fixing path of file
riquellopes ce0ab71
Inclusão de informação sobre o CNPJ
ronaldosantoscs 1c63e53
Inclusion of CNPJ randomization
ronaldosantoscs e79dc9d
Merge pull request #1 from ronaldorts/master
riquellopes 3443c63
adding support to coverall
cshlopes 6c9600b
adding the coveralls badge
cshlopes d5c5fb7
adding the coveralls badge
cshlopes 6480ac4
Update README.md
riquellopes d1bd8c7
changing version of pytest
cshlopes d3245f3
Merge branch 'master' of github.com:riquellopes/mysql-anonymous
cshlopes 5cee78b
deleting coveralls file
riquellopes e68bf27
adding the extra commands for coverage
riquellopes f97c118
omit package tests
riquellopes c5e3671
creating a new task
riquellopes a4cdd3c
updating travis file
riquellopes b8c2d08
updating travis file
riquellopes 33ea5e5
fix make
riquellopes a13a5f9
pep
riquellopes a15868a
pep
riquellopes 60a0a14
adding support to Lorem Ipsum text field
riquellopes daebf03
removing empty test
riquellopes 2119a8e
updating the readme
riquellopes 758d3d5
adding absolute_import package
riquellopes 5055ae7
upgrade the module to use items def
riquellopes 69a8b2d
creating new tests
riquellopes 6220213
Merge pull request #4 from riquellopes/feature/lorem-ipsum
riquellopes bb712af
manual merge
riquellopes 2972a9d
adding a silent task
riquellopes a5d70e0
Merge pull request #7 from riquellopes/feature/geral
riquellopes 89b0102
Merge remote-tracking branch 'origin/master' into feature/tests
riquellopes a4bab5c
Merge pull request #6 from riquellopes/feature/tests
riquellopes 6034d7e
fix the version of pyyaml
riquellopes d736e08
adding filter
riquellopes 2ba2b07
removing filter
riquellopes ea522b6
changing pyyaml version
riquellopes 6046fd1
package secure
riquellopes 6d5bcc0
Update README.md
riquellopes 7dad104
incresed version
riquellopes 17d9113
call class Loader
riquellopes 8b5e8bd
added support to new python versions
riquellopes 89ae4c3
Merge pull request #8 from riquellopes/feature/incresed-versio
riquellopes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[run] | ||
omit = | ||
*/tests* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,107 @@ | ||
anon.sql | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# celery beat schedule file | ||
celerybeat-schedule | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
|
||
# dump | ||
*.sql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
language: python | ||
|
||
python: | ||
- "3.5" | ||
- "3.6" | ||
- "3.9" | ||
- "3.10" | ||
|
||
install: "make setup" | ||
|
||
script: | ||
- make test | ||
- make coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
.SILENT: | ||
PIP=.venv/bin/pip | ||
PYTEST=.venv/bin/pytest | ||
PYTHON=.venv/bin/python | ||
COVERALLS=.venv/bin/coveralls | ||
|
||
|
||
test:clean | ||
PYTHONPATH=anonymize ${PYTEST} -s -v --cov=anonymize --cov-report term-missing tests/${path} | ||
|
||
venv: | ||
virtualenv .venv --python=python3 | ||
|
||
setup:venv | ||
${PIP} install -U pip | ||
${PIP} install -r requirements_dev.txt | ||
|
||
clean: | ||
find . -name "*.pyc" -exec rm -rf {} \; | ||
|
||
sample: | ||
PYTHONPATH=anonymize ${PYTHON} anonymize/__init__.py | ||
|
||
coveralls: | ||
${COVERALLS} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,69 @@ | ||
## Mysql Anonymous | ||
|
||
[](https://travis-ci.org/riquellopes/mysql-anonymous) | ||
[](https://coveralls.io/github/riquellopes/mysql-anonymous?branch=master) | ||
|
||
Contributors can benefit from having real data when they are | ||
developing. This script can do a few things (see `anonymize.yml`): | ||
developing. This script can do a few things (see `sample1.yml` or `sample2.yml`): | ||
|
||
* Truncate any tables (logs, and other cruft which may have sensitive data) | ||
* Nullify fields (emails, passwords, etc) | ||
* Fill in random/arbitrary data: | ||
* Random integers | ||
* Random IP addresses | ||
* Random Cell Phone | ||
* Random Phone | ||
* Random [CPF](https://pt.wikipedia.org/wiki/Cadastro_de_pessoas_f%C3%ADsicas) | ||
* Random [CNPJ](https://pt.wikipedia.org/wiki/Cadastro_Nacional_da_Pessoa_Jur%C3%ADdica) | ||
* Email addresses | ||
* Usernames | ||
* Text [Loren Ipsum](https://www.lipsum.com/) | ||
|
||
* Delete rows based on simple rules: e.g. | ||
``DELETE FROM mytable WHERE private = "Yes"``: | ||
|
||
```yml | ||
database: | ||
tables: | ||
mytable: | ||
delete: | ||
nullify: | ||
private: Yes | ||
``` | ||
|
||
* Apply rules exception in some cases: e.g. | ||
``UPDATE mytable SET cellphone=NULL WHERE id NOT IN(556, 889)``: | ||
|
||
```yml | ||
database: | ||
tables: | ||
mytable: | ||
exception: | ||
- 556 | ||
- 889 | ||
nullify: | ||
- cellphone | ||
``` | ||
|
||
* Define an other name for primary key of table: e.g. | ||
``UPDATE mytable SET `email` = CONCAT(user_id, '@example.com')``: | ||
|
||
### Usage | ||
```yml | ||
database: | ||
tables: | ||
primary_key: user_id | ||
mytable: | ||
random_email: email | ||
``` | ||
|
||
python anonymize.py > anon.sql | ||
cat anon.sql | mysql | ||
Installation | ||
------------ | ||
```sh | ||
pip install https://github.com/riquellopes/mysql-anonymous/tarball/master | ||
``` | ||
CookBook | ||
-------- | ||
```sh | ||
anonymize --sample-one | ||
anonymize --sample-two | ||
anonymize -y database.yml | ||
``` |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can update the user for your. 👍