Class: Doorkeeper::SecretStoring::Sha256Hash

Inherits:
Base
  • Object
show all
Defined in:
lib/doorkeeper/secret_storing/sha256_hash.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

restore_secret, secret_matches?, store_secret, validate_for

Class Method Details

.allows_restoring_secrets?Boolean

Determines whether this strategy supports restoring secrets from the database. This allows detecting users trying to use a non-restorable strategy with reuse_access_tokens.

Returns:

  • (Boolean)

21
22
23
# File 'lib/doorkeeper/secret_storing/sha256_hash.rb', line 21

def self.allows_restoring_secrets?
  false
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/sha256_hash.rb', line 13

def self.transform_secret(plain_secret)
  ::Digest::SHA256.hexdigest plain_secret
end