Skip to content

Commit

Permalink
Merge pull request #223 from alan-turing-institute/update-publish
Browse files Browse the repository at this point in the history
* Merge changes from #192 and #220

* Add features for HTTP, ION and FFI

* Add release-plz workflow
  • Loading branch information
sgreenbury authored Jan 28, 2025
2 parents 39da62d + 7ea4694 commit 10a28e2
Show file tree
Hide file tree
Showing 95 changed files with 428 additions and 271 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/release-plz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Release-plz

permissions:
pull-requests: write
contents: write

on:
push:
branches:
- publish

jobs:

# Release unpublished packages.
release-plz-release:
name: Release-plz release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Run release-plz
uses: release-plz/[email protected]
with:
command: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

# Create a PR with the new versions and changelog, preparing the next release.
release-plz-pr:
name: Release-plz PR
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Run release-plz
uses: release-plz/[email protected]
with:
command: release-pr
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
5 changes: 5 additions & 0 deletions .release-plz.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Example config: https://release-plz.dev/docs/config#example
[workspace]
# changelog_config = "config/git-cliff.toml" # use a custom git-cliff configuration
changelog_update = false # disable changelog updates
dependencies_update = true # update dependencies with `cargo update`
91 changes: 75 additions & 16 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,28 +1,87 @@
[package]
name = "trustchain"
version = "0.2.0"
authors = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
description = "Trustchain decentralised PKI reference implementation."

[workspace]
members = ["crates/*"]
resolver = "2"

[workspace.package]
authors = ["Trustchain Devs"]
license = "MIT OR Apache-2.0"
description = "Trustchain decentralised PKI reference implementation."
homepage = "https://alan-turing-institute.github.io/trustchain/"
repository = "https://github.com/alan-turing-institute/trustchain/"
keywords = ["pki", "did", "vc", "vp"]
edition = "2021"
edition = "2021"

[workspace]
members = [
"trustchain-core",
"trustchain-ion",
"trustchain-http",
"trustchain-api",
"trustchain-cli",
"trustchain-ffi"
]
resolver = "2"
[workspace.dependencies]
anyhow = "1.0"
async-trait = "0.1"
axum = "0.6"
axum-server = "0.5.1"
axum-test-helper = "0.2.0"
bip39 = "2.0.0"
bitcoin = "0.29.2"
bitcoincore-rpc = "0.16.0"
chrono = "0.4.26"
clap = "4.0.32"
did-ion = "0.2"
did-method-key = "0.2.2"
ed25519-dalek-bip32 = "0.3.0"
flate2 = "1.0.24"
flutter_rust_bridge = "=1.64.0"
futures = "0.3.28"
glob = "0.3"
hex = "0.4.3"
hyper = "0.14.26"
image = "0.23.14"
ipfs-api-backend-hyper = "0.6"
ipfs-hasher = "0.13.0"
is_empty = "0.2.0"
itertools = "0.13.0"
josekit = "0.8"
k256 = "0.13.1"
lazy_static = "1.4.0"
log = "0.4"
mockall = "0.11.4"
mongodb = "2.3.1"
petgraph = "0.6"
port_check = "0.2.1"
qrcode = "0.12.0"
rand = "0.8"
reqwest = "0.11.16"
secp256k1 = "0.27.0"
serde = "1.0"
serde_jcs = "0.1.0"
serde_json = "1.0"
serde_with = "3.4.0"
sha2 = "0.10.7"
shellexpand = "3.1.0"
ssi = "0.7"
tempfile = "3.9.0"
thiserror = "1.0"
tokio = "1.20.1"
toml = "0.7.2"
tower = "0.4"
tracing = "0.1"
tracing-subscriber = "0.3"

[dependencies]
trustchain-api = { path = "./trustchain-api", version = "0.1.0"}
trustchain-core = { path = "./trustchain-core", version = "0.2.0"}
trustchain-ffi = { path = "./trustchain-ffi", version = "0.1.0"}
trustchain-http = { path = "./trustchain-http", version = "0.1.0"}
trustchain-ion = { path = "./trustchain-ion", version = "0.2.0"}
trustchain-api = { path = "crates/trustchain-api", version = "0.1.0" }
trustchain-core = { path = "crates/trustchain-core", version = "0.2.0" }
trustchain-ffi = { path = "crates/trustchain-ffi", version = "0.1.0", optional = true }
trustchain-http = { path = "crates/trustchain-http", version = "0.1.0", optional = true }
trustchain-ion = { path = "crates/trustchain-ion", version = "0.2.0", optional = true }

