Sha256: 12273689e355d45e0afd4adec8db34d17c3da475ede8130eacc4e8735b5219d4

Contents?: true

Size: 877 Bytes

Versions: 1

Compression:

Stored size: 877 Bytes

Contents

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 Plain < Base

      ##
      # Return the value to be stored by the database
      # @param plain_secret The plain secret input / generated
      def self.transform_secret(plain_secret)
        plain_secret
      end

      ##
      # Return the restored value from the database
      # @param resource The resource instance to act on
      # @param attribute The secret attribute to restore
      # as retrieved from the database.
      def self.restore_secret(resource, attribute)
        resource.public_send attribute
      end

      ##
      # Plain values obviously allow restoring
      def self.allows_restoring_secrets?
        true
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
doorkeeper-5.1.0.rc2 lib/doorkeeper/secret_storing/plain.rb