Class: Mongo::Crypt::KMS::Azure::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/azure/credentials.rb |
Overview
::Mongo::Crypt::KMS::Azure
KMS Credentials
object contains credentials for using ::Mongo::Crypt::KMS::Azure
KMS provider.
Constant Summary
-
FORMAT_HINT =
# File 'lib/mongo/crypt/kms/azure/credentials.rb', line 46'Azure KMS provider options must be in the format: \ { tenant_id: "TENANT-ID", client_id: "TENANT_ID", client_secret: "CLIENT_SECRET" }'
Class Method Summary
-
.new(opts) ⇒ Credentials
constructor
Internal use only
Creates an
::Mongo::Crypt::KMS::Azure
KMS credentials object form a parameters hash.
Instance Attribute Summary
- #access_token ⇒ String | nil readonly Internal use only
- #client_id ⇒ String readonly Internal use only
- #client_secret ⇒ String readonly Internal use only
- #identity_platform_endpoint ⇒ String | nil readonly Internal use only
- #tenant_id ⇒ String 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_token ⇒ String
| nil
(readonly)
# File 'lib/mongo/crypt/kms/azure/credentials.rb', line 41
attr_reader :access_token
#client_id ⇒ String
(readonly)
# File 'lib/mongo/crypt/kms/azure/credentials.rb', line 32
attr_reader :client_id
#client_secret ⇒ String
(readonly)
# File 'lib/mongo/crypt/kms/azure/credentials.rb', line 35
attr_reader :client_secret
#identity_platform_endpoint ⇒ String
| nil
(readonly)
# File 'lib/mongo/crypt/kms/azure/credentials.rb', line 38
attr_reader :identity_platform_endpoint
#tenant_id ⇒ String
(readonly)
# File 'lib/mongo/crypt/kms/azure/credentials.rb', line 29
attr_reader :tenant_id
Instance Method Details
#to_document ⇒ BSON::Document
Convert credentials object to a BSON document in libmongocrypt format.
# File 'lib/mongo/crypt/kms/azure/credentials.rb', line 80
def to_document return BSON::Document.new if empty? if access_token BSON::Document.new({ accessToken: access_token }) else BSON::Document.new( { tenantId: @tenant_id, clientId: @client_id, clientSecret: @client_secret } ).tap do |bson| unless identity_platform_endpoint.nil? bson.update({ identityPlatformEndpoint: identity_platform_endpoint }) end end end end