Class: Mongo::Crypt::KMS::KMIP::Credentials Private
- Inherits:
-
Object
- Object
- Mongo::Crypt::KMS::KMIP::Credentials
- Extended by:
- Forwardable
- Includes:
- Validations
- Defined in:
- lib/mongo/crypt/kms/kmip/credentials.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
-
#endpoint ⇒ String
readonly
private
KMIP KMS endpoint with optional port.
Instance Method Summary collapse
-
#initialize(opts) ⇒ Credentials
constructor
private
Creates a KMIP KMS credentials object form a parameters hash.
-
#to_document ⇒ BSON::Document
private
Convert credentials object to a BSON document in libmongocrypt format.
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.
47 48 49 50 51 52 |
# File 'lib/mongo/crypt/kms/kmip/credentials.rb', line 47 def initialize(opts) @opts = opts unless empty? @endpoint = validate_param(:endpoint, opts, FORMAT_HINT) end end |
Instance Attribute Details
#endpoint ⇒ String (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.
31 32 33 |
# File 'lib/mongo/crypt/kms/kmip/credentials.rb', line 31 def endpoint @endpoint end |
Instance Method Details
#to_document ⇒ BSON::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.
57 58 59 60 61 62 |
# File 'lib/mongo/crypt/kms/kmip/credentials.rb', line 57 def to_document return BSON::Document.new({}) if empty? BSON::Document.new({ endpoint: endpoint, }) end |