Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control exposing hashing algorithms using Cabal flags #63

Merged
merged 4 commits into from
Feb 16, 2023

Commits on Feb 9, 2023

  1. Put all hashing algorithms behind Cabal flags

    This allows a developer depending on `password` to toggle on and off
    support for different password-hashing algorithms at the package level.
    
    The motivator for this is that `cryptonite`'s Argon2 implementation is
    broken on M1 Macs (or any `aarch64-darwin` machine), and in the Nix
    package set, `cryptonite` has been patched so that any calls to the
    Argon2 implementation will cause a compiler error telling the developer
    that it is broken. However, as a user of `password`, I don't use Argon2,
    and I still want to be able to compile `password` by simply ignoring
    Argon2 as a possible hashing algorithm. That's what these flags allow me
    to do.
    ivanbakel committed Feb 9, 2023
    Configuration menu
    Copy the full SHA
    e5f6100 View commit details
    Browse the repository at this point in the history
  2. Expose Data.Password.Internal source code to tests

    The tests previously relied on the Bcrypt module being exposed to access
    certain re-exports from the Internal module. Now that Bcrypt is no
    longer guaranteed to be included in the library (i.e. if the brcrypt
    cabal flag is disabled), we can't rely on it to be able to run the
    tests.
    
    Instead, we add the `src/` folder to the test suite, so that the tests
    can directly access the Internal module without needing to expose it to
    public users of the library.
    
    This change generates some spurious warnings about "undeclared modules"
    when building the tests, but these can safely be ignored. Those modules
    are accessed through the `password` library, not via the source code.
    ivanbakel committed Feb 9, 2023
    Configuration menu
    Copy the full SHA
    d6800fd View commit details
    Browse the repository at this point in the history

Commits on Feb 15, 2023

  1. Configuration menu
    Copy the full SHA
    54d924a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1b9d29c View commit details
    Browse the repository at this point in the history