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: add signature verification to node response #105

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
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
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,23 @@ jobs:
- name: cargo format
run: cargo fmt --all -- --check

toml-format:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some formatting for our .toml files

name: toml-format
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v4
- name: Install Taplo
env:
version: "0.8.1"
run: |
curl -Ls "https://github.com/tamasfe/taplo/releases/download/${{ env.version }}/taplo-full-linux-x86_64.gz" | \
gzip -d > taplo && \
chmod +x taplo && \
sudo mv taplo /usr/local/bin/taplo
- name: Run Taplo
run: taplo fmt --check

clippy:
name: clippy
runs-on: ubuntu-22.04
Expand Down
11 changes: 10 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,14 @@
"clippy::suspicious",
"-W",
"clippy::correctness"
]
],
"[toml]": {
"editor.defaultFormatter": "tamasfe.even-better-toml",
"editor.formatOnSave": true
},
"evenBetterToml.formatter.alignEntries": true,
"evenBetterToml.formatter.arrayTrailingComma": true,
"evenBetterToml.formatter.columnWidth": 100,
"evenBetterToml.formatter.indentString": " ",
"evenBetterToml.formatter.reorderKeys": true
}
121 changes: 61 additions & 60 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,69 +1,70 @@
[workspace]
members = [ "atoma-auth", "atoma-proxy", "atoma-proxy-service", "atoma-state" ]
resolver = "2"
members = ["atoma-auth", "atoma-proxy-service", "atoma-proxy", "atoma-state"]

[workspace.package]
version = "0.1.0"
edition = "2021"
license = "Apache-2.0"
version = "0.1.0"

[workspace.dependencies]
anyhow = "1.0.91"
async-trait = "0.1.86"
atoma-auth = { path = "./atoma-auth" }
atoma-proxy-service = { path = "./atoma-proxy-service" }
atoma-state = { path = "./atoma-state" }
atoma-p2p = { git = "https://github.com/atoma-network/atoma-node.git", package = "atoma-p2p", branch = "main" }
atoma-sui = { git = "https://github.com/atoma-network/atoma-node.git", package = "atoma-sui", branch = "main" }
atoma-utils = { git = "https://github.com/atoma-network/atoma-node.git", package = "atoma-utils", branch = "main" }
axum = "0.7.7"
base64 = "0.22.1"
bcs = "0.1.6"
blake2 = "0.10.6"
chrono = "0.4.38"
clap = "4.5.20"
config = "0.14.1"
dcap-qvl = "0.1.6"
fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev="69d496c71fb37e3d22fe85e5bbfd4256d61422b9", package = "fastcrypto" }
fastcrypto-zkp = { git = "https://github.com/MystenLabs/fastcrypto", rev="69d496c71fb37e3d22fe85e5bbfd4256d61422b9", package = "fastcrypto-zkp" }
flume = "0.11.1"
futures = "0.3.31"
hex = "0.4.3"
hf-hub = "0.3.2"
isocountry = "0.3.2"
itertools = "0.13.0"
jsonwebtoken = "9.3.0"
pem = "3.0.4"
opentelemetry = "0.27.1"
opentelemetry-otlp = "0.27.0"
opentelemetry_sdk = "0.27.1"
rand = "0.8.5"
regex = "1.11.1"
reqwest = "0.12.9"
rsa = "0.9.7"
serde = "1.0.214"
serde_json = "1.0.138"
serde_yaml = "0.9.34"
serial_test = "3.1.1"
shared-crypto = { git = "https://github.com/mystenlabs/sui", package = "shared-crypto", tag = "testnet-v1.42.1" }
sqlx = { version = "0.8.2", features = ["postgres","runtime-tokio-native-tls"] }
sui-keys = { git = "https://github.com/mystenlabs/sui", package = "sui-keys", tag = "testnet-v1.42.1" }
sui-sdk = { git = "https://github.com/mystenlabs/sui", package = "sui-sdk", tag = "testnet-v1.42.1" }
sui-sdk-types = "0.0.2"
thiserror = "2.0.11"
tokenizers = "0.21.0"
tokio = "1.41.0"
toml = "0.8.19"
tonic = "0.12"
tower = "0.5.1"
tower-http = "0.6.2"
tracing = "0.1.40"
tracing-appender = "0.2.3"

anyhow = "1.0.91"
async-trait = "0.1.86"
atoma-auth = { path = "./atoma-auth" }
atoma-p2p = { git = "https://github.com/atoma-network/atoma-node.git", package = "atoma-p2p", branch = "main" }
atoma-proxy-service = { path = "./atoma-proxy-service" }
atoma-state = { path = "./atoma-state" }
atoma-sui = { git = "https://github.com/atoma-network/atoma-node.git", package = "atoma-sui", branch = "main" }
atoma-utils = { git = "https://github.com/atoma-network/atoma-node.git", package = "atoma-utils", branch = "main" }
axum = "0.7.7"
base64 = "0.22.1"
bcs = "0.1.6"
blake2 = "0.10.6"
chrono = "0.4.38"
clap = "4.5.20"
config = "0.14.1"
dcap-qvl = "0.1.6"
fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "69d496c71fb37e3d22fe85e5bbfd4256d61422b9", package = "fastcrypto" }
fastcrypto-zkp = { git = "https://github.com/MystenLabs/fastcrypto", rev = "69d496c71fb37e3d22fe85e5bbfd4256d61422b9", package = "fastcrypto-zkp" }
flume = "0.11.1"
futures = "0.3.31"
hex = "0.4.3"
hf-hub = "0.3.2"
isocountry = "0.3.2"
itertools = "0.13.0"
jsonwebtoken = "9.3.0"
opentelemetry = "0.27.1"
opentelemetry-otlp = "0.27.0"
opentelemetry_sdk = "0.27.1"
pem = "3.0.4"
rand = "0.8.5"
regex = "1.11.1"
reqwest = "0.12.9"
rsa = "0.9.7"
serde = "1.0.214"
serde_json = "1.0.138"
serde_yaml = "0.9.34"
serial_test = "3.1.1"
shared-crypto = { git = "https://github.com/mystenlabs/sui", package = "shared-crypto", tag = "testnet-v1.42.1" }
sqlx = { version = "0.8.2", features = [ "postgres", "runtime-tokio-native-tls" ] }
sui-keys = { git = "https://github.com/mystenlabs/sui", package = "sui-keys", tag = "testnet-v1.42.1" }
sui-sdk = { git = "https://github.com/mystenlabs/sui", package = "sui-sdk", tag = "testnet-v1.42.1" }
sui-sdk-types = "0.0.2"
thiserror = "2.0.11"
tokenizers = "0.21.0"
tokio = "1.41.0"
toml = "0.8.19"
tonic = "0.12"
tower = "0.5.1"
tower-http = "0.6.2"
tracing = "0.1.40"
tracing-appender = "0.2.3"
tracing-opentelemetry = "0.28.0"
tracing-subscriber = "0.3.18"
url = "2.5.4"
utoipa = "5.2.0"
utoipa-swagger-ui = "8.0.3"
uuid = "1.11.0"
x25519-dalek = "2.0.1"
zeroize = "1.8.1"
tracing-subscriber = "0.3.18"
url = "2.5.4"
utoipa = "5.2.0"
utoipa-swagger-ui = "8.0.3"
uuid = "1.11.0"
x25519-dalek = "2.0.1"
zeroize = "1.8.1"
62 changes: 31 additions & 31 deletions atoma-auth/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
[package]
name = "atoma-auth"
version.workspace = true
edition.workspace = true
license.workspace = true
name = "atoma-auth"
version.workspace = true

[dependencies]
anyhow.workspace = true
atoma-state.workspace = true
atoma-sui.workspace = true
atoma-utils.workspace = true
base64.workspace = true
bcs.workspace = true
blake2.workspace = true
chrono.workspace = true
config.workspace = true
fastcrypto.workspace = true
anyhow.workspace = true
atoma-state.workspace = true
atoma-sui.workspace = true
atoma-utils.workspace = true
base64.workspace = true
bcs.workspace = true
blake2.workspace = true
chrono.workspace = true
config.workspace = true
fastcrypto.workspace = true
fastcrypto-zkp.workspace = true
flume.workspace = true
hex.workspace = true
itertools.workspace = true
jsonwebtoken.workspace = true
pem.workspace = true
rand.workspace = true
regex.workspace = true
reqwest.workspace = true
rsa.workspace = true
serde = { workspace = true, features = ["derive"] }
serde_json.workspace = true
shared-crypto.workspace = true
sui-keys.workspace = true
sui-sdk.workspace = true
sui-sdk-types = { workspace = true, features = ["serde"] }
thiserror.workspace = true
tokio.workspace = true
tracing.workspace = true
flume.workspace = true
hex.workspace = true
itertools.workspace = true
jsonwebtoken.workspace = true
pem.workspace = true
rand.workspace = true
regex.workspace = true
reqwest.workspace = true
rsa.workspace = true
serde = { workspace = true, features = [ "derive" ] }
serde_json.workspace = true
shared-crypto.workspace = true
sui-keys.workspace = true
sui-sdk.workspace = true
sui-sdk-types = { workspace = true, features = [ "serde" ] }
thiserror.workspace = true
tokio.workspace = true
tracing.workspace = true

[features]
google-oauth = []
google-oauth = [ ]
10 changes: 10 additions & 0 deletions atoma-auth/src/sui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,16 @@ impl Sui {
Ok(signature.encode_base64())
}

/// Get the underlying keystore
///
/// # Returns
///
/// Returns the keystore.
#[must_use]
pub fn get_keystore(&self) -> &Keystore {
&self.wallet_ctx.config.keystore
}

