Skip to content

Commit

Permalink
Scaffold library, CLI program, and HTTP server
Browse files Browse the repository at this point in the history
  • Loading branch information
clehner committed Oct 16, 2020
1 parent 505eb9a commit fd84a1d
Show file tree
Hide file tree
Showing 9 changed files with 128 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: ci

on:
pull_request:
branches:
- main
push:
branches:
- main

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout DIDKit repository
uses: actions/checkout@v2

- name: Checkout SSI library
uses: actions/checkout@v2
with:
repository: spruceid/ssi
token: ${{ secrets.GH_ACCESS_TOKEN_CEL }}

- name: Cache Cargo registry and build artifacts
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml', '**.rs') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Build
run: cargo build --verbose --workspace

- name: Test
run: cargo test --verbose --workspace
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/target
Cargo.lock
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[workspace]
members = [
"http",
"cli",
"lib",
]
13 changes: 13 additions & 0 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "didkit-cli"
version = "0.0.1"
authors = ["Charles E. Lehner <[email protected]>"]
edition = "2018"

[dependencies]
didkit = { path = "../lib" }
structopt = "0.3"

[[bin]]
path = "src/main.rs"
name = "didkit"
46 changes: 46 additions & 0 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
use structopt::StructOpt;

#[derive(StructOpt, Debug)]
enum DIDKit {
// DID Functionality
/// Create new DID Document.
DIDCreate {},
/// Resolve a DID to a DID Document.
DIDResolve {},
/// Dereference a DID URL to a resource.
DIDDereference {},
/// Update a DID Document’s authentication.
DIDUpdateAuthentication {},
/// Update a DID Document’s service endpoint(s).
DIDUpdateServiceEndpoints {},
/// Deactivate a DID.
DIDDeactivate {},
/// Create a Signed IETF JSON Patch to update a DID document.
DIDPatch {},

// VC Functionality
/// Issue Credential
VCIssueCredential {},
/// Verify Credential
VCVerifyCredential {},
/// Issue Presentation
VCIssuePresentation {},
/// Verify Presentation
VCVerifyPresentation {},
/// Revoke Credential
VCRevokeCredential {},

// DIDComm Functionality (???)
/// Discover a messaging endpoint from a DID which supports DIDComm.
DIDCommDiscover {},
/// Send a DIDComm message.
DIDCommSend {},
/// Receive a DIDComm message.
DIDCommReceive {},
}

fn main() {
let opt = DIDKit::from_args();
println!("{:?}", opt);
// TODO
}
8 changes: 8 additions & 0 deletions http/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "didkit-http"
version = "0.0.1"
authors = ["Charles E. Lehner <[email protected]>"]
edition = "2018"

[dependencies]
didkit = { path = "../lib" }
3 changes: 3 additions & 0 deletions http/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
// TODO
}
8 changes: 8 additions & 0 deletions lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "didkit"
version = "0.0.1"
authors = ["Charles E. Lehner <[email protected]>"]
edition = "2018"

[dependencies]
ssi = { path = "../../ssi" }
Empty file added lib/src/lib.rs
Empty file.

0 comments on commit fd84a1d

Please sign in to comment.