···33module Sparkles
44 module Relations
55 class Teams < Sparkles::DB::Relation
66- schema :teams, infer: true
66+ include Deps["encrypted_attributes"]
77+88+ schema :teams, infer: true do
99+ use :encrypted_attributes
1010+1111+ encrypt :access_token
1212+ end
713 end
814 end
915end
+13
config/providers/encrypted_attributes.rb
···11+Hanami.app.register_provider(:encrypted_attributes) do
22+ prepare do
33+ require "rom/encrypted_attribute"
44+55+ ROM::EncryptedAttribute.configure do |config|
66+ config.primary_key = "your-primary-key" # required
77+ config.key_derivation_salt = "your-derivation-salt" # required
88+ config.hash_digest_class = OpenSSL::Digest::SHA256 # SHA1 by default
99+ end
1010+1111+ register "encrypted_attributes", ROM::EncryptedAttribute
1212+ end
1313+end