Skip to content

Commit

Permalink
release v0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Apr 24, 2024
1 parent e8e8fce commit e340d02
Show file tree
Hide file tree
Showing 9 changed files with 78 additions and 69 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-20.04, ubuntu-22.04, macos-12, macos-13, windows-2019, windows-2022 ]
os: [
ubuntu-20.04, ubuntu-22.04, macos-12, macos-13,
# windows-2019, windows-2022
]
steps:
- uses: actions/checkout@v2
- name: Install rust stable
Expand All @@ -71,7 +74,7 @@ jobs:
strategy:
fail-fast: false
matrix:
toolchain: [ nightly, beta, stable, 1.75.0 ]
toolchain: [ nightly, beta, stable, 1.70.0 ]
steps:
- uses: actions/checkout@v2
- name: Install rust ${{ matrix.toolchain }}
Expand Down
80 changes: 40 additions & 40 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,43 @@ on:
env:
CARGO_TERM_COLOR: always

jobs:
codecov:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, llvm-tools-preview
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release
env:
CARGO_INCREMENTAL: "0"
RUSTFLAGS: "-Cinstrument-coverage"
RUSTDOCFLAGS: "-Cinstrument-coverage"
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --no-fail-fast
env:
CARGO_INCREMENTAL: "0"
RUSTFLAGS: "-Cinstrument-coverage"
RUSTDOCFLAGS: "-Cinstrument-coverage"
- name: Install grcov
run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo install grcov; fi
- name: Generate coverage
run: grcov . --binary-path target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --ignore '../**' --ignore '/*' -o coverage.lcov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage.lcov
flags: rust
fail_ci_if_error: true
jobs: [ ]
# codecov:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Set up toolchain
# uses: actions-rs/toolchain@v1
# with:
# profile: minimal
# toolchain: stable
# override: true
# components: rustfmt, llvm-tools-preview
# - name: Build
# uses: actions-rs/cargo@v1
# with:
# command: build
# args: --release
# env:
# CARGO_INCREMENTAL: "0"
# RUSTFLAGS: "-Cinstrument-coverage"
# RUSTDOCFLAGS: "-Cinstrument-coverage"
# - name: Test
# uses: actions-rs/cargo@v1
# with:
# command: test
# args: --all-features --no-fail-fast
# env:
# CARGO_INCREMENTAL: "0"
# RUSTFLAGS: "-Cinstrument-coverage"
# RUSTDOCFLAGS: "-Cinstrument-coverage"
# - name: Install grcov
# run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo install grcov; fi
# - name: Generate coverage
# run: grcov . --binary-path target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --ignore '../**' --ignore '/*' -o coverage.lcov
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v3
# with:
# files: ./coverage.lcov
# flags: rust
# fail_ci_if_error: true
30 changes: 15 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ jobs:
with:
command: test
args: --workspace --all-features --no-fail-fast
wasm-testing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install rust nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- uses: Swatinem/rust-cache@v2
- uses: jetli/[email protected]
- name: Add wasm32 target
run: rustup target add wasm32-unknown-unknown
- name: Test in headless Chrome
run: wasm-pack test --headless --chrome
# wasm-testing:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Install rust nightly
# uses: actions-rs/toolchain@v1
# with:
# toolchain: nightly
# override: true
# - uses: Swatinem/rust-cache@v2
# - uses: jetli/[email protected]
# - name: Add wasm32 target
# run: rustup target add wasm32-unknown-unknown
# - name: Test in headless Chrome
# run: wasm-pack test --headless --chrome
2 changes: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 10 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
[package]
name = "s2id"
version = "0.1.0"
description = "Self-sovereign identity library and command-lie"
keywords = ["did", "ssi", "identity", "pgp", "gpg"]
categories = ["encoding", "value-formatting", "command-line-utilities"]
readme = "README.md"
authors = ["Dr. Maxim Orlovsky <[email protected]>"]
homepage = "https://github.com/LNP-BP/ssi"
repository = "https://github.com/LNP-BP/ssi"
edition = "2021"
rust-version = "1.70.0"
license = "Apache-2.0"

[lib]
name = "ssi"
Expand All @@ -23,14 +32,11 @@ shellexpand = { version = "3.1.0", optional = true }
sha2 = "0.10.8"
fluent-uri = "0.1.4"
percent-encoding = "2.3.1"

# Cli-specific
rpassword = { version = "7.3.1", optional = true }
aes = { version = "0.8.4", optional = true }
crossbeam-channel = { version = "0.5.12", optional = true }

mnemonic = "1.0.1"
base64 = "0.22.0"

[features]
default = ["cli"]
cli = ["clap", "crossbeam-channel", "shellexpand", "rpassword", "aes"]
2 changes: 1 addition & 1 deletion MANIFEST.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Type: Library
Kind: Free software
License: Apache-2.0
Language: Rust
Compiler: 1.75
Compiler: 1.70
Author: Maxim Orlovsky
Maintained: LNP/BP Standards Association, Switzerland
Maintainers:
Expand Down
4 changes: 2 additions & 2 deletions src/ed25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use crate::{Algo, Chain, InvalidPubkey, InvalidSig, SsiPub, SsiSig};
pub struct Ed25519Secret(pub(crate) SecretKey);

impl Ord for Ed25519Secret {
fn cmp(&self, other: &Self) -> Ordering { self.0.as_slice().cmp(&other.0.as_slice()) }
fn cmp(&self, other: &Self) -> Ordering { self.0.as_slice().cmp(other.0.as_slice()) }
}

impl PartialOrd for Ed25519Secret {
Expand Down Expand Up @@ -107,7 +107,7 @@ impl SsiPub {
pub fn verify_ed25519(self, msg: [u8; 32], sig: SsiSig) -> Result<(), InvalidSig> {
let sig = Signature::from_slice(&sig.0).map_err(|_| InvalidSig::InvalidData)?;
let pk = PublicKey::try_from(self)?;
pk.verify(&msg, &sig).map_err(|err| {
pk.verify(msg, &sig).map_err(|err| {
eprintln!("{err}");
InvalidSig::InvalidSig
})
Expand Down
4 changes: 3 additions & 1 deletion src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

pub const SSI_DIR: &'static str = "~/.ssi";
pub const SSI_DIR: &str = "~/.ssi";

use std::collections::{BTreeSet, HashSet};
use std::fs;
Expand Down Expand Up @@ -63,6 +63,7 @@ impl SsiRuntime {
.read(true)
.write(true)
.create(true)
.truncate(false)
.open(path)?;
let mut permissions = file.metadata()?.permissions();
permissions.set_mode(0o600);
Expand All @@ -79,6 +80,7 @@ impl SsiRuntime {
.read(true)
.write(true)
.create(true)
.truncate(false)
.open(path)?;
let mut permissions = file.metadata()?.permissions();
permissions.set_mode(0o600);
Expand Down
4 changes: 2 additions & 2 deletions src/secret.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ impl SsiSecret {
fn replace(&mut self, secret: &[u8]) {
match self {
SsiSecret::Bip340(_, sk) => {
sk.0 = secp256k1::SecretKey::from_slice(&secret).expect("same size")
sk.0 = secp256k1::SecretKey::from_slice(secret).expect("same size")
}
SsiSecret::Ed25519(_, sk) => {
sk.0 = ec25519::SecretKey::from_slice(&secret).expect("same size")
sk.0 = ec25519::SecretKey::from_slice(secret).expect("same size")
}
}
}
Expand Down

0 comments on commit e340d02

Please sign in to comment.