Class: Doorkeeper::SecretStoring::Plain

Inherits:
Base
  • Object
show all
Defined in:
lib/doorkeeper/secret_storing/plain.rb

Overview

Plain text secret storing, which is the default but also provides fallback lookup if other secret storing mechanisms are enabled.

Class Method Summary collapse

Methods inherited from Base

secret_matches?, store_secret, validate_for

Class Method Details

.allows_restoring_secrets?Boolean

Plain values obviously allow restoring

Returns:

  • (Boolean)


28
29
30
# File 'lib/doorkeeper/secret_storing/plain.rb', line 28

def self.allows_restoring_secrets?
  true
end

.restore_secret(resource, attribute) ⇒ Object

Return the restored value from the database as retrieved from the database.

Parameters:

  • resource

    The resource instance to act on

  • attribute

    The secret attribute to restore



22
23
24
# File 'lib/doorkeeper/secret_storing/plain.rb', line 22

def self.restore_secret(resource, attribute)
  resource.public_send(attribute)
end

.transform_secret(plain_secret) ⇒ Object

Return the value to be stored by the database

Parameters:

  • plain_secret

    The plain secret input / generated



13
14
15
# File 'lib/doorkeeper/secret_storing/plain.rb', line 13

def self.transform_secret(plain_secret)
  plain_secret
end