powerdns 0.3.0 → 0.4.0
raw patch · 4 files changed
+32/−17 lines, 4 filesdep ~hashablePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: hashable
API changes (from Hackage documentation)
- PowerDNS.API.Zones: RRSet :: CIText -> RecordType -> Word32 -> Maybe ChangeType -> Maybe [Record] -> Maybe [Comment] -> RRSet
+ PowerDNS.API.Zones: RRSet :: CIText -> RecordType -> Maybe Word32 -> Maybe ChangeType -> Maybe [Record] -> Maybe [Comment] -> RRSet
- PowerDNS.API.Zones: [rrset_ttl] :: RRSet -> Word32
+ PowerDNS.API.Zones: [rrset_ttl] :: RRSet -> Maybe Word32
- PowerDNS.Client: RRSet :: CIText -> RecordType -> Word32 -> Maybe ChangeType -> Maybe [Record] -> Maybe [Comment] -> RRSet
+ PowerDNS.Client: RRSet :: CIText -> RecordType -> Maybe Word32 -> Maybe ChangeType -> Maybe [Record] -> Maybe [Comment] -> RRSet
- PowerDNS.Client: [rrset_ttl] :: RRSet -> Word32
+ PowerDNS.Client: [rrset_ttl] :: RRSet -> Maybe Word32
Files
- CHANGELOG.md +4/−0
- PowerDNS/API/Zones.hs +1/−1
- powerdns.cabal +1/−1
- spec/Spec.hs +26/−15
CHANGELOG.md view
@@ -26,3 +26,7 @@ * Rename typod field name `commant_modified_at` to `comment_modified_at` * Wrap `rrset_name` and `zone_name` with new `CIText` wrappers for limited case-sensitivity * Have `Ord` instances of `Zone` and `RRSet` correctly respect limited case-sensitivity++## 0.4.0 -- 2022-03-15++* Wrap `rrset_ttl` with Maybe to correctly allow deleting records
PowerDNS/API/Zones.hs view
@@ -225,7 +225,7 @@ data RRSet = RRSet { rrset_name :: CIText , rrset_type :: RecordType- , rrset_ttl :: Word32+ , rrset_ttl :: Maybe Word32 , rrset_changetype :: Maybe ChangeType , rrset_records :: Maybe [Record] , rrset_comments :: Maybe [Comment]
powerdns.cabal view
@@ -1,6 +1,6 @@ cabal-version: >=1.10 name: powerdns-version: 0.3.0+version: 0.4.0 license: BSD3 license-file: LICENSE copyright: (c) 2021 Victor Nawothnig
spec/Spec.hs view
@@ -20,7 +20,7 @@ {-# NOINLINE baseUrl #-} baseUrl :: BaseUrl-baseUrl = unsafePerformIO (parseBaseUrl "localhost:8081")+baseUrl = unsafePerformIO (parseBaseUrl "pdns:8081") envNoAuth :: ClientEnv envNoAuth = mkClientEnv mgr baseUrl@@ -49,22 +49,22 @@ otherSpecs :: TestTree otherSpecs = testGroup "Case-sensitivity" [ testCase "RRSet does case-insensitive compare on ASCII codepoints" $- assertEqual "" (compare (RRSet "Foo." A 0 Nothing Nothing Nothing)- (RRSet "foo." A 0 Nothing Nothing Nothing))+ assertEqual "" (compare (RRSet "Foo." A (Just 0) Nothing Nothing Nothing)+ (RRSet "foo." A (Just 0) Nothing Nothing Nothing)) EQ , testCase "RRSet does case-insensitive eq on ASCII codepoints" $- assertEqual "" (RRSet "Foo." A 0 Nothing Nothing Nothing)- (RRSet "foo." A 0 Nothing Nothing Nothing)+ assertEqual "" (RRSet "Foo." A (Just 0) Nothing Nothing Nothing)+ (RRSet "foo." A (Just 0) Nothing Nothing Nothing) , testCase "RRSet does case-sensitive compare on non-ASCII codepoints" $- assertEqual "" (compare (RRSet "\335." A 0 Nothing Nothing Nothing)- (RRSet "\375." A 0 Nothing Nothing Nothing))+ assertEqual "" (compare (RRSet "\335." A (Just 0) Nothing Nothing Nothing)+ (RRSet "\375." A (Just 0) Nothing Nothing Nothing)) LT , testCase "RRSet does case-sensitive eq on non-ASCII codepoints" $- assertBool "" ((RRSet "\335." A 0 Nothing Nothing Nothing) /=- (RRSet "\375." A 0 Nothing Nothing Nothing))+ assertBool "" ((RRSet "\335." A (Just 0) Nothing Nothing Nothing) /=+ (RRSet "\375." A (Just 0) Nothing Nothing Nothing)) , testCase "Zone does case-insensitive comparison on ASCII codepoints" $ assertEqual "" (empty { zone_name = Just "Foo." })@@ -95,8 +95,11 @@ runOk (getZone "localhost" zoneId (Just False)) step "Add record to zone"- runOk (updateZone "localhost" zoneId patch)+ runOk (updateZone "localhost" zoneId (patch added)) + step "Delete a record"+ runOk (updateZone "localhost" zoneId (patch deleted))+ step "Delete zone" runOk (deleteZone "localhost" zoneId) @@ -114,19 +117,27 @@ init = [ RRSet { rrset_name = "magic.test.space." , rrset_type = A- , rrset_ttl = 86003+ , rrset_ttl = Just 86003 , rrset_changetype = Nothing , rrset_records = Just [Record "127.0.0.1" False] , rrset_comments = Nothing } ] - patch = empty { zone_type = Just "zone"- , zone_rrsets = Just added- }+ patch what = empty { zone_type = Just "zone"+ , zone_rrsets = Just what+ }+ deleted = [ RRSet { rrset_name = "foo.test.space."+ , rrset_type = AAAA+ , rrset_ttl = Nothing+ , rrset_changetype = Just Delete+ , rrset_records = Just []+ , rrset_comments = Nothing+ }+ ] added = [ RRSet { rrset_name = "foo.test.space." , rrset_type = AAAA- , rrset_ttl = 1234+ , rrset_ttl = Nothing , rrset_changetype = Nothing , rrset_records = Just [Record "::1" False] , rrset_comments = Nothing