Permalink
Browse files

Added support for blind indexing - closes #216

  • Loading branch information...
ankane committed Feb 2, 2019
1 parent f61f288 commit aaabfbcde3084984f7e9f1984eb3178088ea46a5
Showing with 19 additions and 0 deletions.
  1. +4 −0 CHANGELOG.md
  2. +13 −0 README.md
  3. +1 −0 app/controllers/blazer/base_controller.rb
  4. +1 −0 lib/blazer.rb
@@ -1,3 +1,7 @@
## 2.0.2 [unreleased]

- Added support for variable transformation for blind indexing

## 2.0.1

- Added favicon
@@ -175,6 +175,19 @@ Also, make sure authorization is enabled when you start the server.

If your database contains sensitive or personal data, check out [Hypershield](https://github.com/ankane/hypershield) to shield it.

## Encrypted Data

If you need to search encrypted data, use [blind indexing](https://github.com/ankane/blind_index).

You can have Blazer transform specific variables with: [master]

```ruby
Blazer.transform_variable = lambda do |name, value|
value = User.compute_email_bidx(value) if name == "email_bidx"
value
end
```

## Queries

### Variables
@@ -63,6 +63,7 @@ def process_vars(statement, data_source)
value = value.to_f
end
end
value = Blazer.transform_variable.call(var, value) if Blazer.transform_variable
statement.gsub!("{#{var}}", ActiveRecord::Base.connection.quote(value))
end
end
@@ -40,6 +40,7 @@ class << self
attr_accessor :from_email
attr_accessor :cache
attr_accessor :transform_statement
attr_accessor :transform_variable
attr_accessor :check_schedules
attr_accessor :anomaly_checks
attr_accessor :forecasting

0 comments on commit aaabfbc

Please sign in to comment.