[features]
default = []
http = ["dep:trustchain-http"]
ion = ["dep:trustchain-ion"]
ffi = ["dep:trustchain-ffi"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ cargo build
```
Install the Trustchain CLI with:
```shell
cargo install --path trustchain-cli
cargo install --path crates/trustchain-cli
```

## Usage Guide
Expand Down
25 changes: 25 additions & 0 deletions crates/trustchain-api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[package]
name = "trustchain-api"
version = "0.1.0"
authors = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
description = "API for Trustchain."

[dependencies]

async-trait = { workspace = true }
chrono = { workspace = true }
did-ion = { workspace = true }
futures = { workspace = true }
hex = { workspace = true }
serde_json = { workspace = true }
sha2 = { workspace = true }
ssi = { workspace = true, features = ["http-did", "secp256k1"] }
trustchain-core = { path = "../trustchain-core" }
trustchain-ion = { path = "../trustchain-ion" }

[dev-dependencies]
tokio = { workspace = true, features = ["full"] }
Original file line number Diff line number Diff line change
Expand Up @@ -351,12 +351,11 @@ mod tests {
TrustchainDataAPI, TrustchainVCAPI, TrustchainVPAPI, DATA_CREDENTIAL_TEMPLATE,
};
use crate::TrustchainAPI;
use did_ion::sidetree::PublicKeyEntry;
use sha2::{Digest, Sha256};
use ssi::jsonld::ContextLoader;
use ssi::ldp::now_ns;
use ssi::one_or_many::OneOrMany;
use ssi::vc::{Credential, CredentialOrJWT, CredentialSubject, Presentation, VCDateTime, URI};
use ssi::vc::{Credential, CredentialOrJWT, Presentation, VCDateTime, URI};
use trustchain_core::utils::init;
use trustchain_core::vc::{CredentialError, DataCredentialError};
use trustchain_core::vp::PresentationError;
Expand Down
File renamed without changes.
27 changes: 27 additions & 0 deletions crates/trustchain-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[package]
name = "trustchain-cli"
version = "0.1.0"
authors = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
description = "CLI for Trustchain."

[[bin]]
name = "trustchain-cli"
path = "src/bin/main.rs"

[dependencies]

clap = { workspace = true, features = ["derive", "cargo"] }
lazy_static = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
ssi = { workspace = true, features = ["http-did", "secp256k1"] }
tokio = { workspace = true, features = ["full"] }
toml = { workspace = true }
trustchain-api = { path = "../trustchain-api" }
trustchain-core = { path = "../trustchain-core" }
trustchain-http = { path = "../trustchain-http" }
trustchain-ion = { path = "../trustchain-ion" }
File renamed without changes.
File renamed without changes.
File renamed without changes.
25 changes: 25 additions & 0 deletions crates/trustchain-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[package]
name = "trustchain-core"
version = "0.2.0"
authors = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
description = "Core Trustchain functionality."

[dependencies]
async-trait = { workspace = true }
base64 = "0.13"
did-method-key = { workspace = true }
petgraph = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_jcs = { workspace = true }
serde_json = { workspace = true }
sha2 = { workspace = true }
ssi = { workspace = true, features = ["http-did", "secp256k1"] }
tempfile = { workspace = true }
thiserror = { workspace = true }

[dev-dependencies]
mockall = { workspace = true }
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ mod tests {
fn test_display() -> Result<(), GraphError> {
let chains = vec![test_chain(), test_chain()];
let graph = TrustchainGraph::new(&chains, DEFAULT_LABEL_WIDTH)?;
format!("{}", graph);
let _ = format!("{}", graph);
Ok(())
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
32 changes: 32 additions & 0 deletions crates/trustchain-ffi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[package]
name = "trustchain-ffi"
version = "0.1.0"
authors = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
description = "FFI for Trustchain."

[lib]
crate-type = ["cdylib", "staticlib", "lib"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]

anyhow = { workspace = true }
chrono = { workspace = true }
did-ion = { workspace = true }
# Fixed to same version used to generate bridge: `[email protected]`
flutter_rust_bridge = { workspace = true }
lazy_static = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
ssi = { workspace = true, features = ["http-did", "secp256k1"] }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["rt-multi-thread"] }
toml = { workspace = true }
trustchain-api = { path = "../trustchain-api" }
trustchain-core = { path = "../trustchain-core" }
trustchain-http = { path = "../trustchain-http" }
trustchain-ion = { path = "../trustchain-ion" }
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 10a28e2

Please sign in to comment.