Commit Graph
52 Commits
Author SHA1 Message Date
Khushboo Mehta c3c97abe0e feat: add unit test fir display_name field behaviour 2026-06-19 14:55:47 +02:00
Khushboo-dev-cpp ab885df364 Merge pull request #27 from logos-co/feat/addDisplayNameInManifest
feat: add support for displayName in manifest files
2026-06-19 14:32:58 +02:00
Khushboo Mehta ae39cebc89 feat: add support for displayname in manifest files 2026-06-19 14:22:15 +02:00
Iuri Matias e2b22ddf91 Merge pull request #26 from logos-co/doctests
add doctests
2026-06-16 16:02:30 -04:00
Iuri Matias ae4128daa7 add doctests 2026-06-16 15:57:24 -04:00
Iuri Matias 41cae9e454 Merge pull request #25 from logos-co/fix/f_007_avoid_decompression_bomb
fix: f007: avoid decompression bombs
2026-06-10 17:49:46 -04:00
Iuri Matias 6fe6559bd4 fix: f007: avoid decompression bombs 2026-06-10 12:47:14 -04:00
Iuri Matias a2eec36945 Merge pull request #24 from logos-co/fix/f_003_dot_dot_entries
fix: f003: validate ../ entries before extracting
2026-06-08 15:57:23 -04:00
Iuri Matias d9721aa933 address copilot review 2026-06-08 15:54:49 -04:00
Iuri Matias 74a6de547a fix: f003: valid ../ entries before extracting 2026-06-08 15:01:42 -04:00
Dario LipicarandClaude Opus 4.7 d2c98d34cc add lgx signature — dump raw manifest.sig bytes (#23)
* add `lgx signature` — dump raw manifest.sig bytes

Symmetric to `lgx manifest --json`: a machine-readable extractor for
the package's signature blob. Until now the only way to get the raw
manifest.sig out of an .lgx was to extract via `tar -O -xzf` — fine in
CI (release.yml does it) but awkward elsewhere.

Out-of-CI tooling that reproduces what `logos-modules-release-action`
records under `sidecar.json#signature` (e.g. a local index.json builder
for a non-GitHub-hosted catalog) needs the raw signature alongside the
manifest. With `lgx manifest --json` + this new `lgx signature`, both
halves of a signed package's envelope are available without shelling
out to `tar` or knowing the archive layout.

Contract:
  - Signed package: stdout = manifest.sig bytes verbatim
    (byte-identical to the file inside the .lgx), exit 0.
  - Unsigned package: stdout empty, exit 0.
  - Bad / missing package: stderr message, exit 1.

Callers distinguish "no signature" from "error" via the exit status,
not the stream length — matches the existing convention for
unsigned-package handling elsewhere in the codebase.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* address PR #23 review

* Distinguish malformed package from unsigned. `Package::load` accepts
  any valid-tar-gzip .lgx, including pathological ones with no
  `manifest.json` at all — in which case the previous code exited 0
  with empty stdout, indistinguishable from a genuinely unsigned
  package. Now: missing manifest.json → exit 1 with a message, so the
  "signed-vs-unsigned-vs-error" contract holds for malformed inputs
  too.

* Set stdout to binary on Windows before writing the signature bytes
  so `\n` doesn't get translated to `\r\n`. POSIX stdout is already
  binary; the `#ifdef _WIN32` guard is the whole Windows-only
  difference. Without this, the "byte-identical to the file inside
  the .lgx" contract silently broke on Windows.

* Add CLI tests in tests/test_cli.cpp covering the three branches of
  the documented contract: unsigned → empty + exit 0; signed →
  manifest.sig JSON (with `did` + `signature` fields) + exit 0;
  missing path → message + non-zero exit. Test infra reuses the
  existing CLITest fixture / runLgx helper.

* Clarify the README example that pipes `lgx signature` into `jq` —
  it's a signed-package-only pipeline, and the unsigned case would
  make jq error on the empty stream. Gate the example accordingly.

Verified locally: `ws test logos-package` PASSes; a hand-crafted
tar+gzip with no manifest.json now produces the explicit
"malformed .lgx — not the same as an unsigned package" error and
exits 1, where previously it silently returned exit 0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-01 18:03:37 -03:00
Dario Lipicar 18b00759e0 add manifest command (#22) 2026-05-11 20:46:54 -03:00
Dario Gabriel Lipicar 118ccc4efd properly add view field to merged package 2026-04-30 15:55:42 -03:00
Khushboo-dev-cpp ff93a0df15 Merge pull request #21 from logos-co/feat/addViewField
feat: add view field needed for view modules
2026-04-10 17:30:37 +02:00
Khushboo Mehta 9537a298a9 feat: add view field needed for view modules 2026-04-10 00:10:21 +02:00
Dario LipicarandClaude Opus 4.6 64edea0e64 Add package signature and validation (#20)
* feat: add DID-based identity for package signing with comprehensive tests

- Add did:jwk identity layer (base64url, publicKeyToDid, didToPublicKey)
- Replace raw public keys with DID strings in manifest.sig
- Add signer metadata (name, url) and linkedDids placeholder
- JWK private key format (.jwk) replaces PEM (.secret)
- JSON-based keyring with DID lookup
- Make content hashes mandatory (recomputed on every content change)
- Add keygen, keyring, sign commands with DID support
- Add C API (lgx.h) with DID-based signature types
- Add comprehensive test coverage for crypto, keyring, signing, hashes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: replace hashes_valid with package_valid in SignatureInfo

verifySignature() now validates the package (structure + hashes) first
via validatePackage(), removing duplicate hash verification. The
hashes_valid field is replaced by package_valid which reflects the
full package validation result.

- Extract validatePackage() from verify() as non-static instance method
- verify() now delegates to load() + validatePackage()
- verifySignature() calls validatePackage() before checking signature
- Remove duplicate Merkle tree verification from verifySignature()
- Update C API, tests, and downstream consumers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: signPackage validates instead of recomputing hashes

signPackage() now calls validatePackage() to ensure the package is
valid (structure + hashes) before signing. It no longer recomputes
hashes — hashes are already kept up to date by addVariant/removeVariant.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: add lgx_keyring_list C API for listing trusted keys

Adds lgx_keyring_list() and lgx_free_keyring_list() to the C API,
enabling downstream consumers to enumerate trusted keys in the keyring.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: add custom directory options to keygen, keyring, sign, and verify CLI commands

- keygen: --output-dir / -o to specify key output directory
- keyring: --dir / -d to specify keyring directory
- sign: --keys-dir / -d to specify keys directory
- verify: --keyring-dir to specify keyring directory for trust lookup

All default to the standard ~/.config/logos/ paths when not specified.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: update spec, project, and README for directory options and TOFU removal

- Add --output-dir, --keys-dir, --dir, --keyring-dir options to CLI docs
- Add signing/keyring C API functions to project.md
- Add test_crypto.cpp and libsodium to project.md
- Remove --tofu from install-time verification docs
- Update lifecycle example with signing and trust management steps

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: address PR review feedback — security, robustness, and clarity

Security:
- Validate key names in keyring to prevent path traversal attacks
- Add missing <cstdlib> include for std::getenv

Robustness:
- Detect malformed manifest.sig (report as invalid, not unsigned)
- Fail validation when crypto::init() fails instead of skipping hashes
- Check init() return value in sign() and verify()
- Handle zero-length input in base64 encode functions
- Check ensureDirectory() path is actually a directory

Clarity:
- Label signer name/URL as self-asserted in verify output
- Update manifest.cpp comment: hashes for integrity, not just signing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: make recomputeHashes return Result to fail loudly on crypto errors

Previously recomputeHashes() silently returned without setting hashes
when crypto::init() failed. Now addVariant/removeVariant propagate
the error so packages are never saved without hashes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-08 16:42:29 -03:00
jakub 152ed28e00 chore: add missing MIT and Apache v2 licenses
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2026-03-25 17:15:14 +01:00
Iuri Matias 9e3730d5c0 Merge pull request #19 from logos-co/update_follows
follow logos-nix for nix packages
2026-03-19 20:06:13 -04:00
Iuri Matias a9a1baf48b follow logos-nix for nix packages 2026-03-19 20:05:33 -04:00
Iuri Matias 6aabeedc89 Merge pull request #18 from logos-co/update_logos_sdk
update logos-cpp-sdk
2026-03-17 10:37:26 -04:00
Dario LipicarandCopilot Autofix powered by AI 08966ab002 add merge command (#17)
* add merge command

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* fixes

* update docs

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-17 09:57:13 -03:00
Iuri Matias cd87cb375c update logos-cpp-sdk 2026-03-16 18:04:10 -04:00
Iuri Matias cc8c23d6ed add tests derivation 2026-03-11 12:37:05 -04:00
Iuri Matias 02fae070cc Merge pull request #15 from logos-co/fix/preserve-file-permissions
fix: Preserve file permissions when writing tar.
2026-03-05 06:30:35 -05:00
Dario Gabriel Lipicar 306e5c6b85 bugfix 2026-03-03 22:00:58 +00:00
Alejandro Cabeza Romero 8696e08b4b Preserve file permissions when writing tar. 2026-03-03 18:02:44 +01:00
Dario Lipicar d9a741359b add icon field to manifest (#14)
* add icon field to manifest

* run tests only during the build
2026-02-23 20:01:11 -03:00
Dario Lipicariurimatiascopilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>Iuri Matias
9fefc4d166 add getter for manifest json (#12)
* add getter for manifest json

* Initial plan

* docs: add lgx_get_manifest_json to C API reference

Co-authored-by: iurimatias <176720+iurimatias@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: iurimatias <176720+iurimatias@users.noreply.github.com>
Co-authored-by: Iuri Matias <iuri.matias@gmail.com>
2026-02-19 12:29:12 -03:00
Iuri Matias 45a666c44b Merge pull request #8 from logos-co/use_nixfollows
use nixpkgs.follows to avoid compatbility issues
2026-02-04 17:35:30 -05:00
Iuri Matias 8e47e18fb8 use nixpkgs.follows to avoid compatbility issues 2026-02-04 17:34:49 -05:00
Iuri Matias 9230ae37c9 Merge pull request #6 from logos-co/fix_add
fix when adding directory to variant such that --files ./lib/some_dir/files are added as files and not as ./lib/some_dir/files
2026-01-20 11:12:26 -05:00
Iuri Matias e11babb9f9 fix when adding directory to variant such that --files ./lib/some_dir/files are added as files and not as ./lib/some_dir/files 2026-01-20 11:11:42 -05:00
Iuri Matias 94e73c5804 Merge pull request #5 from logos-co/extract_lgx
add support for lgx extract in cli and lib
2026-01-19 16:45:54 -05:00
Iuri Matias 006c7fb0df add support for lgx extract in cli and lib
add support for lgx extract in cli and lib

cleanup

cleanup

cleanup
2026-01-19 16:42:36 -05:00
Iuri Matias c90fb784a4 Merge pull request #4 from logos-co/github_action
add github action to run lgx tests
2026-01-19 16:42:10 -05:00
Iuri Matias b546d7e40d add github action to run lgx tests 2026-01-19 16:37:07 -05:00
Iuri Matias e1c2607da4 Clean up project documentation structure
Removed outdated specification files and clarified documentation structure.
2026-01-15 15:39:38 -05:00
Iuri Matias 1479b007af Merge pull request #3 from logos-co/nix_default
Make test runnable on nix, update docs
2026-01-15 12:37:29 -05:00
Iuri Matias c2d2aa9050 update docs
update docs

update docs

update docs
2026-01-15 12:36:52 -05:00
Iuri Matias 2b540558fa make tests runnable on nix 2026-01-15 12:09:25 -05:00
Iuri Matias 2447825ab8 Merge pull request #2 from logos-co/lib
Support Compiling as a Library
2026-01-15 12:06:17 -05:00
Iuri Matias 7589429e79 update docs 2026-01-15 11:56:43 -05:00
Iuri Matias 8b7f5e1ef6 fix tests 2026-01-15 11:46:05 -05:00
Iuri Matias 5723cc9d78 support compiling lgx as a lib 2026-01-15 11:46:05 -05:00
Iuri Matias 31455af6aa Merge pull request #1 from logos-co/create_package
Initial implementation
2026-01-15 11:45:02 -05:00
Iuri Matias 18143da3b3 add docs/specs 2026-01-15 11:43:59 -05:00
Iuri Matias 9177fad40e add nix build 2026-01-14 20:05:57 -05:00
Iuri Matias 23ca76ceaa add cli tests to test binary end to end 2026-01-14 19:41:40 -05:00
Iuri Matias 5f8b7301f9 update README 2026-01-14 15:42:21 -05:00
Iuri Matias caaae68172 add tests
add tests

add tests
2026-01-14 15:42:04 -05:00