Class: Remotus::Auth::Store

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

Overview

Authentication store base class

Direct Known Subclasses

HashStore

Instance Method Summary collapse

Instance Method Details

#credential(_connection, **_options) ⇒ Object

Base method fo retrieving a credential from the hash store. This must be overridden in derived classes or it will raise an exception.

Parameters:

Raises:



14
15
16
# File 'lib/remotus/auth/store.rb', line 14

def credential(_connection, **_options)
  raise Remotus::MissingOverride, "credential method not implemented in credential store #{self.class}"
end

#password(connection, **options) ⇒ String

Gets the password for a given connection and options

Parameters:

Returns:



38
39
40
# File 'lib/remotus/auth/store.rb', line 38

def password(connection, **options)
  credential(connection, **options)&.password
end

#user(connection, **options) ⇒ String

Gets the user for a given connection and options

Parameters:

Returns:



26
27
28
# File 'lib/remotus/auth/store.rb', line 26

def user(connection, **options)
  credential(connection, **options)&.user
end