Sha256: 66b0a72856ff6c0c6c14881858a8db686b8e09c76d367dc03e519bc2eeabbc70

Contents?: true

Size: 902 Bytes

Versions: 6

Compression:

Stored size: 902 Bytes

Contents

Shindo.tests('Cifrado | SwiftClient') do
      
  obj = create_bin_payload 1

  tests('set_acl') do
    dir = test_container
    response = client.set_acl '.r:*,.rlistings', test_container.key
    test 'success' do
      [202,201].include? response.status
    end
    test 'ACL present' do
      response = client.service.request :method => 'GET', 
                                        :path => test_container.key
      response.headers['X-Container-Read'] == '.r:*,.rlistings'
    end
    dir.destroy
  end

  tests('#encrypted_upload') do
    test 'success' do
      response = client.encrypted_upload('cifrado-tests', obj) 
      cipher = CryptoEngineAES.new client.api_key
      headers = client.head(test_container_name, clean_object_name(obj))
      fname = headers['X-Object-Meta-Encrypted-Name']
      ([202,201].include? response.status) and obj == cipher.decrypt(fname)
    end
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cifrado-0.2.1 tests/swift_client_tests.rb
cifrado-0.2.0 tests/swift_client_tests.rb
cifrado-0.1.3 tests/swift_client_tests.rb
cifrado-0.1.2 tests/swift_client_tests.rb
cifrado-0.1.1 tests/swift_client_tests.rb
cifrado-0.1 tests/swift_client_tests.rb