Class: RubySMB::Gss::Provider::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_smb/gss/provider.rb

Overview

The base class for a GSS authentication provider. This class defines a common interface and is not usable as a provider on its own.

Direct Known Subclasses

Kerberos, Multi, NTLM

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#allow_anonymous ⇒ Object

Whether or not anonymous authentication attempts should be permitted.



52
53
54
# File 'lib/ruby_smb/gss/provider.rb', line 52

def allow_anonymous
  @allow_anonymous
end

#allow_guests ⇒ Object

Whether or not unknown users should be allowed to authenticate as guests.



57
58
59
# File 'lib/ruby_smb/gss/provider.rb', line 57

def allow_guests
  @allow_guests
end

Instance Method Details

#mech_types ⇒ Array<OpenSSL::ASN1::ObjectId>

The GSS mechanisms this provider can handle, in preference order. These are advertised to the client in the SPNEGO NegTokenInit, and are used to route an incoming token to the provider that understands it.

Returns:

  • (Array<OpenSSL::ASN1::ObjectId>)

Raises:

  • (NotImplementedError)


34
35
36
# File 'lib/ruby_smb/gss/provider.rb', line 34

def mech_types
  raise NotImplementedError
end

#new_authenticator(server_client) ⇒ Object

Create a new, client-specific authenticator instance. This new instance is then able to track the unique state of a particular client / connection.

Parameters:

  • server_client (Server::ServerClient) —

    the client instance that this the authenticator will be for

Raises:

  • (NotImplementedError)


25
26
27
# File 'lib/ruby_smb/gss/provider.rb', line 25

def new_authenticator(server_client)
  raise NotImplementedError
end

#supports_mech_type?(mech_type) ⇒ Boolean

Whether this provider can handle a token for the specified mechanism.

Parameters:

  • mech_type (OpenSSL::ASN1::ObjectId) —

    the mechanism selected by the client

Returns:

  • (Boolean)


43
44
45
46
47
# File 'lib/ruby_smb/gss/provider.rb', line 43

def supports_mech_type?(mech_type)
  return false if mech_type.nil?

  mech_types.any? { |oid| oid.oid == mech_type.oid }
end