Skip to content

Commit

Permalink
Merge branch 'hyperledger-main' into gm/1306-cheqd-anoncreds-read
Browse files Browse the repository at this point in the history
Signed-off-by: George Mulhearn <[email protected]>
  • Loading branch information
gmulhearn-anonyome committed Dec 12, 2024
2 parents 06f9afd + 78dce27 commit e5bee98
Show file tree
Hide file tree
Showing 22 changed files with 307 additions and 311 deletions.
31 changes: 0 additions & 31 deletions .github/actions/setup-codecov-rust/action.yml

This file was deleted.

57 changes: 16 additions & 41 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:
DOCKER_REPO_LOCAL_VDRPROXY: vdrproxy
DOCKER_REPO_LOCAL_AATH: aath-backchannel

RUST_TOOLCHAIN_VERSION: 1.79.0
RUST_TOOLCHAIN_VERSION: 1.79
NODE_VERSION: 18.x

jobs:
Expand All @@ -29,7 +29,7 @@ jobs:
uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2023-05-08
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
components: rustfmt
override: true
- name: "Install just"
Expand Down Expand Up @@ -97,11 +97,8 @@ jobs:
echo "DOCKER_IMG_CACHED_VDRPROXY ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_VDRPROXY }}"
echo "DOCKER_IMG_CACHED_AATH ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_AATH }}"
workspace_clippy:
clippy:
runs-on: ubuntu-20.04
strategy:
matrix:
wallet: ["askar_wallet"]
steps:
- name: "Git checkout"
uses: actions/checkout@v3
Expand All @@ -117,29 +114,7 @@ jobs:
sudo apt-get install -y libsodium-dev libssl-dev libzmq3-dev
sudo snap install --edge --classic just
- name: "Verify clippy across the entire workspace"
run: just clippy-workspace ${{ matrix.wallet }}

aries_vcx_clippy:
runs-on: ubuntu-20.04
strategy:
matrix:
backend: ["anoncreds,askar_wallet", "vdr_proxy_ledger,askar_wallet"]
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
default: true
components: clippy
- name: "Install dependencies"
shell: bash
run: |
sudo apt-get update -y
sudo apt-get install -y libsodium-dev libssl-dev libzmq3-dev
sudo snap install --edge --classic just
- name: "Verify clippy across the entire workspace with default features"
run: just clippy-aries-vcx ${{ matrix.backend }}
run: just clippy

##########################################################################################
############################## DOCKER BUILD ##########################################
Expand All @@ -150,7 +125,7 @@ jobs:
permissions:
contents: read
packages: write
needs: [ workflow-setup ]
needs: [workflow-setup]
if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }}
env:
DOCKER_IMG_CACHED: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_VDRPROXY }}
Expand Down Expand Up @@ -183,7 +158,7 @@ jobs:
permissions:
contents: read
packages: write
needs: [ workflow-setup ]
needs: [workflow-setup]
if: ${{ needs.workflow-setup.outputs.IS_MAIN_BRANCH == 'true' }}
env:
DOCKER_IMG_CACHED: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_AATH }}
Expand Down Expand Up @@ -218,7 +193,7 @@ jobs:
permissions:
contents: read
packages: write
needs: [ workflow-setup, build-docker-vdrproxy ]
needs: [workflow-setup, build-docker-vdrproxy]
if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }}
env:
DOCKER_IMG_CACHED: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_VDRPROXY }}
Expand Down Expand Up @@ -249,7 +224,7 @@ jobs:
permissions:
contents: read
packages: write
needs: [ workflow-setup, build-docker-aath-backchannel ]
needs: [workflow-setup, build-docker-aath-backchannel]
if: ${{ needs.workflow-setup.outputs.RELEASE == 'true' || needs.workflow-setup.outputs.PRERELEASE == 'true' }}
env:
DOCKER_IMG_CACHED: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_AATH }}
Expand Down Expand Up @@ -407,14 +382,14 @@ jobs:
breakingLabels: backwards-incompatible,breaking
deprecatedLabels: deprecated
headerLabel: "# Changelog"
breakingLabel: '### Breaking changes'
enhancementLabel: '### Enhancements'
bugsLabel: '### Bug fixes'
deprecatedLabel: '### Deprecations'
removedLabel: '### Removals'
securityLabel: '### Security fixes'
issuesLabel: '### Other issues'
prLabel: '### Other pull requests'
breakingLabel: "### Breaking changes"
enhancementLabel: "### Enhancements"
bugsLabel: "### Bug fixes"
deprecatedLabel: "### Deprecations"
removedLabel: "### Removals"
securityLabel: "### Security fixes"
issuesLabel: "### Other issues"
prLabel: "### Other pull requests"
addSections: '{"ci":{"prefix":"### CI changes","labels":["ci"]},"wrappers":{"prefix":"### Wrapper changes","labels":["wrappers"]},"agents":{"prefix":"### Changes to agents","labels":["agents"]},"features":{"prefix":"### Features","labels":["features"]},"hotfix":{"prefix":"### Hotfixes","labels":["hotfix"]},"security":{"prefix":"### Security fixes","labels":["security"]},"refactoring":{"prefix":"### Refactoring","labels":["refactoring"]},"tests":{"prefix":"### Tests","labels":["tests"]},"update":{"prefix":"### Updates","labels":["update"]}}'
excludeTagsRegex: '^((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))+)?)$'

