Sha256: 43dffbb2c260c716a7f45470d062dc9271af113dfa35f1162fcbce3d7e32c5c7

Contents?: true

Size: 1.21 KB

Versions: 5

Compression:

Stored size: 1.21 KB

Contents

# frozen_string_literal: true
# encoding: utf-8

require 'spec_helper'

describe 'Client-Side Encryption' do
  describe 'Prose tests: Data key and double encryption' do
    require_libmongocrypt
    require_enterprise
    min_server_fcv '4.2'

    include_context 'define shared FLE helpers'

    let(:client) do
      new_local_client(
        SpecConfig.instance.addresses,
        SpecConfig.instance.test_options
      )
    end

    let(:client_encrypted) do
      new_local_client(
        SpecConfig.instance.addresses,
        SpecConfig.instance.test_options.merge(
          auto_encryption_options: {
            kms_providers: local_kms_providers,
            key_vault_namespace: 'keyvault.datakeys',
            # Spawn mongocryptd on non-default port for sharded cluster tests
            extra_options: extra_options,
          },
          database: 'db',
        )
      )
    end

    before do
      client.use('db')['view'].drop
      client.use('db').database.command(create: 'view', viewOn: 'coll')
    end

    it 'does not perform encryption on views' do
      expect do
        client_encrypted['view'].insert_one({})
      end.to raise_error(Mongo::Error::CryptError, /cannot auto encrypt a view/)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mongo-2.18.3 spec/integration/client_side_encryption/views_spec.rb
mongo-2.18.2 spec/integration/client_side_encryption/views_spec.rb
mongo-2.18.1 spec/integration/client_side_encryption/views_spec.rb
mongo-2.18.0 spec/integration/client_side_encryption/views_spec.rb
mongo-2.18.0.beta1 spec/integration/client_side_encryption/views_spec.rb