Sha256: 7b5b9826e9d3ba9f744c7b372ac7b64517d1324714d413b879b206d325f6f488

Contents?: true

Size: 886 Bytes

Versions: 5

Compression:

Stored size: 886 Bytes

Contents

# frozen_string_literal: true

shared_context "with token hashing enabled" do
  let(:hashed_or_plain_token_func) do
    Doorkeeper::SecretStoring::Sha256Hash.method(:transform_secret)
  end

  before do
    Doorkeeper.configure do
      orm DOORKEEPER_ORM
      hash_token_secrets
    end
  end
end

shared_context "with token hashing and fallback lookup enabled" do
  let(:hashed_or_plain_token_func) do
    Doorkeeper::SecretStoring::Sha256Hash.method(:transform_secret)
  end

  before do
    Doorkeeper.configure do
      orm DOORKEEPER_ORM
      hash_token_secrets fallback: :plain
    end
  end
end

shared_context "with application hashing enabled" do
  let(:hashed_or_plain_token_func) do
    Doorkeeper::SecretStoring::Sha256Hash.method(:transform_secret)
  end

  before do
    Doorkeeper.configure do
      orm DOORKEEPER_ORM
      hash_application_secrets
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
doorkeeper-mongodb-5.3.0 spec/support/shared/hashing_shared_context.rb
doorkeeper-mongodb-5.2.3 spec/support/shared/hashing_shared_context.rb
doorkeeper-sequel-2.4.0 spec/support/shared/hashing_shared_context.rb
doorkeeper-mongodb-5.2.2 spec/support/shared/hashing_shared_context.rb
doorkeeper-sequel-2.3.0 spec/support/shared/hashing_shared_context.rb