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
-
.new(kms_providers) ⇒ Credentials
constructor
Internal use only
Creates a
::Mongo::Crypt::KMS
credentials object form a parameters hash.
Instance Attribute Summary
- #aws ⇒ Credentials::AWS | nil readonly Internal use only
- #azure ⇒ Credentials::Azure | nil readonly Internal use only
- #gcp ⇒ Credentials::GCP | nil readonly Internal use only
- #kmip ⇒ Credentials::KMIP | nil readonly Internal use only
- #local ⇒ Credentials::Local | nil readonly Internal use only
Instance Method Summary
-
#to_document ⇒ BSON::Document
Internal use only
Convert credentials object to a BSON document in libmongocrypt format.
Instance Attribute Details
#aws ⇒ Credentials::AWS
| nil
(readonly)
# File 'lib/mongo/crypt/kms/credentials.rb', line 28
attr_reader :aws
#azure ⇒ Credentials::Azure
| nil
(readonly)
# File 'lib/mongo/crypt/kms/credentials.rb', line 31
attr_reader :azure
#gcp ⇒ Credentials::GCP
| nil
(readonly)
# File 'lib/mongo/crypt/kms/credentials.rb', line 34
attr_reader :gcp
#kmip ⇒ Credentials::KMIP
| nil
(readonly)
# File 'lib/mongo/crypt/kms/credentials.rb', line 37
attr_reader :kmip
#local ⇒ Credentials::Local
| nil
(readonly)
# File 'lib/mongo/crypt/kms/credentials.rb', line 40
attr_reader :local
Instance Method Details
#to_document ⇒ BSON::Document
Convert credentials object to a BSON document in libmongocrypt format.
# 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