Skip to content

Commit

Permalink
Merge branch 'dev' into fix-post-checks
Browse files Browse the repository at this point in the history
  • Loading branch information
0xverin authored Dec 22, 2024
2 parents 7d2fd7b + 5c1a358 commit 1c736b0
Show file tree
Hide file tree
Showing 17 changed files with 399 additions and 19 deletions.
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,14 @@ clippyfix:
.PHONY: cargofix ## cargo fix
cargofix:
cd parachain && cargo fix --locked --allow-dirty --allow-staged --workspace --all

.PHONY: clean-all-build ## clean up all build history
clean-all-build:
@echo "Cleaning parachain..."
@cd parachain && cargo clean

@echo "Clean tee-worker/identity..."
@cd tee-worker/identity && make clean

@echo "Clean tee-worker/omni-worker..."
@cd tee-worker/omni-worker && make distclean
4 changes: 4 additions & 0 deletions local-setup/.env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ MAGIC_CRAFT_API_KEY=
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=

# The following key/token are MANDATORY to give when running worker.
# use a secure 256-bit key for JWT token generation.
JWT_SECRET=

# The followings are default value.
# Can be skipped; or overwrite within non-production mode.
TWITTER_OFFICIAL_URL=http://localhost:19527
Expand Down
4 changes: 2 additions & 2 deletions parachain/scripts/launch-network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ if [ -f "$PARACHAIN_BIN" ]; then
echo "found one, version:"
./litentry-collator --version
else
echo "not here, copying from docker image if we are on Linux ..."
echo "not here, copying from docker image if we are on Linux ..."
if [ $(uname -s) = "Linux" ]; then
docker cp "$(docker create --rm litentry/litentry-parachain:latest):/usr/local/bin/litentry-collator" .
chmod +x litentry-collator
Expand All @@ -80,7 +80,7 @@ fi
print_divider

echo "launching zombienet network (in background), dir = $ZOMBIENET_DIR ..."
$ZOMBIENET_BIN -d $ZOMBIENET_DIR -l silent spawn config.toml &
nohup $ZOMBIENET_BIN -d $ZOMBIENET_DIR -l silent spawn config.toml > /dev/null 2>&1 &

cd "$ROOTDIR/parachain/ts-tests"

Expand Down
16 changes: 16 additions & 0 deletions tee-worker/Cargo.lock

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

2 changes: 2 additions & 0 deletions tee-worker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ members = [
"identity/litentry/core/data-providers",
"identity/litentry/core/vc-task/sender",
"identity/litentry/core/vc-task/receiver",
"identity/litentry/core/authentication",
"identity/litentry/core/native-task/sender",
"identity/litentry/core/native-task/receiver",
"identity/litentry/core/identity-verification",
Expand Down Expand Up @@ -284,6 +285,7 @@ lc-vc-task-receiver = { path = "identity/litentry/core/vc-task/receiver", defaul
lc-omni-account = { path = "identity/litentry/core/omni-account", default-features = false }
lc-native-task-sender = { path = "identity/litentry/core/native-task/sender", default-features = false }
lc-native-task-receiver = { path = "identity/litentry/core/native-task/receiver", default-features = false }
lc-authentication = { path = "identity/litentry/core/authentication", default-features = false }

itc-peer-top-broadcaster = { path = "identity/core/peer-top-broadcaster", default-features = false }
itc-rpc-server = { path = "identity/core/rpc-server", default-features = false }
Expand Down
3 changes: 3 additions & 0 deletions tee-worker/identity/app-libs/stf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ sp-std = { workspace = true }

# litentry
itp-node-api-metadata-provider = { workspace = true }
lc-authentication = { path = "../../litentry/core/authentication", default-features = false }
lc-stf-task-sender = { path = "../../litentry/core/stf-task/sender", default-features = false }
litentry-hex-utils = { workspace = true }
litentry-macros = { workspace = true }
Expand All @@ -56,6 +57,7 @@ sgx = [
"itp-node-api/sgx",
"litentry-primitives/sgx",
"lc-stf-task-sender/sgx",
"lc-authentication/sgx",
"itp-node-api-metadata-provider/sgx",
]
std = [
Expand All @@ -79,6 +81,7 @@ std = [
"sp-io/std",
"litentry-primitives/std",
"lc-stf-task-sender/std",
"lc-authentication/std",
"itp-node-api-metadata-provider/std",
]
test = []
Expand Down
6 changes: 6 additions & 0 deletions tee-worker/identity/app-libs/stf/src/trusted_call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ use itp_types::{
Moment, OpaqueCall, H256,
};
use itp_utils::stringify::account_id_to_string;
use lc_authentication::AuthOptions;
use litentry_hex_utils::hex_encode;
pub use litentry_primitives::{
aes_encrypt_default, all_evm_web3networks, all_substrate_web3networks, AesOutput, Assertion,
Expand Down Expand Up @@ -149,6 +150,8 @@ pub enum TrustedCall {
remove_accounts(Identity, Vec<Identity>),
#[codec(index = 30)]
publicize_account(Identity, Identity),
#[codec(index = 31)]
request_auth_token(Identity, AuthOptions),

// original integritee trusted calls, starting from index 50
#[codec(index = 50)]
Expand Down Expand Up @@ -244,6 +247,7 @@ impl TrustedCall {
Self::add_account(sender_identity, ..) => sender_identity,
Self::remove_accounts(sender_identity, ..) => sender_identity,
Self::publicize_account(sender_identity, ..) => sender_identity,
Self::request_auth_token(sender_identity, ..) => sender_identity,
}
}

Expand All @@ -262,6 +266,7 @@ impl TrustedCall {
Self::add_account(..) => "add_account",
Self::remove_accounts(..) => "remove_account",
Self::publicize_account(..) => "publicize_account",
Self::request_auth_token(..) => "request_auth_token",
_ => "unsupported_trusted_call",
}
}
Expand Down Expand Up @@ -920,6 +925,7 @@ where
| TrustedCall::create_account_store(..)
| TrustedCall::add_account(..)
| TrustedCall::remove_accounts(..)
| TrustedCall::request_auth_token(..)
| TrustedCall::publicize_account(..) => {
error!("please use author_submitNativeRequest instead");
Ok(TrustedCallResult::Empty)
Expand Down
16 changes: 16 additions & 0 deletions tee-worker/identity/enclave-runtime/Cargo.lock

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

28 changes: 28 additions & 0 deletions tee-worker/identity/litentry/core/authentication/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[package]
authors = ["Trust Computing GmbH <[email protected]>"]
edition = "2021"
name = "lc-authentication"
version = "0.1.0"

[dependencies]
base64 = { version = "0.22", default-features = false, features = ["alloc"] } # a newer base64
codec = { package = "parity-scale-codec", workspace = true }
parentchain-primitives = { workspace = true }
ring = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }

sgx_tstd = { workspace = true, features = ["net", "thread"], optional = true }

[features]
default = ["std"]
std = [
"codec/std",
"serde/std",
"serde_json/std",
"ring/std",
"parentchain-primitives/std",
]
sgx = [
"sgx_tstd",
]
Loading

0 comments on commit 1c736b0

Please sign in to comment.