If you haven't already, get started with Rust.
See CONVENTIONS.md for coding standards, linting, and pre-commit workflow.
Concurrent Postgres instances during testing can exhaust shared memory on macOS. Adjusting shared memory is not straightforward — use this guide.
Unit tests and "PM mode" use an embedded Postgres instance installed automatically on the local filesystem. You can also use an external database.
podman-compose -f etc/deploy/compose/compose.yaml upenv PGPASSWORD=trustify psql -U postgres -d trustify -h localhost -p 5432If psql is not available locally:
podman-compose -f etc/deploy/compose/compose.yaml exec postgres psql -U postgres -d trustifyRUST_LOG=info cargo run --bin trustd api --db-password trustify --devmode --auth-disabledRun cargo run --bin trustd api --help for all database options.
By default, authentication is enabled. For development, you have two options:
- Disable auth:
--auth-disabledflag orAUTH_DISABLED=trueenv var - Dev mode:
--devmodeuses the Keycloak instance from the compose deployment
For full OIDC setup, see oidc.md.
HTTP requests must provide a bearer token via the Authorization header.
You can use the oidc-cli tool:
cargo install oidc-cliSet up the client (re-run when Keycloak is re-created):
oidc create confidential trusty \
--issuer http://localhost:8090/realms/trustify \
--client-id walker \
--client-secret ZVzq9AMOVUdMY1lSohpx1jI3aW56QDPSMake authenticated requests:
curl -H "Authorization: Bearer $(oidc token trusty -b)" \
http://localhost:8080/purl/asdf/dependencies| Directory | Purpose |
|---|---|
common |
Shared model types used across modules |
entity |
Database entity models (SeaORM) |
migration |
SeaORM DDL migrations |
modules |
Primary application behavior |
server |
REST API server |
trustd |
Server CLI binary |
| Directory | Purpose |
|---|---|
etc/test-data |
Test data for unit tests |
etc/datasets |
Integrated data bundles for demos |
etc/deploy |
Deployment files (compose, etc.) |
Bundled datasets are available in etc/datasets:
cd etc/datasets && make
curl -X POST http://localhost:8080/api/v3/dataset \
--data-binary @ds1.zip -H "Content-Type: application/zip"Use the upload page at http://localhost:8080/upload
curl -X POST http://localhost:8080/api/v3/sbom \
--data-binary @some-sbom.json -H "Content-Type: application/json"
curl -X POST http://localhost:8080/api/v3/advisory \
--data-binary @some-advisory.json -H "Content-Type: application/json"Configure importers to regularly fetch from remote sources. See modules/importer/README.md.