diff --git a/CHANGELOG.md b/CHANGELOG.md index dd64d162bf88c8a960461785809615ca65b1ecb5..d9b519984f94f308c97c213a33a2c89b253e9a94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Revision history for tahoe-directory -## 0.1.0.0 -- YYYY-mm-dd +## 0.1.0.0 -- 2023-08-17 * First version. Released on an unsuspecting world. +* Support for parsing and serializing CHK and SDMF directory capability strings. +* Support for parsing and serializing directories + (lists of name, capability, metadata tuples). diff --git a/LICENSE b/LICENSE index 7e5ffdaf3e86a33150a46b86a1e32aa00ecd5aa8..194977c48ec40d4be449b00ed2baa665aff1a04b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,6 @@ -Copyright (c) 2023, PrivateStorage.io Inc. +Copyright 2023 +Jean-Paul Calderone +Shae Erisson All rights reserved. diff --git a/README.md b/README.md index e57df89a069249b77f9ccbd6795c9ba65e8cf532..caf690c06aaa481599d6603022709c62fef28c53 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,10 @@ However, its APIs are intended to be easy to integrate with such an implementati ### What is the current state? -* All implementation tasks are pending. +* Verify and read CHK directory capability strings can be parsed and serialized. +* Verify, read, and write SDMF directory capability strings can be parsed and serialized. +* Directories themselves can be parsed and serialized. + * However, capability strings and metadata in directory entries are left as byte strings. ## Why does it exist? diff --git a/flake.lock b/flake.lock index 7b6553f8889506b75c0820f2f318e7379327d637..d56d9f58a116de99943bce5ce38958f760454de6 100644 --- a/flake.lock +++ b/flake.lock @@ -358,11 +358,11 @@ "pre-commit-hooks": "pre-commit-hooks" }, "locked": { - "lastModified": 1686149618, - "narHash": "sha256-/IHWacNutk3tklouWOgClp7FnOH+Yk6If13kKJMSEi8=", + "lastModified": 1692187439, + "narHash": "sha256-m7c4EPFWmB1OmV3dSYQk2qtXR53xOjZdLCjMtzHSK34=", "ref": "main", - "rev": "49696f704eb965f57d729871c6d450ac0aff2b68", - "revCount": 12, + "rev": "408f3deab2e2f6ae60349776dde02c44f71fb386", + "revCount": 16, "type": "git", "url": "https://whetstone.private.storage/jcalderone/hs-flake-utils.git" }, @@ -819,15 +819,16 @@ ] }, "locked": { - "lastModified": 1686164259, - "narHash": "sha256-T0U5B/DH+XDEXfBG7cHlTcMec4aUTDd+HH8Bsv0C71Y=", - "ref": "refs/heads/main", - "rev": "f0a11218007f6c2fe0f6b5e09e0993fe253f6e23", - "revCount": 9, + "lastModified": 1692123220, + "narHash": "sha256-XRR4oGgBc6O4DMM0DyS5STMYZPR6xjEBKAQ+N+0DzZ4=", + "ref": "refs/tags/0.1.0.0", + "rev": "21c23b269e88fe77c116451167b0d2027fdca4b3", + "revCount": 22, "type": "git", "url": "https://whetstone.private.storage/PrivateStorage/tahoe-capabilities" }, "original": { + "ref": "refs/tags/0.1.0.0", "type": "git", "url": "https://whetstone.private.storage/PrivateStorage/tahoe-capabilities" } @@ -894,17 +895,18 @@ ] }, "locked": { - "lastModified": 1686166709, - "narHash": "sha256-z+QzmnfmLuqqNFWvlYAVZoS7jBHEj54OZest/sKgDqk=", - "ref": "refs/heads/main", - "rev": "8f73a87054546c875c3b0284ee4d2f3e0483d963", - "revCount": 93, + "lastModified": 1692193506, + "narHash": "sha256-0UDrh4ZcBHU+4yrLfVe+9wkYF4K1QJoecdOI083Gu5w=", + "ref": "refs/tags/0.2.1.0", + "rev": "96941786b56e9fb949d62a14bacd5ed2c81cd7ab", + "revCount": 112, "type": "git", - "url": "https://whetstone.private.storage/PrivateStorage/tahoe-ssk.git" + "url": "https://whetstone.private.storage/PrivateStorage/tahoe-ssk" }, "original": { + "ref": "refs/tags/0.2.1.0", "type": "git", - "url": "https://whetstone.private.storage/PrivateStorage/tahoe-ssk.git" + "url": "https://whetstone.private.storage/PrivateStorage/tahoe-ssk" } } }, diff --git a/flake.nix b/flake.nix index e5071379920df5838d9abbfcf76d9d9106cd4439..8e000e3b2243265f13609186390f0b0996f73a3c 100644 --- a/flake.nix +++ b/flake.nix @@ -11,12 +11,12 @@ inputs.nixpkgs.follows = "hs-flake-utils/nixpkgs"; }; tahoe-ssk = { - url = "git+https://whetstone.private.storage/PrivateStorage/tahoe-ssk.git"; + url = "git+https://whetstone.private.storage/PrivateStorage/tahoe-ssk?ref=refs/tags/0.2.1.0"; inputs.nixpkgs.follows = "hs-flake-utils/nixpkgs"; inputs.tahoe-chk.follows = "tahoe-chk"; }; tahoe-capabilities = { - url = "git+https://whetstone.private.storage/PrivateStorage/tahoe-capabilities"; + url = "git+https://whetstone.private.storage/PrivateStorage/tahoe-capabilities?ref=refs/tags/0.1.0.0"; inputs.nixpkgs.follows = "hs-flake-utils/nixpkgs"; }; }; @@ -74,15 +74,6 @@ -- This file is auto-generated by the flake devShell's shellHook. Do -- not edit this file. Make changes in flake.nix. tests: true - packages: - -- These aren't released on hackage yet so we have to get them - -- another way. Here, we get them from the Nix store. - -- tahoe-chk - ${tahoe-chk} - -- tahoe-ssk - ${tahoe-ssk} - -- tahoe-capabilities - ${tahoe-capabilities} EOF ''; } @@ -91,21 +82,12 @@ # Using the working directory of `nix run`, do a build with cabal and # then run the test suite. - apps.cabal-test = { - type = "app"; - program = "${ - pkgs.writeShellApplication { - name = "cabal-build-and-test"; - runtimeInputs = with pkgs; [pkg-config haskell.compiler.${ghcVersion} cabal-install]; - - text = '' - nix run .#generate-cabal-project - cabal update hackage.haskell.org - cabal build - cabal run tests - ''; - } - }/bin/cabal-build-and-test"; + apps.cabal-test = hslib.apps.cabal-test { + preBuild = '' + nix run .#generate-cabal-project + ''; }; + + apps.release = hslib.apps.release {}; }); } diff --git a/tahoe-directory.cabal b/tahoe-directory.cabal index de8c35b9a3f23518d1f79f860b24580883efa8aa..e867a288c4a43be2b2a1ccb67df7983b545dedf9 100644 --- a/tahoe-directory.cabal +++ b/tahoe-directory.cabal @@ -18,9 +18,9 @@ name: tahoe-directory -- See the Haskell package versioning policy (PVP) for standards -- guiding when and how versions should be incremented. -- https://pvp.haskell.org --- PVP summary: +-+------- breaking API changes --- | | +----- non-breaking API additions --- | | | +--- code changes with no API change +-- PVP summary: +-+------- breaking API changes +-- | | +----- non-breaking API additions +-- | | | +--- code changes with no API change version: 0.1.0.0 -- A short (one-line) description of the package. @@ -47,18 +47,20 @@ license: BSD-3-Clause license-file: LICENSE -- The package author(s). -author: Jean-Paul Calderone +author: Jean-Paul Calderone and others -- An email address to which users can send suggestions, bug reports, and patches. -maintainer: jean-paul@private.storage +maintainer: exarkun@twistedmatrix.com -- A copyright notice. --- copyright: +copyright: 2023 The Authors category: Cryptography,Library,Parsers,Security build-type: Simple -- Extra doc files to be distributed with the package, such as a CHANGELOG or a README. -extra-doc-files: CHANGELOG.md +extra-doc-files: + CHANGELOG.md + README.md -- Extra source files to be distributed with the package, such as examples, or -- a tutorial module. In our case, test data. @@ -82,7 +84,7 @@ common language source-repository head type: git location: - https://whetstone.private.storage/PrivateStorage/tahoe-directory + https://whetstone.private.storage/PrivateStorage/tahoe-directory.git library import: warnings @@ -95,13 +97,13 @@ library Tahoe.Directory.Internal.Types build-depends: - , base >=4 && <5.0 - , bytestring - , megaparsec - , tahoe-capabilities - , tahoe-chk - , tahoe-ssk - , text + , base >=4 && <5.0 + , bytestring >=0.10.8.2 && <0.11 + , megaparsec >=8.0 && <9.3 + , tahoe-capabilities >=0.1 && <0.2 + , tahoe-chk >=0.1 && <0.2 + , tahoe-ssk >=0.2.1.0 && <0.3 + , text >=1.2.3.1 && <1.3 test-suite tahoe-directory-test -- Import common warning flags. @@ -132,13 +134,13 @@ test-suite tahoe-directory-test -- Test dependencies. build-depends: - , base - , bytestring - , hedgehog - , megaparsec - , tahoe-capabilities + , base >=4 && <5.0 + , bytestring >=0.10.8.2 && <0.11 + , hedgehog >=1.0.3 && <1.1 + , megaparsec >=8.0 && <9.3 + , tahoe-capabilities >=0.1 && <0.2 , tahoe-directory - , tasty - , tasty-hedgehog - , tasty-hunit - , text + , tasty >=1.2.3 && <1.5 + , tasty-hedgehog >=1.0.0.2 && <1.2 + , tasty-hunit >=0.10.0.2 && <0.11 + , text >=1.2.3.1 && <1.3