Class: Mongo::Crypt::KMS::AWS::Credentials Private
Do not use. This class is for internal use only.
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Forwardable
|
|
Instance Chain:
|
|
Inherits: | Object |
Defined in: | lib/mongo/crypt/kms/aws/credentials.rb |
Overview
::Mongo::Crypt::KMS::AWS
KMS Credentials
object contains credentials for using ::Mongo::Crypt::KMS::AWS
KMS provider.
Constant Summary
-
FORMAT_HINT =
# File 'lib/mongo/crypt/kms/aws/credentials.rb', line 42"AWS KMS provider options must be in the format: " + "{ access_key_id: 'YOUR-ACCESS-KEY-ID', secret_access_key: 'SECRET-ACCESS-KEY' }"
Class Method Summary
-
.new(opts) ⇒ Credentials
constructor
Internal use only
Creates an
::Mongo::Crypt::KMS::AWS
KMS credentials object form a parameters hash.
Instance Attribute Summary
- #access_key_id ⇒ String readonly Internal use only
- #secret_access_key ⇒ String readonly Internal use only
- #session_token ⇒ String | 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.
::Mongo::Crypt::KMS::Validations
- Included
#validate_param | Validate if a |
#validate_tls_options | Validate KMS TLS options. |
Instance Attribute Details
#access_key_id ⇒ String
(readonly)
# File 'lib/mongo/crypt/kms/aws/credentials.rb', line 31
attr_reader :access_key_id
#secret_access_key ⇒ String
(readonly)
# File 'lib/mongo/crypt/kms/aws/credentials.rb', line 34
attr_reader :secret_access_key
#session_token ⇒ String
| nil
(readonly)
# File 'lib/mongo/crypt/kms/aws/credentials.rb', line 37
attr_reader :session_token
Instance Method Details
#to_document ⇒ BSON::Document
Convert credentials object to a BSON document in libmongocrypt format.
# File 'lib/mongo/crypt/kms/aws/credentials.rb', line 67
def to_document return BSON::Document.new if empty? BSON::Document.new({ accessKeyId: access_key_id, secretAccessKey: secret_access_key, }).tap do |bson| unless session_token.nil? bson.update({ sessionToken: session_token }) end end end