18 Commits
Author SHA1 Message Date
Khushboo Mehta cde1984e8d feat: suport provides field for intents 2026-08-27 10:15:23 +02:00
Khushboo Mehta 63780b2461 feat: manifest 0.4.0 — variant-independent icon in assets/
`icon` moves from a per-variant copy to a single assets/icon.png at the
  package root, so a host can read it without unpacking a platform build —
  the precondition for showing icons before install. Covered by the Merkle
  tree, so it is authenticated by manifest.sig for free.

  Adds `lgx add --icon` and Package::setIcon(). Validation (PNG, exactly
  256x256) runs at verify/sign, not at create/add — a package is
  legitimately incomplete mid-assembly.

  Required for type ui_qml only; core modules render no tile.

  Manifests below 0.4.0 are exempt: icon: "" was legal at 0.3.0 and is what
  lgx create defaulted to, so enforcing it would make every published
  package uninstallable
2026-08-10 11:01:16 +02:00
Khushboo Mehta ae39cebc89 feat: add support for displayname in manifest files 2026-06-19 14:22:15 +02:00
Iuri Matias 6fe6559bd4 fix: f007: avoid decompression bombs 2026-06-10 12:47:14 -04:00
Iuri Matias 74a6de547a fix: f003: valid ../ entries before extracting 2026-06-08 15:01:42 -04:00
Dario Lipicar 18b00759e0 add manifest command (#22) 2026-05-11 20:46:54 -03: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
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
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 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 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 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 c2d2aa9050 update docs
update docs

update docs

update docs
2026-01-15 12:36:52 -05:00
Iuri Matias 7589429e79 update docs 2026-01-15 11:56:43 -05:00
Iuri Matias 18143da3b3 add docs/specs 2026-01-15 11:43:59 -05:00