mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Remove new lines
This commit is contained in:
parent
4e1f66f90b
commit
1406ac294f
59 changed files with 136 additions and 31 deletions
|
@ -46,4 +46,3 @@ class ActionText::ModelEncryptionTest < ActiveSupport::TestCase
|
|||
assert_equal expected_value, model.reload.send(attribute_name).body.to_html
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "active_support/core_ext/module"
|
||||
require "active_support/core_ext/array"
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ActiveRecord
|
||||
module Encryption
|
||||
# The algorithm used for encrypting and decrypting +Message+ objects.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "openssl"
|
||||
require "base64"
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ActiveRecord
|
||||
module Encryption
|
||||
# Container of contfiguration options
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ActiveRecord
|
||||
module Encryption
|
||||
# Configuration API for +ActiveRecord::Encryption+
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ActiveRecord
|
||||
module Encryption
|
||||
# An encryption context configures the different entities used to perform encryption:
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ActiveRecord
|
||||
module Encryption
|
||||
# +ActiveRecord::Encryption+ uses encryption contexts to configure the different entities used to
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ActiveRecord
|
||||
module Encryption
|
||||
# A +KeyProvider+ that derives keys from passwords
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ActiveRecord
|
||||
module Encryption
|
||||
# This is the concern mixed in Active Record models to make them encryptable. It adds the +encrypts+
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ActiveRecord
|
||||
module Encryption
|
||||
# An +ActiveModel::Type+ that encrypts/decrypts strings of text
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ActiveRecord
|
||||
module Encryption
|
||||
# Encrypts encryptable columns when loading fixtures automatically
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ActiveRecord
|
||||
module Encryption
|
||||
# An encryptor that can encrypt data but can't decrypt it
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "openssl"
|
||||
require "zip"
|
||||
require "active_support/core_ext/numeric"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ActiveRecord
|
||||
module Encryption
|
||||
# Implements a simple envelope encryption approach where:
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ActiveRecord
|
||||
module Encryption
|
||||
module Errors
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Automatically expand encrypted arguments to support querying both encrypted and unencrypted data
|
||||
#
|
||||
# Active Record Encryption supports querying the db using deterministic attributes. For example:
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ActiveRecord
|
||||
module Encryption
|
||||
# A key is a container for a given +secret+
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "securerandom"
|
||||
|
||||
module ActiveRecord
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ActiveRecord
|
||||
module Encryption
|
||||
# A +KeyProvider+ serves keys:
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ActiveRecord
|
||||
module Encryption
|
||||
# Encrypts all the models belonging to the provided list of classes
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ActiveRecord
|
||||
module Encryption
|
||||
# A message defines the structure of the data we store in encrypted attributes. It contains:
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ActiveRecord
|
||||
module Encryption
|
||||
# A message serializer that serializes +Messages+ with JSON.
|
||||
|
@ -51,9 +53,9 @@ module ActiveRecord
|
|||
end
|
||||
|
||||
def headers_to_json(headers)
|
||||
headers.collect do |key, value|
|
||||
[key, value.is_a?(ActiveRecord::Encryption::Message) ? message_to_json(value) : encode_if_needed(value)]
|
||||
end.to_h
|
||||
headers.transform_values do |value|
|
||||
value.is_a?(ActiveRecord::Encryption::Message) ? message_to_json(value) : encode_if_needed(value)
|
||||
end
|
||||
end
|
||||
|
||||
def encode_if_needed(value)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ActiveRecord
|
||||
module Encryption
|
||||
# An encryptor that won't decrypt or encrypt. It will just return the passed
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ActiveRecord
|
||||
module Encryption
|
||||
# This is a wrapper for a hash of encryption properties. It is used by
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ActiveRecord
|
||||
module Encryption
|
||||
# A +NullEncryptor+ that will raise an error when trying to encrypt data
|
||||
|
|
|
@ -555,7 +555,7 @@ db_namespace = namespace :db do
|
|||
desc "Generate a set of keys for configuring Active Record encryption in a given environment"
|
||||
task :init do
|
||||
puts <<~MSG
|
||||
Add this entry to the credentials of the target environment:
|
||||
Add this entry to the credentials of the target environment:#{' '}
|
||||
|
||||
active_record_encryption:
|
||||
master_key: #{SecureRandom.alphanumeric(32)}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "cases/encryption/helper"
|
||||
|
||||
class ActiveRecord::Encryption::Aes256GcmTest < ActiveSupport::TestCase
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "cases/encryption/helper"
|
||||
|
||||
class ActiveRecord::Encryption::CipherTest < ActiveSupport::TestCase
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "cases/encryption/helper"
|
||||
require "models/post"
|
||||
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "cases/encryption/helper"
|
||||
require "models/book"
|
||||
|
||||
class ActiveRecord::Encryption::ConfigurableTest < ActiveRecord::TestCase
|
||||
test 'can access context properties with top level getters' do
|
||||
test "can access context properties with top level getters" do
|
||||
assert_equal ActiveRecord::Encryption.key_provider, ActiveRecord::Encryption.context.key_provider
|
||||
end
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "cases/encryption/helper"
|
||||
require "models/book"
|
||||
require "models/post"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "cases/encryption/helper"
|
||||
|
||||
class ActiveRecord::Encryption::DerivedSecretKeyProviderTest < ActiveRecord::TestCase
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "cases/encryption/helper"
|
||||
require "models/author"
|
||||
require "models/book"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "cases/encryption/helper"
|
||||
require "models/author"
|
||||
require "models/book"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "cases/encryption/helper"
|
||||
require "models/book"
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "cases/encryption/helper"
|
||||
|
||||
class ActiveRecord::Encryption::EncryptingOnlyEncryptorTest < ActiveSupport::TestCase
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "cases/encryption/helper"
|
||||
require "models/author"
|
||||
|
||||
|
@ -75,6 +77,4 @@ class ActiveRecord::Encryption::EncryptionSchemesTest < ActiveRecord::TestCase
|
|||
end
|
||||
author
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "cases/encryption/helper"
|
||||
|
||||
class ActiveRecord::Encryption::EncryptorTest < ActiveSupport::TestCase
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "cases/encryption/helper"
|
||||
|
||||
class ActiveRecord::Encryption::EnvelopeEncryptionKeyProviderTest < ActiveRecord::TestCase
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "cases/encryption/helper"
|
||||
require "models/book"
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "cases/helper"
|
||||
require "benchmark/ips"
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "cases/encryption/helper"
|
||||
|
||||
class ActiveRecord::Encryption::KeyGeneratorTest < ActiveSupport::TestCase
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "cases/encryption/helper"
|
||||
|
||||
class ActiveRecord::Encryption::KeyProviderTest < ActiveRecord::TestCase
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "cases/encryption/helper"
|
||||
|
||||
class ActiveRecord::Encryption::KeyTest < ActiveSupport::TestCase
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "cases/encryption/helper"
|
||||
require "models/author"
|
||||
require "models/post"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "cases/encryption/helper"
|
||||
|
||||
class ActiveRecord::Encryption::MessageSerializerTest < ActiveSupport::TestCase
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "cases/encryption/helper"
|
||||
|
||||
class ActiveRecord::Encryption::MessageTest < ActiveSupport::TestCase
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "cases/encryption/helper"
|
||||
|
||||
class ActiveRecord::Encryption::NullEncryptorTest < ActiveSupport::TestCase
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "cases/encryption/helper"
|
||||
require "models/book"
|
||||
require "models/post"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "cases/encryption/helper"
|
||||
require "models/book"
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "cases/encryption/helper"
|
||||
require "models/book"
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "cases/encryption/helper"
|
||||
|
||||
class ActiveRecord::Encryption::StoragePerformanceTest < ActiveRecord::TestCase
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "cases/encryption/helper"
|
||||
|
||||
class ActiveRecord::EncryptionPropertiesTest < ActiveSupport::TestCase
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "cases/encryption/helper"
|
||||
|
||||
class ActiveRecord::Encryption::ReadOnlyNullEncryptorTest < ActiveSupport::TestCase
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "cases/encryption/helper"
|
||||
require "models/post"
|
||||
|
||||
|
|
Loading…
Reference in a new issue