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

Fix #62 Change defaultHackageSecurityConfig to be consistent #63

Merged
merged 1 commit into from
Oct 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog for pantry

## v0.7.0

* Change `defaultHackageSecurityConfig` such that field
`hscIgnoreExpiry = True`, to be consistent with the defaults of the
`WithJSONWarnings HackageSecurityConfig` instance of `FromJSON`.

## v0.6.0

* Rename `HackageSecurityConfig` as `PackageIndexConfig`,
Expand Down
2 changes: 1 addition & 1 deletion package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: pantry
version: 0.6.0
version: 0.7.0
synopsis: Content addressable Haskell package management
description: Please see the README on GitHub at <https://github.com/commercialhaskell/pantry#readme>
category: Development
Expand Down
2 changes: 1 addition & 1 deletion pantry.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cabal-version: 1.12
-- see: https://github.com/sol/hpack

name: pantry
version: 0.6.0
version: 0.7.0
synopsis: Content addressable Haskell package management
description: Please see the README on GitHub at <https://github.com/commercialhaskell/pantry#readme>
category: Development
Expand Down
9 changes: 7 additions & 2 deletions src/Pantry/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -636,8 +636,9 @@ instance FromJSON (WithJSONWarnings PackageIndexConfig) where
pure PackageIndexConfig {..}

-- | Default 'HackageSecurityConfig' value using the official Hackage server.
-- The value of the 'hscIgnoreExpiry' field is 'True'.
--
-- @since 0.6.0
-- @since 0.7.0
defaultHackageSecurityConfig :: HackageSecurityConfig
defaultHackageSecurityConfig = HackageSecurityConfig
{ hscKeyIds =
Expand All @@ -648,7 +649,7 @@ defaultHackageSecurityConfig = HackageSecurityConfig
, "fe331502606802feac15e514d9b9ea83fee8b6ffef71335479a2e68d84adc6b0"
]
, hscKeyThreshold = 3
, hscIgnoreExpiry = False
, hscIgnoreExpiry = True
}

-- | Configuration for Hackage Security to securely download package metadata
Expand All @@ -667,6 +668,10 @@ data HackageSecurityConfig = HackageSecurityConfig
}
deriving Show

-- | If the @ignore-expiry@ key is absent from the JSON object, assigns default
-- value 'True'.
--
-- @since 0.1.1.0
instance FromJSON (WithJSONWarnings HackageSecurityConfig) where
parseJSON = withObjectWarnings "HackageSecurityConfig" $ \o -> do
hscKeyIds <- o ..: "keyids"
Expand Down