Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/identity rebased #1428

Closed
wants to merge 74 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
96f784d
add initial sui handling for tests
wulfraem May 3, 2024
1570d75
identity-iota move package, DID Document Obj, MigrationRegistry Obj
UMR1352 May 7, 2024
2bddf02
migration registry in move code
UMR1352 May 10, 2024
bfccff1
migration registry integration
UMR1352 May 13, 2024
169b99c
add signing and tx tests
wulfraem May 16, 2024
e494891
Merge branch 'feat/add-initial-sui-move-handling' into feat/identity-…
wulfraem May 24, 2024
242231d
Merge pull request #1 from iotaledger/feat/identity-iota-smart-contracts
wulfraem May 24, 2024
c9771c3
Feat/add did resolving (#3)
wulfraem May 27, 2024
982a486
use dynamic_object_field for migration registry
UMR1352 May 27, 2024
6a20c16
test harness & integration tests (#4)
UMR1352 May 29, 2024
8b86952
store active-address to check cache invalidation
UMR1352 May 30, 2024
ec9b5a2
Feat/add did resolving (#5)
wulfraem Jun 4, 2024
6daa04d
Add document publishing (#8)
wulfraem Jun 14, 2024
09ee376
Integrate new identity client into api (#10)
wulfraem Jul 26, 2024
ed334fd
Add more examples and impl (#11)
wulfraem Aug 5, 2024
4144b93
[Feat] Shared control of an Identity through Capabilities & Proposals…
UMR1352 Aug 9, 2024
d5996b4
[Enhancement] Refactor IdentityClient (#15)
UMR1352 Aug 19, 2024
e2e633f
[feat] Public Available Credential (#16)
UMR1352 Aug 22, 2024
bdb5e3a
test structure, fix random drop of dispatch task (#21)
UMR1352 Sep 4, 2024
8edb8f4
Refactor: OnChainIdentity & Transaction execution (#18)
UMR1352 Sep 4, 2024
a628878
ident_str macro (#22)
UMR1352 Sep 4, 2024
140b462
update identity tests
wulfraem Sep 23, 2024
1f95b06
update identity tests (#24)
wulfraem Sep 27, 2024
472ec98
fix `hosting_vc_works` test
wulfraem Oct 8, 2024
ba4b67a
some code docs
UMR1352 Oct 10, 2024
41c9964
more docs
UMR1352 Oct 11, 2024
d50116a
feat: grpc rebase
itsyaasir Oct 22, 2024
beec07e
feat: Add document creation and identity creation
itsyaasir Oct 24, 2024
e51deae
Refactor grpc imports in server and services modules
itsyaasir Oct 24, 2024
98f2151
Refactor grpc imports in server and services modules; Update deps
itsyaasir Oct 24, 2024
8c99cfc
Update wasm build script to use specific Rust version
itsyaasir Oct 29, 2024
a3a9f84
Merge pull request #31 from iotaledger/rebased-main
itsyaasir Oct 29, 2024
248f0c7
Merge branch 'main' into chore/update-sui-move
itsyaasir Oct 30, 2024
8588e86
merge fixes; add missing examples and cargo fmt
itsyaasir Oct 30, 2024
aae9b72
Merge pull request #33 from iotaledger/chore/update-sui-move
itsyaasir Oct 31, 2024
9dc88cf
Merge branch 'feat/add-initial-sui-move-handling' into feat/grpc-rebased
itsyaasir Oct 31, 2024
8ed5a2a
bump prost dependency version to 0.13
itsyaasir Oct 31, 2024
eb22f22
Merge pull request #30 from iotaledger/feat/grpc-rebased
itsyaasir Nov 1, 2024
7e081e0
feat: add attaching multiple kinesis handler
itsyaasir Nov 5, 2024
e509cf7
Merge pull request #43 from iotaledger/feat/resolver/multiple-kinesis…
itsyaasir Nov 5, 2024
28d6cf0
Merge branch 'feat/add-initial-sui-move-handling' into fix/re-add-his…
wulfraem Nov 6, 2024
7338bdd
Merge pull request #28 from iotaledger/fix/re-add-history-test-and-re…
wulfraem Nov 6, 2024
25facdc
refactor: reorganize examples directory and update imports
itsyaasir Nov 11, 2024
105e886
fix: update iota dependencies to v0.7.0-alpha and removal of proposal…
itsyaasir Nov 13, 2024
4c2ce05
Merge pull request #48 from iotaledger/chore/remove-stardust-tests
itsyaasir Nov 13, 2024
192c86c
Merge branch 'feat/add-initial-sui-move-handling' into fix/active-pro…
itsyaasir Nov 13, 2024
caa31e6
fix: update path for identity_sui_name_tbd in examples/Cargo.toml
itsyaasir Nov 13, 2024
c4cebb8
Merge pull request #52 from iotaledger/fix/active-proposal-bug
itsyaasir Nov 13, 2024
db5b38f
feat: add linked verifiable presentation example and update dependencies
itsyaasir Nov 13, 2024
10d06c9
Merge pull request #53 from iotaledger/chore/add-more-examples
itsyaasir Nov 14, 2024
3df0d1f
integrate tbd project content into `identity_iota_core`
wulfraem Nov 14, 2024
ffae422
Merge branch 'feat/add-initial-sui-move-handling' into feat/move-tbd-…
wulfraem Nov 14, 2024
9adfff7
TransactionOutput to return both parsed output and raw tx response (#58)
UMR1352 Nov 14, 2024
afc9828
fix deactivate did logic
wulfraem Nov 14, 2024
2c0c28d
set migration related tests to ignore for now
wulfraem Nov 14, 2024
e86f324
fix zkp and history examples
wulfraem Nov 14, 2024
9e27627
Identity send & borrow assets (#54)
UMR1352 Nov 15, 2024
b639816
chore: add copyright and license headers to source files; clippy chec…
itsyaasir Nov 15, 2024
c1644a0
fix: remove unused dependencies from Cargo.toml files
itsyaasir Nov 15, 2024
d78f2eb
Merge branch 'feat/add-initial-sui-move-handling' into chore/local-tests
itsyaasir Nov 15, 2024
a08d97e
refactor: organize and clean up imports across proposal and move_call…
itsyaasir Nov 15, 2024
848b1ac
Use `QuasiTransaction` in `ProposalT` definition (#55)
UMR1352 Nov 15, 2024
db1004b
Merge branch 'feat/add-initial-sui-move-handling' into chore/local-tests
itsyaasir Nov 15, 2024
3fb7cd5
Merge branch 'feat/add-initial-sui-move-handling' into feat/move-tbd-…
wulfraem Nov 15, 2024
708ceee
Merge pull request #59 from iotaledger/feat/move-tbd-project-into-ide…
wulfraem Nov 15, 2024
160ecc8
Make Move handle DID Document's time metadata (#62)
UMR1352 Nov 16, 2024
885078b
Merge remote-tracking branch 'origin/feat/add-initial-sui-move-handli…
itsyaasir Nov 17, 2024
eaec059
chore: clippy fixes;fmt
itsyaasir Nov 17, 2024
b93128b
Merge pull request #63 from iotaledger/chore/local-tests
itsyaasir Nov 18, 2024
46c4313
Replace `stardust-test` Move package with IOTA's official `stardust` …
UMR1352 Nov 19, 2024
86cb552
add DID deactivation test, fix proposal creation bug
UMR1352 Nov 19, 2024
8d57495
ignore Move.lock
UMR1352 Nov 19, 2024
6ce10ec
alias is owned by wrapper which is in turn owned by alias_output
UMR1352 Nov 20, 2024
f5b52f0
polish identity package (#1427)
UMR1352 Nov 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@ index.html
!/bindings/wasm/static/index.html

docs
# ignore IOTA build artifacts & package locks
build
identity_iota_core/packages/*/Move.lock

20 changes: 10 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
[workspace.package]
authors = ["IOTA Stiftung"]
edition = "2021"
homepage = "https://www.iota.org"
license = "Apache-2.0"
repository = "https://github.com/iotaledger/identity.rs"
rust-version = "1.65"

[workspace]
resolver = "2"
members = [
Expand All @@ -22,19 +30,11 @@ exclude = ["bindings/wasm", "bindings/grpc"]
[workspace.dependencies]
bls12_381_plus = { version = "0.8.17" }
serde = { version = "1.0", default-features = false, features = ["alloc", "derive"] }
thiserror = { version = "1.0", default-features = false }
strum = { version = "0.25", default-features = false, features = ["std", "derive"] }
serde_json = { version = "1.0", default-features = false }
strum = { version = "0.25", default-features = false, features = ["std", "derive"] }
thiserror = { version = "1.0", default-features = false }
json-proof-token = { version = "0.3.5" }
zkryptium = { version = "0.2.2", default-features = false, features = ["bbsplus"] }

[workspace.package]
authors = ["IOTA Stiftung"]
edition = "2021"
homepage = "https://www.iota.org"
license = "Apache-2.0"
repository = "https://github.com/iotaledger/identity.rs"
rust-version = "1.65"

[workspace.lints.clippy]
result_large_err = "allow"
23 changes: 14 additions & 9 deletions bindings/grpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,32 @@ name = "identity-grpc"
path = "src/main.rs"

[dependencies]
anyhow = "1.0.75"
anyhow = "1.0"
futures = { version = "0.3" }
identity_eddsa_verifier = { path = "../../identity_eddsa_verifier" }
identity_iota = { path = "../../identity_iota", features = ["resolver", "sd-jwt", "domain-linkage", "domain-linkage-fetch", "status-list-2021"] }
identity_jose = { path = "../../identity_jose" }
identity_storage = { path = "../../identity_storage", features = ["memstore"] }
identity_stronghold = { path = "../../identity_stronghold", features = ["send-sync-storage"] }
iota-sdk = { version = "1.1.5", features = ["stronghold"] }
openssl = { version = "0.10", features = ["vendored"] }
prost = "0.12"
identity_sui_name_tbd = { path = "../../identity_sui_name_tbd" }
iota-sdk = { version = "1.1.2", features = ["stronghold"] }
iota-sdk-move = { git = "https://github.com/iotaledger/iota.git", package = "iota-sdk" }
prost = "0.13"
rand = "0.8.5"
serde = { version = "1.0.193", features = ["derive", "alloc"] }
serde_json = { version = "1.0.108", features = ["alloc"] }
thiserror = "1.0.50"
serde = { version = "1.0", features = ["derive", "alloc"] }
serde_json = { version = "1.0", features = ["alloc"] }
thiserror = "1.0"
tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] }
tokio-stream = { version = "0.1.14", features = ["net"] }
tonic = "0.10"
tonic = "0.12"
tracing = { version = "0.1.40", features = ["async-await"] }
tracing-subscriber = "0.3.18"
url = { version = "2.5", default-features = false }

[dev-dependencies]
fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "5f2c63266a065996d53f98156f0412782b468597", package = "fastcrypto" }
identity_storage = { path = "../../identity_storage", features = ["memstore"] }
jsonpath-rust = "0.7"

[build-dependencies]
tonic-build = "0.10"
tonic-build = "0.12"
4 changes: 2 additions & 2 deletions bindings/grpc/proto/document.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ syntax = "proto3";
package document;

message CreateDIDRequest {
// An IOTA's bech32 encoded address.
string bech32_address = 1;
// KeyID for getting the public key from stronghold.
string key_id = 1;
}

message CreateDIDResponse {
Expand Down
20 changes: 14 additions & 6 deletions bindings/grpc/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
// Copyright 2020-2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use std::str::FromStr;

use anyhow::Context;
use identity_grpc::server::GRpcServer;
use identity_stronghold::StrongholdStorage;
use iota_sdk::client::stronghold::StrongholdAdapter;
use iota_sdk::client::Client;

use identity_sui_name_tbd::client::IdentityClientReadOnly;
use iota_sdk_move::types::base_types::ObjectID;

#[tokio::main]
#[tracing::instrument(err)]
Expand All @@ -15,15 +19,19 @@ async fn main() -> anyhow::Result<()> {

let api_endpoint = std::env::var("API_ENDPOINT")?;

let client: Client = Client::builder()
.with_primary_node(&api_endpoint, None)?
.finish()
.await?;
let identity_iota_pkg_id = std::env::var("IDENTITY_IOTA_PKG_ID")?;

let identity_pkg_id = ObjectID::from_str(&identity_iota_pkg_id)?;

let iota_client = iota_sdk_move::IotaClientBuilder::default().build(api_endpoint).await?;

let read_only_client = IdentityClientReadOnly::new(iota_client, identity_pkg_id).await?;

let stronghold = init_stronghold()?;

let addr = "0.0.0.0:50051".parse()?;
tracing::info!("gRPC server listening on {}", addr);
GRpcServer::new(client, stronghold).serve(addr).await?;
GRpcServer::new(read_only_client, stronghold).serve(addr).await?;

Ok(())
}
Expand Down
4 changes: 2 additions & 2 deletions bindings/grpc/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use std::net::SocketAddr;

use identity_stronghold::StrongholdStorage;
use iota_sdk::client::Client;
use identity_sui_name_tbd::client::IdentityClientReadOnly;
use tonic::transport::server::Router;
use tonic::transport::server::Server;

Expand All @@ -17,7 +17,7 @@ pub struct GRpcServer {
}

impl GRpcServer {
pub fn new(client: Client, stronghold: StrongholdStorage) -> Self {
pub fn new(client: IdentityClientReadOnly, stronghold: StrongholdStorage) -> Self {
let router = Server::builder().add_routes(services::routes(&client, &stronghold));
Self { router, stronghold }
}
Expand Down
8 changes: 4 additions & 4 deletions bindings/grpc/src/services/credential/jwt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use identity_iota::storage::JwkDocumentExt;
use identity_iota::storage::JwsSignatureOptions;
use identity_iota::storage::Storage;
use identity_stronghold::StrongholdStorage;
use iota_sdk::client::Client;
use identity_sui_name_tbd::client::IdentityClientReadOnly;
use tonic::Request;
use tonic::Response;
use tonic::Status;
Expand All @@ -31,9 +31,9 @@ pub struct JwtService {
}

impl JwtService {
pub fn new(client: &Client, stronghold: &StrongholdStorage) -> Self {
pub fn new(client: &IdentityClientReadOnly, stronghold: &StrongholdStorage) -> Self {
let mut resolver = Resolver::new();
resolver.attach_iota_handler(client.clone());
resolver.attach_kinesis_iota_handler(client.clone());
Self {
resolver,
storage: Storage::new(stronghold.clone(), stronghold.clone()),
Expand Down Expand Up @@ -80,6 +80,6 @@ impl JwtSvc for JwtService {
}
}

pub fn service(client: &Client, stronghold: &StrongholdStorage) -> JwtServer<JwtService> {
pub fn service(client: &IdentityClientReadOnly, stronghold: &StrongholdStorage) -> JwtServer<JwtService> {
JwtServer::new(JwtService::new(client, stronghold))
}
6 changes: 3 additions & 3 deletions bindings/grpc/src/services/credential/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ pub mod revocation;
pub mod validation;

use identity_stronghold::StrongholdStorage;
use iota_sdk::client::Client;
use tonic::transport::server::RoutesBuilder;
use identity_sui_name_tbd::client::IdentityClientReadOnly;
use tonic::service::RoutesBuilder;

pub fn init_services(routes: &mut RoutesBuilder, client: &Client, stronghold: &StrongholdStorage) {
pub fn init_services(routes: &mut RoutesBuilder, client: &IdentityClientReadOnly, stronghold: &StrongholdStorage) {
routes.add_service(revocation::service(client));
routes.add_service(jwt::service(client, stronghold));
routes.add_service(validation::service(client));
Expand Down
8 changes: 4 additions & 4 deletions bindings/grpc/src/services/credential/revocation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use identity_iota::credential::RevocationBitmapStatus;
use identity_iota::credential::{self};
use identity_iota::prelude::IotaDocument;
use identity_iota::prelude::Resolver;
use iota_sdk::client::Client;
use identity_sui_name_tbd::client::IdentityClientReadOnly;
use prost::bytes::Bytes;
use serde::Deserialize;
use serde::Serialize;
Expand Down Expand Up @@ -107,9 +107,9 @@ pub struct CredentialVerifier {
}

impl CredentialVerifier {
pub fn new(client: &Client) -> Self {
pub fn new(client: &IdentityClientReadOnly) -> Self {
let mut resolver = Resolver::new();
resolver.attach_iota_handler(client.clone());
resolver.attach_kinesis_iota_handler(client.clone());
Self { resolver }
}
}
Expand Down Expand Up @@ -156,6 +156,6 @@ impl CredentialRevocation for CredentialVerifier {
}
}

pub fn service(client: &Client) -> CredentialRevocationServer<CredentialVerifier> {
pub fn service(client: &IdentityClientReadOnly) -> CredentialRevocationServer<CredentialVerifier> {
CredentialRevocationServer::new(CredentialVerifier::new(client))
}
8 changes: 4 additions & 4 deletions bindings/grpc/src/services/credential/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use identity_iota::credential::StatusCheck;
use identity_iota::iota::IotaDID;
use identity_iota::resolver;
use identity_iota::resolver::Resolver;
use iota_sdk::client::Client;
use identity_sui_name_tbd::client::IdentityClientReadOnly;

use _credentials::vc_validation_server::VcValidation;
use _credentials::vc_validation_server::VcValidationServer;
Expand Down Expand Up @@ -63,9 +63,9 @@ pub struct VcValidator {
}

impl VcValidator {
pub fn new(client: &Client) -> Self {
pub fn new(client: &IdentityClientReadOnly) -> Self {
let mut resolver = Resolver::new();
resolver.attach_iota_handler(client.clone());
resolver.attach_kinesis_iota_handler(client.clone());
Self { resolver }
}
}
Expand Down Expand Up @@ -130,6 +130,6 @@ impl VcValidation for VcValidator {
}
}

pub fn service(client: &Client) -> VcValidationServer<VcValidator> {
pub fn service(client: &IdentityClientReadOnly) -> VcValidationServer<VcValidator> {
VcValidationServer::new(VcValidator::new(client))
}
Loading