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

Encode the minimum and maximum passphrase lengths just once. #124

Merged
merged 1 commit into from
Mar 27, 2019

Conversation

jonathanknowles
Copy link
Member

@jonathanknowles jonathanknowles commented Mar 27, 2019

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.

@jonathanknowles jonathanknowles force-pushed the jonathanknowles/encode-limits-just-once branch from 09bcb04 to f418d29 Compare March 27, 2019 02:02
@jonathanknowles jonathanknowles self-assigned this Mar 27, 2019
passphraseMinLength = 10

passphraseMaxLength :: Int
passphraseMaxLength = 255
Copy link
Member Author

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?

Copy link
Member

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.

@jonathanknowles jonathanknowles force-pushed the jonathanknowles/encode-limits-just-once branch from f418d29 to 54fc24f Compare March 27, 2019 02:52
@KtorZ
Copy link
Member

KtorZ commented Mar 27, 2019

@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.
@KtorZ KtorZ force-pushed the jonathanknowles/encode-limits-just-once branch from 54fc24f to 7998cbb Compare March 27, 2019 07:52
@KtorZ KtorZ merged commit f771022 into master Mar 27, 2019
@KtorZ KtorZ deleted the jonathanknowles/encode-limits-just-once branch March 27, 2019 08:22
Anviking added a commit that referenced this pull request Apr 19, 2021
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.
Anviking added a commit that referenced this pull request Apr 19, 2021
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.
rvl pushed a commit that referenced this pull request Apr 20, 2021
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants