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

Inherits:
Object
  • Object
show all
Includes:
Validations
Defined in:
build/ruby-driver-master/lib/mongo/crypt/kms/kmip.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

KMIP KMS Credentials object contains credentials for a remote KMIP KMS provider.

Constant Summary collapse

FORMAT_HINT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

"KMIP KMS provider options must be in the format: " +
"{ endpoint: 'ENDPOINT' }"

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Validations

#validate_param, validate_tls_options

Constructor Details

#initialize(opts) ⇒ Credentials

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Creates a KMIP KMS credentials object form a parameters hash.

Parameters:

  • opts (Hash)

    A hash that contains credentials for KMIP KMS provider.

Options Hash (opts):

  • :endpoint (String)

    KMIP endpoint.

Raises:

  • (ArgumentError)

    If required options are missing or incorrectly formatted.



43
44
45
# File 'build/ruby-driver-master/lib/mongo/crypt/kms/kmip.rb', line 43

def initialize(opts)
  @endpoint = validate_param(:endpoint, opts, FORMAT_HINT)
end

Instance Attribute Details

#endpointString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns KMIP KMS endpoint with optional port.

Returns:

  • (String)

    KMIP KMS endpoint with optional port.



30
31
32
# File 'build/ruby-driver-master/lib/mongo/crypt/kms/kmip.rb', line 30

def endpoint
  @endpoint
end

Instance Method Details

#to_documentBSON::Document

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Convert credentials object to a BSON document in libmongocrypt format.

Returns:

  • (BSON::Document)

    Local KMS credentials in libmongocrypt format.



50
51
52
53
54
# File 'build/ruby-driver-master/lib/mongo/crypt/kms/kmip.rb', line 50

def to_document
  BSON::Document.new({
    endpoint: endpoint,
  })
end