Expand Down
22 changes: 13 additions & 9 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
# "rust-analyzer.rustfmt.extraArgs": [
# "+nightly"
# ],
unstable_features = true
group_imports = "StdExternalCrate"
imports_granularity = "Crate"
format_code_in_doc_comments = true
format_macro_bodies = true
format_macro_matchers = true
format_strings = true
comment_width = 100
wrap_comments = true

# The following have been commented out as we are no longer targeting nightly,
# therefore these are no longer accessible:
#
# unstable_features = true
# group_imports = "StdExternalCrate"
# imports_granularity = "Crate"
# format_code_in_doc_comments = true
# format_macro_bodies = true
# format_macro_matchers = true
# format_strings = true
# comment_width = 100
# wrap_comments = true
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ authors = [
description = "Library to work with Aries protocols & collection of supporting components"
license = "Apache-2.0"
edition = "2021"
rust-version = "1.79"

[profile.release]
debug = 0
Expand Down
49 changes: 34 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Join the chat at https://chat.hyperledger.org/channel/aries](https://img.shields.io/badge/Chat%20on-Hyperledger%20Chat-blue)](https://chat.hyperledger.org/channel/aries)

The repository contains Rust crates to build
The repository contains Rust crates to build

- [Aries](https://github.com/hyperledger/aries-rfcs/) based applications (mobile, server, anything, ...),
- [DIDComm](https://didcomm.org/) related components.

## Aries implementation

- [`aries_vcx`](aries/aries_vcx) - Library implementing DIDComm protocols, with focus on verifiable credential issuance and verification.
- [`messages`](aries/messages) - Library for building and parsing Aries (DIDComm v1) messages.
- [`aries_vcx_anoncreds`](aries/aries_vcx_anoncreds) - Interfaces for interaction with credentials.
Expand All @@ -17,28 +19,45 @@ The repository contains Rust crates to build
- [`agents`](aries/agents) - Aries agents built on top of `aries_vcx`.

## Did document implementation
- [`did_doc`](did_core/did_doc) - Building and parsing [DID Documents](https://w3c.github.io/did-core/)

- [`did_doc`](did_core/did_doc) - Building and parsing [DID Documents](https://w3c.github.io/did-core/)

## Did methods implementation
- [`did_parser`](did_core/did_parser_nom) - Building and parsing [DIDs](https://w3c.github.io/did-core/)
- [`did_peer`](did_core/did_methods/did_peer) - https://identity.foundation/peer-did-method-spec/
- [`did_sov`](did_core/did_methods/did_resolver_sov) - https://sovrin-foundation.github.io/sovrin/spec/did-method-spec-template.html
- [`did_cheqd`](did_core/did_methods/did_cheqd) - https://docs.cheqd.io/product/architecture/adr-list/adr-001-cheqd-did-method
- [`did_web`](did_core/did_methods/did_resolver_web) - https://w3c-ccg.github.io/did-method-web/
- [`did_key`](did_core/did_methods/did_key) - https://w3c-ccg.github.io/did-method-key/
- [`did_jwk`](did_core/did_methods/did_jwk) - https://github.com/quartzjer/did-jwk/blob/main/spec.md

- [`did_parser`](did_core/did_parser_nom) - Building and parsing [DIDs](https://w3c.github.io/did-core/)
- [`did_peer`](did_core/did_methods/did_peer) - https://identity.foundation/peer-did-method-spec/
- [`did_sov`](did_core/did_methods/did_resolver_sov) - https://sovrin-foundation.github.io/sovrin/spec/did-method-spec-template.html
- [`did_cheqd`](did_core/did_methods/did_cheqd) - https://docs.cheqd.io/product/architecture/adr-list/adr-001-cheqd-did-method
- [`did_web`](did_core/did_methods/did_resolver_web) - https://w3c-ccg.github.io/did-method-web/
- [`did_key`](did_core/did_methods/did_key) - https://w3c-ccg.github.io/did-method-key/
- [`did_jwk`](did_core/did_methods/did_jwk) - https://github.com/quartzjer/did-jwk/blob/main/spec.md

# Contact

Do you have a question ❓Are you considering using our components? 🚀 We'll be excited to hear from you. 👋

There's 2 best way to reach us:

- Leave us message on `aries-vcx` [discord](https://discord.com/channels/905194001349627914/955480822675308604) channel.
- Join our Zoom community calls. Biweekly Tuesdays @ 11:00 pm UTC via Zoom, find more details on [wiki](https://wiki.hyperledger.org/display/ARIES/Community+calls)

## Versioning & releases
- Crates are not yet published on crates.io. You can consume crates as github-type Cargo dependency.
- All releases have currently major version `0`
- We bump minor version on releases containing new features, significant refactors or breaking changes.
- We bump patch version if release only contains fixes or smaller refactoring.
- See [releases](https://github.com/hyperledger/aries-vcx/releases) page.
- Crates are known to be stable with atleast Rust version 1.79

- Crates are not yet published on crates.io. You can consume crates as github-type Cargo dependency.
- All releases have currently major version `0`
- We bump minor version on releases containing new features, significant refactors or breaking changes.
- We bump patch version if release only contains fixes or smaller refactoring.
- See [releases](https://github.com/hyperledger/aries-vcx/releases) page.
- Crates are known to be stable with atleast Rust version 1.79

# Contributions

Contributions are very welcome! If you have questions or issues, please let us know on [Discord](https://chat.hyperledger.org/channel/aries) or at our [bi-weekly community call](https://wiki.hyperledger.org/display/ARIES/Community+calls).

For contributions, please run `clippy` and format prior to creating a PR. This can be done via `just`:

```
cargo install just
just clippy
just fmt
```
23 changes: 17 additions & 6 deletions aries/agents/aath-backchannel/src/controllers/didcomm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,10 @@ impl HarnessAgent {
}

pub async fn receive_message(&self, payload: Vec<u8>) -> HarnessResult<HttpResponse> {
let (message, sender_vk, recipient_vk) = EncryptionEnvelope::anon_unpack_aries_msg(
let (message, sender_vk, recipient_vk) = EncryptionEnvelope::unpack_aries_msg(
self.aries_agent.wallet().as_ref(),
payload.clone(),
&payload,
&None,
)
.await?;
let sender_vk = sender_vk.ok_or_else(|| {
Expand Down Expand Up @@ -245,22 +246,32 @@ impl HarnessAgent {
}
}
AriesMessage::TrustPing(TrustPing::Ping(msg)) => {
let connection_id = self.aries_agent.connections().get_by_sender_vk(sender_vk)?;
let connection_id = self
.aries_agent
.connections()
.get_by_sender_vk(sender_vk.base58())?;
self.aries_agent
.connections()
.process_trust_ping(msg, &connection_id)
.await?
}
AriesMessage::Connection(msg) => self.handle_connection_msg(msg).await?,
AriesMessage::CredentialIssuance(msg) => {
let connection_id = self.aries_agent.connections().get_by_sender_vk(sender_vk)?;
let connection_id = self
.aries_agent
.connections()
.get_by_sender_vk(sender_vk.base58())?;
self.handle_issuance_msg(msg, &connection_id).await?
}
AriesMessage::DidExchange(msg) => {
self.handle_did_exchange_msg(msg, recipient_vk).await?
self.handle_did_exchange_msg(msg, recipient_vk.base58())
.await?
}
AriesMessage::PresentProof(msg) => {
let connection_id = self.aries_agent.connections().get_by_sender_vk(sender_vk)?;
let connection_id = self
.aries_agent
.connections()
.get_by_sender_vk(sender_vk.base58())?;
self.handle_presentation_msg(msg, &connection_id).await?
}
m => {
Expand Down
Loading

0 comments on commit e5bee98

Please sign in to comment.