123456789_123456789_123456789_123456789_123456789_

Class: Mongo::Crypt::KMS::Credentials Private

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: lib/mongo/crypt/kms/credentials.rb

Overview

::Mongo::Crypt::KMS Credentials object contains credentials for using ::Mongo::Crypt::KMS providers.

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#awsCredentials::AWS | nil (readonly)

Returns:

  • (Credentials::AWS | nil)

    AWS KMS credentials.

[ GitHub ]

  
# File 'lib/mongo/crypt/kms/credentials.rb', line 28

attr_reader :aws

#azureCredentials::Azure | nil (readonly)

Returns:

  • (Credentials::Azure | nil)

    Azure KMS credentials.

[ GitHub ]

  
# File 'lib/mongo/crypt/kms/credentials.rb', line 31

attr_reader :azure

#gcpCredentials::GCP | nil (readonly)

Returns:

  • (Credentials::GCP | nil)

    GCP KMS credentials.

[ GitHub ]

  
# File 'lib/mongo/crypt/kms/credentials.rb', line 34

attr_reader :gcp

#kmipCredentials::KMIP | nil (readonly)

Returns:

  • (Credentials::KMIP | nil)

    KMIP KMS credentials.

[ GitHub ]

  
# File 'lib/mongo/crypt/kms/credentials.rb', line 37

attr_reader :kmip

#localCredentials::Local | nil (readonly)

Returns:

  • (Credentials::Local | nil)

    Local KMS credentials.

[ GitHub ]

  
# File 'lib/mongo/crypt/kms/credentials.rb', line 40

attr_reader :local

Instance Method Details

#to_documentBSON::Document

Convert credentials object to a BSON document in libmongocrypt format.

Returns:

  • (BSON::Document)

    Credentials as BSON document.

[ GitHub ]

  
# File 'lib/mongo/crypt/kms/credentials.rb', line 84

def to_document
  BSON::Document.new.tap do |bson|
    bson[:aws] = @aws.to_document if @aws
    bson[:azure] = @azure.to_document if @azure
    bson[:gcp] = @gcp.to_document if @gcp
    bson[:kmip] = @kmip.to_document if @kmip
    bson[:local] = @local.to_document if @local
  end
end