Class Mongo::Server::AppMetadata
In: lib/mongo/server/app_metadata.rb
Parent: Object

Application metadata that is sent to the server in an ismaster command,

  when a new connection is established.

@api private

@since 2.4.0

Methods

Constants

MAX_DOCUMENT_SIZE = 512.freeze   The max application metadata document byte size.

@since 2.4.0

MAX_APP_NAME_SIZE = 128.freeze   The max application name byte size.

@since 2.4.0

DRIVER_NAME = 'mongo-ruby-driver'   The driver name.

@since 2.4.0

AUTH_OPTION_KEYS = [:user, :auth_source, :auth_mech].freeze   Option keys that affect auth mechanism negotiation.

@api private

Public Class methods

Instantiate the new AppMetadata object.

@api private

@example Instantiate the app metadata.

  Mongo::Server::AppMetadata.new(options)

@param [ Hash ] options Metadata options. @option options [ String, Symbol ] :app_name Application name that is

  printed to the mongod logs upon establishing a connection in server
  versions >= 3.4.

@option options [ Symbol ] :auth_mech The authentication mechanism to

  use. One of :mongodb_cr, :mongodb_x509, :plain, :scram, :scram256

@option options [ String ] :auth_source The source to authenticate from. @option options [ Array<String> ] :compressors A list of potential

  compressors to use, in order of preference. The driver chooses the
  first compressor that is also supported by the server. Currently the
  driver only supports 'zlib'.

@option options [ String ] :platform Platform information to include in

  the metadata printed to the mongod logs upon establishing a connection
  in server versions >= 3.4.

@option options [ String ] :user The user name.

@since 2.4.0

Public Instance methods

Get the bytes of the ismaster message including this metadata.

@api private

@example Get the ismaster message bytes.

  metadata.ismaster_bytes

@return [ String ] The raw bytes.

@since 2.4.0

[Validate]