Class: DBus::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/dbus/auth.rb

Overview

Authentication client class.

Class tha performs the actional authentication.

Instance Method Summary collapse

Constructor Details

#initialize(socket) ⇒ Client

Create a new authentication client.



110
111
112
113
114
# File 'lib/dbus/auth.rb', line 110

def initialize(socket)
  @socket = socket
  @state = nil
  @auth_list = [External,DBusCookieSHA1]
end

Instance Method Details

#authenticateObject

Start the authentication process.



117
118
119
120
121
122
123
124
125
126
# File 'lib/dbus/auth.rb', line 117

def authenticate
  @socket.write(0.chr)
  next_authenticator
  @state = :Starting
  while @state != :Authenticated
    r = next_state
    return r if not r
  end
  true
end