# File lib/mongo/auth/user.rb, line 160
      def initialize(options)
        @database = options[:database] || Database::ADMIN
        @auth_source = options[:auth_source] || @database
        @name = options[:user]
        @password = options[:password] || options[:pwd]
        @mechanism = options[:auth_mech]
        if @mechanism
          # Since the driver must select an authentication class for
          # the specified mechanism, mechanisms that the driver does not
          # know about, and cannot translate to an authentication class,
          # need to be rejected.
          unless @mechanism.is_a?(Symbol)
            # Although we documented auth_mech option as being a symbol, we
            # have not enforced this; warn, reject in lint mode
            if Lint.enabled?
              raise Error::LintError, "Auth mechanism #{@mechanism.inspect} must be specified as a symbol"
            else
              log_warn("Auth mechanism #{@mechanism.inspect} should be specified as a symbol")
              @mechanism = @mechanism.to_sym
            end
          end
          unless Auth::SOURCES.key?(@mechanism)
            raise InvalidMechanism.new(options[:auth_mech])
          end
        end
        @auth_mech_properties = options[:auth_mech_properties] || {}
        @roles = options[:roles] || []
        @client_key = options[:client_key]
      end