Giter Club home page Giter Club logo

anon's People

Contributors

errm avatar jonnyarnold avatar reneklacan avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

anon's Issues

Make CLI a bit more standard

We should make all the options flags, the, in and out file should be flags to, we should default to read from std in and write to std out. So I can do stuff like

mysql -uroot secret_database -e 'SELECT * from secet_user_files' | anon --text > not_so_secret_file.csv

It encourages people then to not keep unneded copies of sensitive data around.

Text instead of CSV

Isn't it better idea to generally use text anon instead of CSV?

  • It should be faster
  • It wouldn't change the structure of CSV document (delimiters, new lines, etc).

Let me use CSV header names in CSV mode.

given the file personas-a-correo-no-deseado.csv

correo electronico,color de pelo,bigote
[email protected], azul,verdadero
[email protected],verde, falso
[email protected], rosa, verdadero

I want to run the following comand: anon --in personas-a-correo-no-deseado.csv --out anoned.csv --column 'correo electronico' and get the following output:

correo electronico,color de pelo,bigote
[email protected], azul,verdadero
[email protected],verde, falso
[email protected], rosa, verdadero

Make repo open-source

This is a nice piece of open-source-able functionality.

What needs to be done?

  • Remove @reevoo.com from code
  • Add specs
  • Improve CLI code for extensibility
  • Gemify (#1)
  • Documentation Review
  • Comment Review

CSV processing is broken

$anon csv test_file.csv test_out.csv 1
/Users/ed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/anon-0.0.1/lib/anon/cli.rb:30:in `csv': uninitialized constant Anon::Csv (NameError)
    from /Users/ed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/anon-0.0.1/lib/anon/cli.rb:8:in `parse!'
    from /Users/ed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/anon-0.0.1/bin/anon:5:in `<top (required)>'
    from /Users/ed/.rbenv/versions/1.9.3-p194/bin/anon:23:in `load'

looks like a typo of Anon::Csv vs Anon::CSV in lib/anon/cli.rb:30

CodeClimate

We can also use CodeClimate instead of simplecov (CC is also using simplecov) and have a nice badge with coverage.

Make email regex more permissive.

http://data.iana.org/TLD/tlds-alpha-by-domain.txt has some fairly long tlds

for example .xn--clchc0ea0b2g2a9gcd i.e. .சிங்கப்பூர்

we should make the regex more permissive than it is.

In revieworld we have been using /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}$/i for validation of emails...

We should try /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,24}$/i to start with.

Auto-detect which column to Anon

I did RetailerFeedSetting.where(feed_queue_name: 'purchasers').map { |p| p.replacement_headers[:email] }.compact.uniq

["email",
 "zemailaddress",
 "contact email address",
 "emailaddress",
 "e-mail",
 "personal email",
 "email address",
 "ct_email_addr",
 "e_mail_address",
 "student_e_mail",
 "e-mail address",
 "parent email address",
 "customer email address",
 "email_address",
 "contact address.email",
 "user email string",
 "email client",
 "client email",
 "ot ship-to email address",
 "customer email",
 "clnp email address1",
 "default_email",
 "email_addr",
 "sender_email",
 "webemail"]

We should be able to detect which columns need annoning quite simply . . .

`round': Infinity (FloatDomainError) in text mode

This seems to anon the file ok but blows up

$echo '[email protected]' > test.in && anon text test.in test.out
/Users/ed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/anon-0.0.1/lib/anon/base.rb:40:in `round': Infinity (FloatDomainError)
    from /Users/ed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/anon-0.0.1/lib/anon/base.rb:40:in `complete_progress'
    from /Users/ed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/anon-0.0.1/lib/anon/text.rb:24:in `anonymise!'
    from /Users/ed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/anon-0.0.1/lib/anon/base.rb:10:in `anonymise!'
    from /Users/ed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/anon-0.0.1/lib/anon/cli.rb:19:in `text'
    from /Users/ed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/anon-0.0.1/lib/anon/cli.rb:8:in `parse!'
    from /Users/ed/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/anon-0.0.1/bin/anon:5:in `<top (required)>'
    from /Users/ed/.rbenv/versions/1.9.3-p194/bin/anon:23:in `load'
    from /Users/ed/.rbenv/versions/1.9.3-p194/bin/anon:23:in `<main>'
$cat test.out
[email protected]

Let me set useful default options with a dotfile

For example it would be nice for this:

anon config --email-domain example.com

to create or update the file ~/.anonrc

email_domain: 'example.com'

and then for the config in that file to be used when annoning things.

Use human hashing instead of a lookup table

Currently we create a lookup table as we parse e-mail addresses to ensure we return the same address. This doesn't scale when we get to 100,000+ addresses.

An alternative would be to hash our addresses, but we want to keep the e-mail addresses human readable. Fortunately there is a hashing algorithm around that returns human-readable output. As a bonus, the hashes it returns are ridiculous.

We should look at porting this to Ruby and using it.

Make it a gem

beacause, and then it will make installing dependencies easier and expose a bin thingy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.