Sha256: d5d06ce97351399e27ba9e71dcf920b398a3e5f147cf004bbba6e40826c8f422

Contents?: true

Size: 777 Bytes

Versions: 42

Compression:

Stored size: 777 Bytes

Contents

# frozen_string_literal: true

module Doorkeeper
  module SecretStoring
    ##
    # Plain text secret storing, which is the default
    # but also provides fallback lookup if
    # other secret storing mechanisms are enabled.
    class Sha256Hash < Base
      ##
      # Return the value to be stored by the database
      # @param plain_secret The plain secret input / generated
      def self.transform_secret(plain_secret)
        ::Digest::SHA256.hexdigest plain_secret
      end

      ##
      # 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+.
      def self.allows_restoring_secrets?
        false
      end
    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
doorkeeper-5.8.0 lib/doorkeeper/secret_storing/sha256_hash.rb
doorkeeper-5.7.1 lib/doorkeeper/secret_storing/sha256_hash.rb
doorkeeper-5.7.0 lib/doorkeeper/secret_storing/sha256_hash.rb
doorkeeper-5.6.9 lib/doorkeeper/secret_storing/sha256_hash.rb
doorkeeper-5.6.8 lib/doorkeeper/secret_storing/sha256_hash.rb
doorkeeper-5.6.7 lib/doorkeeper/secret_storing/sha256_hash.rb
doorkeeper-5.6.6 lib/doorkeeper/secret_storing/sha256_hash.rb
doorkeeper-5.6.5 lib/doorkeeper/secret_storing/sha256_hash.rb
doorkeeper-5.6.4 lib/doorkeeper/secret_storing/sha256_hash.rb
doorkeeper-5.6.3 lib/doorkeeper/secret_storing/sha256_hash.rb
doorkeeper-5.6.2 lib/doorkeeper/secret_storing/sha256_hash.rb
doorkeeper-5.6.1 lib/doorkeeper/secret_storing/sha256_hash.rb
doorkeeper-5.6.0 lib/doorkeeper/secret_storing/sha256_hash.rb
doorkeeper-5.6.0.rc2 lib/doorkeeper/secret_storing/sha256_hash.rb
doorkeeper-5.6.0.rc1 lib/doorkeeper/secret_storing/sha256_hash.rb
doorkeeper-5.5.4 lib/doorkeeper/secret_storing/sha256_hash.rb
doorkeeper-5.5.3 lib/doorkeeper/secret_storing/sha256_hash.rb
doorkeeper-5.5.2 lib/doorkeeper/secret_storing/sha256_hash.rb
doorkeeper-5.5.1 lib/doorkeeper/secret_storing/sha256_hash.rb
doorkeeper-5.5.0 lib/doorkeeper/secret_storing/sha256_hash.rb