-
Notifications
You must be signed in to change notification settings - Fork 217
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
Encode the minimum and maximum passphrase lengths just once. #124
Conversation
09bcb04
to
f418d29
Compare
passphraseMinLength = 10 | ||
|
||
passphraseMaxLength :: Int | ||
passphraseMaxLength = 255 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps these named constants should be located in the AddressDerivation
module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really because, that's really just a user-facing thing here. From the derivation perspective, we don't care about it and the passphrase could as well be empty. Actually, I've discussed this with Charles Morgan and, in the short-long run, we do want to enforce some better strength validation at the API boundary. Yet, this doesn't have to "leak" through the rest IMO.
f418d29
to
54fc24f
Compare
@jonathanknowles I've edit your PR's comments to add the template back with the associated ticket number. Let's try not to get rid of the template, they are the result of several iterations already and have their usage 🙏 |
Use named constants to encode the minimum and maximum passphrase lengths, and use these named constants rather than repeating their values.
54fc24f
to
7998cbb
Compare
To workaround $ nix-shell nix/cabal-shell.nix --run "cabal v2-configure -frelease --enable-tests --enable-benchmarks" HEAD is now at 41971b6 Merge pull request #124 from input-output-hk/dependabot/bundler/test/e2e/rake-12.3.3 'cabal.project.local' file already exists. Now overwriting it. Warning: The package list for 'hackage.haskell.org' is 34 days old. Run 'cabal update' to get the latest list of available packages. Warning: Requested index-state2021-03-11T00:00:00Z is newer than 'hackage.haskell.org'! Falling back to older state (2021-03-10T23:06:54Z). Resolving dependencies... cabal: Could not resolve dependencies: [__0] trying: Win32-network-0.1.0.0 (user goal) [__1] trying: base-4.14.1.0/installed-4.14.1.0 (dependency of Win32-network) [__2] trying: cardano-addresses-3.3.0 (user goal) [__3] rejecting: cardano-addresses:!test (constraint from config file, command line flag, or user target requires opposite flag selection) [__3] trying: cardano-addresses:*test [__4] next goal: aeson (dependency of cardano-addresses) [__4] rejecting: aeson-1.5.6.0, aeson-1.5.5.1, aeson-1.5.5.0, aeson-1.5.4.1, aeson-1.5.4.0, aeson-1.5.3.0, aeson-1.5.2.0, aeson-1.5.1.0, aeson-1.5.0.0 (conflict: cardano-addresses *test => aeson>=1.4.6.0 && <1.5.0.0) [__4] trying: aeson-1.4.7.1 [__5] next goal: cardano-api (user goal) [__5] rejecting: cardano-api-1.26.2 (conflict: aeson==1.4.7.1, cardano-api => aeson>=1.5.6.0) [__5] fail (backjumping, conflict set: aeson, cardano-api) After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: aeson, cardano-addresses:test, cardano-addresses, cardano-api, base, Win32-network Try running with --minimize-conflict-set to improve the error message.
To workaround $ nix-shell nix/cabal-shell.nix --run "cabal v2-configure -frelease --enable-tests --enable-benchmarks" HEAD is now at 41971b6 Merge pull request #124 from input-output-hk/dependabot/bundler/test/e2e/rake-12.3.3 'cabal.project.local' file already exists. Now overwriting it. Warning: The package list for 'hackage.haskell.org' is 34 days old. Run 'cabal update' to get the latest list of available packages. Warning: Requested index-state2021-03-11T00:00:00Z is newer than 'hackage.haskell.org'! Falling back to older state (2021-03-10T23:06:54Z). Resolving dependencies... cabal: Could not resolve dependencies: [__0] trying: Win32-network-0.1.0.0 (user goal) [__1] trying: base-4.14.1.0/installed-4.14.1.0 (dependency of Win32-network) [__2] trying: cardano-addresses-3.3.0 (user goal) [__3] rejecting: cardano-addresses:!test (constraint from config file, command line flag, or user target requires opposite flag selection) [__3] trying: cardano-addresses:*test [__4] next goal: aeson (dependency of cardano-addresses) [__4] rejecting: aeson-1.5.6.0, aeson-1.5.5.1, aeson-1.5.5.0, aeson-1.5.4.1, aeson-1.5.4.0, aeson-1.5.3.0, aeson-1.5.2.0, aeson-1.5.1.0, aeson-1.5.0.0 (conflict: cardano-addresses *test => aeson>=1.4.6.0 && <1.5.0.0) [__4] trying: aeson-1.4.7.1 [__5] next goal: cardano-api (user goal) [__5] rejecting: cardano-api-1.26.2 (conflict: aeson==1.4.7.1, cardano-api => aeson>=1.5.6.0) [__5] fail (backjumping, conflict set: aeson, cardano-api) After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: aeson, cardano-addresses:test, cardano-addresses, cardano-api, base, Win32-network Try running with --minimize-conflict-set to improve the error message.
To workaround $ nix-shell nix/cabal-shell.nix --run "cabal v2-configure -frelease --enable-tests --enable-benchmarks" HEAD is now at 41971b6 Merge pull request #124 from input-output-hk/dependabot/bundler/test/e2e/rake-12.3.3 'cabal.project.local' file already exists. Now overwriting it. Warning: The package list for 'hackage.haskell.org' is 34 days old. Run 'cabal update' to get the latest list of available packages. Warning: Requested index-state2021-03-11T00:00:00Z is newer than 'hackage.haskell.org'! Falling back to older state (2021-03-10T23:06:54Z). Resolving dependencies... cabal: Could not resolve dependencies: [__0] trying: Win32-network-0.1.0.0 (user goal) [__1] trying: base-4.14.1.0/installed-4.14.1.0 (dependency of Win32-network) [__2] trying: cardano-addresses-3.3.0 (user goal) [__3] rejecting: cardano-addresses:!test (constraint from config file, command line flag, or user target requires opposite flag selection) [__3] trying: cardano-addresses:*test [__4] next goal: aeson (dependency of cardano-addresses) [__4] rejecting: aeson-1.5.6.0, aeson-1.5.5.1, aeson-1.5.5.0, aeson-1.5.4.1, aeson-1.5.4.0, aeson-1.5.3.0, aeson-1.5.2.0, aeson-1.5.1.0, aeson-1.5.0.0 (conflict: cardano-addresses *test => aeson>=1.4.6.0 && <1.5.0.0) [__4] trying: aeson-1.4.7.1 [__5] next goal: cardano-api (user goal) [__5] rejecting: cardano-api-1.26.2 (conflict: aeson==1.4.7.1, cardano-api => aeson>=1.5.6.0) [__5] fail (backjumping, conflict set: aeson, cardano-api) After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: aeson, cardano-addresses:test, cardano-addresses, cardano-api, base, Win32-network Try running with --minimize-conflict-set to improve the error message.
Issue Number
#53
Comments
Use named constants to encode the minimum and maximum passphrase lengths, and use these named constants rather than repeating their values.