Giter Club home page Giter Club logo

pgcrypto's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pgcrypto's Issues

rails 4.2.0 , arel 6.0 compatibility?

Hi,
Great gem, I was wondering if you might have some insight about an issue I'm having which I think is due to Arel 6.0 upgrade. In Arel 5.0 BindParams < SqlLiteral < String < Object < BasicObject , but in Arel 6.0 BindParams < Node < Object < BasicObject. I assume this is the reason I get the message:

TypeError: wrong argument type Arel::Nodes::BindParam (expected String)
from ... /vendor/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql/quoting.rb:19:in escape_string' from ... /vendor/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql/quoting.rb:19:inquote_string'
from ... /vendor/ruby/2.2.0/gems/pgcrypto-0.4.1/lib/pgcrypto/adapter.rb:51:in `pgcrypto_encrypt_string'

More info on stack exchange here: (http://stackoverflow.com/questions/29102190/postgres-9-4-pgcrypto-0-4-1-rails-4-2-0-ruby-2-2-0-quoting-expected-string) , happy to help out with a pull request but I'm not clear on how to get a value out of Arel::Nodes::BindParam. I suspect the problem line is in pgcrypto_insert line 64 and pgcrypto_update line 98 (possibly other areas as well) where you are pulling a value from Arel::Nodes::BindParam.

thanks

Issues during setup and installation (existing project with data)

I follow the steps but I get some errors
Steps followed:

  1. Install gem and migrate db
    Extensions exists in the db and "pgcrypto_columns" table gets created
  2. Edit Initializer file and add:
PGCrypto.keys[:private] = {:path => "./keys/private.key" , :armored => false, :password => "password" }
PGCrypto.keys[:public] = {:path => "./keys/public.key"}

3 . Edit my user.rb and add the following: pgcrypto :organisation_name
(column in my users table)

Starting Server and trying to CRUD User

During Create:
It works and the records gets saved
During Read/Update I get:
PG::Error: ERROR: failed to find conversion function from unknown to bytea

Any Ideas?

rails-6.0.2

I am using rails 6 and when i use has_encrypted_column it just throws the binary string instead decrypted value any help here.

has_encrypted_column :date_of_birth
p = PersonalInfo.last
p.date_of_birth is "x313937392d30332d3034"
instead i wanted the value as "1995-08-01"
Any help here.

Datatypes other than string

This gem is really cool not trying to take anything away from it. However it would be nice if there was support for some sort of software abstraction surrounding the encryption that allowed you to associate a datatype to a particular column so that when it was unencrypted by the gem, it would automatically be in the correct format (e.g. integer, datetime, etc.) as opposed to everything going in and coming out as a string and needing to convert it accordingly.

Cheers, though, this is super awesome!

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.