/// Sign a hash using the wallet's private key
///
/// # Arguments
Expand Down
40 changes: 20 additions & 20 deletions atoma-proxy-service/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
[package]
name = "atoma-proxy-service"
version.workspace = true
edition.workspace = true
license.workspace = true
name = "atoma-proxy-service"
version.workspace = true

[dependencies]
anyhow.workspace = true
atoma-auth.workspace = true
atoma-state.workspace = true
atoma-sui.workspace = true
axum.workspace = true
base64.workspace = true
chrono.workspace = true
config.workspace = true
rand.workspace = true
serde = { workspace = true, features = ["derive"] }
serde_yaml = { workspace = true }
sui-sdk.workspace = true
tokio = { workspace = true, features = ["full"] }
tower-http = { workspace = true, features = ["cors"] }
anyhow.workspace = true
atoma-auth.workspace = true
atoma-state.workspace = true
atoma-sui.workspace = true
axum.workspace = true
base64.workspace = true
chrono.workspace = true
config.workspace = true
rand.workspace = true
serde = { workspace = true, features = [ "derive" ] }
serde_yaml = { workspace = true }
sui-sdk.workspace = true
tokio = { workspace = true, features = [ "full" ] }
tower-http = { workspace = true, features = [ "cors" ] }
tracing.workspace = true
tracing-subscriber.workspace = true
tracing.workspace = true
utoipa = { workspace = true, features = ["axum_extras"] }
utoipa-swagger-ui = { workspace = true }
utoipa = { workspace = true, features = [ "axum_extras" ] }
utoipa-swagger-ui = { workspace = true }

[features]
google-oauth = ["atoma-auth/google-oauth"]
google-oauth = [ "atoma-auth/google-oauth" ]
49 changes: 20 additions & 29 deletions atoma-proxy/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "atoma-proxy"
version.workspace = true
edition.workspace = true
license.workspace = true
name = "atoma-proxy"
version.workspace = true

[dependencies]
anyhow.workspace = true
Expand All @@ -13,7 +13,7 @@ atoma-proxy-service.workspace = true
atoma-state.workspace = true
atoma-sui.workspace = true
atoma-utils.workspace = true
axum = { workspace = true, features = ["json"] }
axum = { workspace = true, features = [ "json" ] }
base64 = { workspace = true }
blake2.workspace = true
clap.workspace = true
Expand All @@ -23,44 +23,35 @@ flume.workspace = true
futures = { workspace = true }
hf-hub = { workspace = true }
once_cell = "1.20"
opentelemetry = { workspace = true, features = ["trace", "metrics", "logs"] }
opentelemetry_sdk = { workspace = true, features = [
"rt-tokio",
"trace",
"metrics",
"logs",
] }
opentelemetry = { workspace = true, features = [ "logs", "metrics", "trace" ] }
opentelemetry-otlp = { workspace = true, features = [
"metrics",
"grpc-tonic",
"trace",
"tls",
"logs",
"grpc-tonic",
"logs",
"metrics",
"tls",
"trace",
] }
opentelemetry_sdk = { workspace = true, features = [ "logs", "metrics", "rt-tokio", "trace" ] }
rand = { workspace = true }
reqwest = { workspace = true, features = ["json"] }
serde = { workspace = true, features = ["derive"] }
reqwest = { workspace = true, features = [ "json" ] }
serde = { workspace = true, features = [ "derive" ] }
serde_json.workspace = true
serde_yaml = { workspace = true }
sqlx.workspace = true
sui-keys.workspace = true
sui-sdk.workspace = true
thiserror = { workspace = true }
tokenizers.workspace = true
tokio = { workspace = true, features = ["full"] }
tonic = { workspace = true, features = ["tls", "tls-roots", "prost"] }
tokio = { workspace = true, features = [ "full" ] }
tonic = { workspace = true, features = [ "prost", "tls", "tls-roots" ] }
tower = { workspace = true }
tower-http = { workspace = true, features = ["cors"] }
tower-http = { workspace = true, features = [ "cors" ] }
tracing.workspace = true
tracing-appender.workspace = true
tracing-opentelemetry = { workspace = true }
tracing-subscriber = { workspace = true, features = [
"env-filter",
"json",
"time",
] }
tracing.workspace = true
utoipa = { workspace = true, features = ["axum_extras", "preserve_path_order"] }
utoipa-swagger-ui = { workspace = true, features = ["axum"] }
tracing-subscriber = { workspace = true, features = [ "env-filter", "json", "time" ] }
utoipa = { workspace = true, features = [ "axum_extras", "preserve_path_order" ] }
utoipa-swagger-ui = { workspace = true, features = [ "axum" ] }

[features]
google-oauth = ["atoma-auth/google-oauth", "atoma-proxy-service/google-oauth"]
google-oauth = [ "atoma-auth/google-oauth", "atoma-proxy-service/google-oauth" ]
Loading
Loading