Module: Match::Encryption

Defined in:
match/lib/match/encryption.rb,
match/lib/match/encryption/openssl.rb,
match/lib/match/encryption/interface.rb

Defined Under Namespace

Classes: Interface, OpenSSL

Class Method Summary collapse

Class Method Details

.for_storage_mode(storage_mode, params) ⇒ Object

Returns the class to be used for a given ‘storage_mode`



7
8
9
10
11
12
13
14
15
16
# File 'match/lib/match/encryption.rb', line 7

def self.for_storage_mode(storage_mode, params)
  if storage_mode == "git"
    params[:keychain_name] = params[:git_url]
    return Encryption::OpenSSL.configure(params)
  elsif storage_mode == "google_cloud"
    # return Encryption::GoogleCloudKMS.configure(params)
  else
    UI.user_error!("Invalid storage mode '#{storage_mode}'")
  end
end