Skip to content

Commit

Permalink
test(FTL-17136): integration tests (#59)
Browse files Browse the repository at this point in the history
* feat: add authentication to integrtion tests

* test: add integration tests covering different message types for /inbound

* test: add integration tests to /outbound endpoint

* feat: add integration tests for /list, /fetch and delete

* chore: refactor tests

* chore: refactor validations

* test: generate secrets on fly for integration tests and inject did to config

* test: increase waiting time for server to spin up

* feat: test pipeline with redis

* feat: trigger workflow on branch

* feat: generate local certs on the fly

* feat: revert workflow changes

* feat: formatting

* chore: test redis service workflow

* fix: init redis for coverage check

* feat: enable redis service explicitly in workflow

* feat: disable redis service

* feat: use main rust pipeline

* fix: checks

* feat: improve naming

* feat: replace all my_ to actor
  • Loading branch information
YoussefAWasfy authored Oct 9, 2024
1 parent ff66fa0 commit fbba220
Show file tree
Hide file tree
Showing 7 changed files with 1,383 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ on:
types:
- opened
- synchronize

jobs:
rust-pipeline:
uses: affinidi/pipeline-rust/.github/workflows/checks.yaml@main
secrets: inherit
with:
auditIgnore: "RUSTSEC-2022-0040,RUSTSEC-2023-0071,RUSTSEC-2024-0373"
coverage: 10
useRedis: true
1 change: 1 addition & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions affinidi-messaging-mediator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@ rcgen = { version = "0.13", default-features = false, features = [
"aws_lc_rs",
"pem",
] }
lazy_static = "1.4.0"
time = "0.3"
43 changes: 43 additions & 0 deletions affinidi-messaging-mediator/tests/common.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
use lazy_static::lazy_static;
use serde_json::{json, Value};

pub const ALICE_DID: &str = "did:peer:2.Vz6MkgWJfVmPELozq6aCycK3CpxHN8Upphn3WSuQkWY6iqsjF.EzQ3shfb7vwQaTJqFkt8nRfo7Nu98tmeYpdDfWgrqQitDaqXRz";
pub const MEDIATOR_API: &str = "https://localhost:7037/mediator/v1";
pub const BOB_DID: &str = "did:peer:2.Vz6Mkihn2R3M8nY62EFJ7MAVXu7YxsTnuS5iAhmn3qKJbkdFf.EzQ3shpZRBUtewwzYiueXgDqs1bvGNkSyGoRgsbZJXt3TTb9jD.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6Imh0dHBzOi8vbG9jYWxob3N0OjcwMzcvIiwiYWNjZXB0IjpbImRpZGNvbW0vdjIiXSwicm91dGluZ19rZXlzIjpbXX0sImlkIjpudWxsfQ";
pub const SECRETS_PATH: &str = "../affinidi-messaging-mediator/conf/secrets.json";
pub const CONFIG_PATH: &str = "../affinidi-messaging-mediator/conf/mediator.toml";

lazy_static! {
// Signing and verification key
pub static ref ALICE_V1: Value = json!({
"crv": "Ed25519",
"d": "LLWCf83n8VsUYq31zlZRe0NNMCcn1N4Dh85dGpIqSFw",
"kty": "OKP",
"x": "Hn8T4ZjjT0oJ6rjhqox8AykwC3GDFsJF6KkaYZExwQo"
});

// Encryption key
pub static ref ALICE_E1: Value = json!({
"crv": "secp256k1",
"d": "oi-dXG4EqfNODFPjv2vkieoLdbQZH9k6dwPDV8HDoms",
"kty": "EC",
"x": "DhfaXbhwo0KkOiyA5V1K1RZx6Ikr86h_lX5GOwxjmjE",
"y": "PpYqybOwMsm64vftt-7gBCQPIUbglMmyy_6rloSSAPk"
});

pub static ref BOB_V1: Value = json!({
"crv": "Ed25519",
"d": "FZMJijqdcp7PCQShgtFj6Ud3vjZY7jFZBVvahziaMMM",
"kty": "OKP",
"x": "PybG95kyeSfGRebp4T7hzA7JQuysc6mZ97nM2ety6Vo"
});

pub static ref BOB_E1: Value = json!({
"crv": "secp256k1",
"d": "ai7B5fgT3pCBHec0I4Y1xXpSyrEHlTy0hivSlddWHZE",
"kty": "EC",
"x": "k2FhEi8WMxr4Ztr4u2xjKzDESqVnGg_WKrN1820wPeA",
"y": "fq0DnZ_duPWyeFK0k93bAzjNJVVHEjHFRlGOJXKDS18"
});

}
Loading

0 comments on commit fbba220

Please sign in to comment.