Class: RubySMB::Server::Session
- Inherits:
-
Object
- Object
- RubySMB::Server::Session
- Defined in:
- lib/ruby_smb/server/session.rb
Overview
The object representing a single anonymous, guest or authenticated session.
Instance Attribute Summary collapse
-
#creation_time ⇒ Object
readonly
The time at which this session was created.
- #id ⇒ Integer
- #key ⇒ String
- #signing_required ⇒ Boolean
- #state ⇒ Symbol
- #tree_connect_table ⇒ Hash
-
#user_id ⇒ Object
The identity of the authenticated user.
Instance Method Summary collapse
-
#initialize(id, key: nil, state: :in_progress, user_id: nil) ⇒ Session
constructor
A new instance of Session.
- #inspect ⇒ Object
-
#is_anonymous ⇒ Boolean
Whether or not this session is anonymous.
- #logoff! ⇒ Object
Constructor Details
#initialize(id, key: nil, state: :in_progress, user_id: nil) ⇒ Session
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/ruby_smb/server/session.rb', line 10 def initialize(id, key: nil, state: :in_progress, user_id: nil) @id = id @key = key @user_id = user_id @state = state @signing_required = false # tree id => provider processor instance @tree_connect_table = {} @creation_time = Time.now end |
Instance Attribute Details
#creation_time ⇒ Object (readonly)
The time at which this session was created.
68 69 70 |
# File 'lib/ruby_smb/server/session.rb', line 68 def creation_time @creation_time end |
#id ⇒ Integer
39 40 41 |
# File 'lib/ruby_smb/server/session.rb', line 39 def id @id end |
#key ⇒ String
44 45 46 |
# File 'lib/ruby_smb/server/session.rb', line 44 def key @key end |
#signing_required ⇒ Boolean
58 59 60 |
# File 'lib/ruby_smb/server/session.rb', line 58 def signing_required @signing_required end |
#state ⇒ Symbol
53 54 55 |
# File 'lib/ruby_smb/server/session.rb', line 53 def state @state end |
#tree_connect_table ⇒ Hash
63 64 65 |
# File 'lib/ruby_smb/server/session.rb', line 63 def tree_connect_table @tree_connect_table end |
#user_id ⇒ Object
The identity of the authenticated user.
48 49 50 |
# File 'lib/ruby_smb/server/session.rb', line 48 def user_id @user_id end |
Instance Method Details
#inspect ⇒ Object
21 22 23 |
# File 'lib/ruby_smb/server/session.rb', line 21 def inspect "#<Session id: #{@id.inspect}, user_id: #{@user_id.inspect}, state: #{@state.inspect}>" end |
#is_anonymous ⇒ Boolean
Whether or not this session is anonymous.
27 28 29 |
# File 'lib/ruby_smb/server/session.rb', line 27 def is_anonymous @user_id == Gss::Provider::IDENTITY_ANONYMOUS end |
#logoff! ⇒ Object
31 32 33 34 |
# File 'lib/ruby_smb/server/session.rb', line 31 def logoff! @tree_connect_table.values.each { |share_processor| share_processor.disconnect! } @tree_connect_table.clear end |