Method: Aspera::Keychain::MacosSystem#get

Defined in:
lib/aspera/keychain/macos_security.rb

#get(options) ⇒ Object

Raises:



153
154
155
156
157
158
159
160
161
162
163
# File 'lib/aspera/keychain/macos_security.rb', line 153

def get(options)
  Aspera.assert_type(options, Hash){'options'}
  unsupported = options.keys - %i[label]
  Aspera.assert(unsupported.empty?){"unsupported options: #{unsupported}"}
  info = @keychain.password(:find, :generic, label: options[:label])
  raise Error, 'not found' if info.nil?
  result = options.clone
  result[:secret] = info['password']
  result[:description] = info['icmt'] # cspell: disable-line
  return result
end