18F/identity-idp

View on GitHub
app/services/pwned_passwords/lookup_password.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# frozen_string_literal: true

module PwnedPasswords
  class LookupPassword
    PWNED_PASSWORD_FILE = Rails.root.join(IdentityConfig.store.pwned_passwords_file_path).freeze

    def self.call(password)
      BinarySearchSortedHashFile.new(PWNED_PASSWORD_FILE).call(password)
    end
  end
end