โœจ Recognize teammates in slack by awarding them sparkles!
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

๐Ÿ” Add support for encrypted attributes

davidcel.is b0b659be a6c52cb7

verified
+28 -2
+3 -1
Gemfile
··· 12 12 gem "hanami-validations", HANAMI_VERSION 13 13 gem "hanami-view", HANAMI_VERSION 14 14 15 + gem "base64" 15 16 gem "dry-types", "~> 1.7" 16 17 gem "dry-operation" 18 + gem "pg" 17 19 gem "puma" 18 20 gem "rake" 19 - gem "pg" 21 + gem "rom-encrypted_attribute" 20 22 21 23 group :development do 22 24 gem "hanami-webconsole", "~> 2.2"
+5
Gemfile.lock
··· 3 3 specs: 4 4 addressable (2.8.7) 5 5 public_suffix (>= 2.0.2, < 7.0) 6 + base64 (0.3.0) 6 7 better_errors (2.10.1) 7 8 erubi (>= 1.0.0) 8 9 rack (>= 0.9.0) ··· 270 271 dry-struct (~> 1.0) 271 272 dry-types (~> 1.6) 272 273 transproc (~> 1.1) 274 + rom-encrypted_attribute (0.0.5) 275 + dry-types (~> 1.5) 273 276 rom-repository (5.4.2) 274 277 dry-core (~> 1.0) 275 278 dry-initializer (~> 3.2) ··· 321 324 x86_64-linux-musl 322 325 323 326 DEPENDENCIES 327 + base64 324 328 capybara 325 329 database_cleaner-sequel 326 330 dotenv ··· 340 344 puma 341 345 rack-test 342 346 rake 347 + rom-encrypted_attribute 343 348 344 349 BUNDLED WITH 345 350 2.7.2
+7 -1
app/relations/teams.rb
··· 3 3 module Sparkles 4 4 module Relations 5 5 class Teams < Sparkles::DB::Relation 6 - schema :teams, infer: true 6 + include Deps["encrypted_attributes"] 7 + 8 + schema :teams, infer: true do 9 + use :encrypted_attributes 10 + 11 + encrypt :access_token 12 + end 7 13 end 8 14 end 9 15 end
+13
config/providers/encrypted_attributes.rb
··· 1 + Hanami.app.register_provider(:encrypted_attributes) do 2 + prepare do 3 + require "rom/encrypted_attribute" 4 + 5 + ROM::EncryptedAttribute.configure do |config| 6 + config.primary_key = "your-primary-key" # required 7 + config.key_derivation_salt = "your-derivation-salt" # required 8 + config.hash_digest_class = OpenSSL::Digest::SHA256 # SHA1 by default 9 + end 10 + 11 + register "encrypted_attributes", ROM::EncryptedAttribute 12 + end 13 + end