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

refactor: Split crates into services and context #491

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/aliyun_oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Test
working-directory: ./crates/reqsign-aliyun-oss
working-directory: ./services/aliyun-oss
run: cargo test --no-fail-fast
env:
RUST_LOG: DEBUG
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/aws_v4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Test
working-directory: ./crates/reqsign-aws-v4
working-directory: ./services/aws-v4
run: cargo test --no-fail-fast
env:
RUST_LOG: DEBUG
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
core.setSecret(id_token)

- name: Test
working-directory: ./crates/reqsign-aws-v4
working-directory: ./services/aws-v4
run: cargo test --no-fail-fast
env:
RUST_LOG: DEBUG
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/azure_storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Test
working-directory: ./crates/reqsign-aws-v4
working-directory: ./services/aws-v4
run: cargo test --no-fail-fast
env:
RUST_LOG: DEBUG
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Test
working-directory: ./crates/reqsign-core
run: cargo test --no-fail-fast
env:
RUST_LOG: DEBUG
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/google.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Test
working-directory: ./crates/reqsign-google
working-directory: ./services/google
run: cargo test --no-fail-fast
env:
RUST_LOG: DEBUG
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
service_account: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}

- name: Test
working-directory: ./crates/reqsign-google
working-directory: ./services/google
run: cargo test --no-fail-fast
env:
RUST_LOG: DEBUG
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/huaweicloud_obs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Test
working-directory: ./crates/reqsign-huaweicloud-obs
working-directory: ./services/huaweicloud-obs
run: cargo test --no-fail-fast
env:
RUST_LOG: DEBUG
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/oracle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Test
working-directory: ./crates/reqsign-oracle
working-directory: ./services/oracle
run: cargo test --no-fail-fast
env:
RUST_LOG: DEBUG
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tencent_cos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Test
working-directory: ./crates/reqsign-tencent-cos
working-directory: ./services/tencent-cos
run: cargo test --no-fail-fast
env:
RUST_LOG: DEBUG
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
core.setSecret(id_token)

- name: Test
working-directory: ./crates/reqsign-tencent-cos
working-directory: ./services/tencent-cos
run: cargo test --no-fail-fast
env:
RUST_LOG: DEBUG
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace]
members = ["crates/*"]
members = ["core", "context/*", "services/*"]
resolver = "2"

[workspace.package]
Expand Down Expand Up @@ -31,7 +31,7 @@ percent-encoding = "2"
pretty_assertions = "1.3"
quick-xml = { version = "0.36", features = ["serialize"] }
rand = "0.8.5"
reqsign-core = { version = "0.16", path = "crates/reqsign-core" }
reqsign-core = { version = "0.16", path = "core" }
reqwest = { version = "0.12", default-features = false }
rsa = { version = "0.9.2", features = ["pkcs5", "sha2"] }
rust-ini = { version = "0.21" }
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ mod tests {
fn test_signer_with_oidc() -> Result<()> {
let _ = env_logger::builder().is_test(true).try_init();

dotenv::from_filename(".env").ok();
dotenv::from_filename("../../../.env").ok();

if env::var("REQSIGN_ALIYUN_OSS_TEST").is_err()
|| env::var("REQSIGN_ALIYUN_OSS_TEST").unwrap() != "on"
Expand Down Expand Up @@ -358,7 +358,7 @@ mod tests {
fn test_signer_with_oidc_query() -> Result<()> {
let _ = env_logger::builder().try_init();

dotenv::from_filename(".env").ok();
dotenv::from_filename("../../../.env").ok();

if env::var("REQSIGN_ALIYUN_OSS_TEST").is_err()
|| env::var("REQSIGN_ALIYUN_OSS_TEST").unwrap() != "on"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use reqwest::Client;
fn init_signer() -> Option<(Loader, Signer)> {
let _ = env_logger::builder().is_test(true).try_init();

dotenv::from_filename(".env").ok();
dotenv::from_filename("../../../.env").ok();

if env::var("REQSIGN_ALIYUN_OSS_TEST").is_err()
|| env::var("REQSIGN_ALIYUN_OSS_TEST").unwrap() != "on"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ hex.workspace = true
macro_rules_attribute.workspace = true
once_cell.workspace = true
pretty_assertions.workspace = true
reqsign-http-send-reqwest = { path = "../reqsign-http-send-reqwest" }
reqsign-http-send-reqwest = { path = "../../context/http-send-reqwest" }
reqwest = { workspace = true, features = ["rustls-tls"] }
sha2.workspace = true
temp-env.workspace = true
Expand All @@ -47,4 +47,4 @@ test-case.workspace = true
tokio = { workspace = true, features = ["full"] }

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
reqsign-file-read-tokio = { path = "../reqsign-file-read-tokio" }
reqsign-file-read-tokio = { path = "../../context/file-read-tokio" }
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ mod tests {
async fn test_signer_with_web_loader() -> Result<()> {
let _ = env_logger::builder().is_test(true).try_init();

dotenv::from_filename(".env").ok();
dotenv::from_filename("../../../.env").ok();

if env::var("REQSIGN_AWS_S3_TEST").is_err()
|| env::var("REQSIGN_AWS_S3_TEST").unwrap() != "on"
Expand Down Expand Up @@ -844,7 +844,7 @@ mod tests {
async fn test_signer_with_web_loader_assume_role() -> Result<()> {
let _ = env_logger::builder().is_test(true).try_init();

dotenv::from_filename(".env").ok();
dotenv::from_filename("../../../.env").ok();

if env::var("REQSIGN_AWS_S3_TEST").is_err()
|| env::var("REQSIGN_AWS_S3_TEST").unwrap() != "on"
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use sha2::Sha256;
async fn init_signer() -> Option<(DefaultLoader, Signer)> {
let _ = env_logger::builder().is_test(true).try_init();

dotenv::from_filename(".env").ok();
dotenv::from_filename("../../../.env").ok();

if env::var("REQSIGN_AWS_V4_TEST").is_err() || env::var("REQSIGN_AWS_V4_TEST").unwrap() != "on"
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use reqwest::Client;
fn init_signer() -> Option<(Loader, Signer)> {
let _ = env_logger::builder().is_test(true).try_init();

dotenv::from_filename(".env").ok();
dotenv::from_filename("../../../.env").ok();

if env::var("REQSIGN_AZURE_STORAGE_TEST").is_err()
|| env::var("REQSIGN_AZURE_STORAGE_TEST").unwrap() != "on"
Expand Down Expand Up @@ -292,7 +292,7 @@ async fn test_can_list_container_blobs() -> Result<()> {
#[tokio::test]
async fn test_head_blob_with_ldms() -> Result<()> {
let _ = env_logger::builder().is_test(true).try_init();
dotenv::from_filename(".env").ok();
dotenv::from_filename("../../../.env").ok();

if env::var("REQSIGN_AZURE_STORAGE_TEST").is_err()
|| env::var("REQSIGN_AZURE_STORAGE_TEST").unwrap() != "on"
Expand Down Expand Up @@ -344,7 +344,7 @@ async fn test_head_blob_with_ldms() -> Result<()> {
#[tokio::test]
async fn test_can_list_container_blobs_with_ldms() -> Result<()> {
let _ = env_logger::builder().is_test(true).try_init();
dotenv::from_filename(".env").ok();
dotenv::from_filename("../../../.env").ok();

if env::var("REQSIGN_AZURE_STORAGE_TEST").is_err()
|| env::var("REQSIGN_AZURE_STORAGE_TEST").unwrap() != "on"
Expand Down Expand Up @@ -405,7 +405,7 @@ async fn test_can_list_container_blobs_with_ldms() -> Result<()> {
async fn test_head_blob_with_client_secret() -> Result<()> {
let _ = env_logger::builder().is_test(true).try_init();

dotenv::from_filename(".env").ok();
dotenv::from_filename("../../../.env").ok();

if env::var("REQSIGN_AZURE_STORAGE_TEST").is_err()
|| env::var("REQSIGN_AZURE_STORAGE_TEST").unwrap() != "on"
Expand Down Expand Up @@ -471,7 +471,7 @@ async fn test_head_blob_with_client_secret() -> Result<()> {
async fn test_can_list_container_blobs_client_secret() -> Result<()> {
let _ = env_logger::builder().is_test(true).try_init();

dotenv::from_filename(".env").ok();
dotenv::from_filename("../../../.env").ok();

if env::var("REQSIGN_AZURE_STORAGE_TEST").is_err()
|| env::var("REQSIGN_AZURE_STORAGE_TEST").unwrap() != "on"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use reqwest::Client;
async fn init_signer() -> Option<(CredentialLoader, TokenLoader, Signer)> {
let _ = env_logger::builder().is_test(true).try_init();

dotenv::from_filename(".env").ok();
dotenv::from_filename("../../../.env").ok();

if env::var("REQSIGN_GOOGLE_TEST").is_err() || env::var("REQSIGN_GOOGLE_TEST").unwrap() != "on"
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use reqwest::Client;
fn init_signer() -> Option<(CredentialLoader, Signer)> {
let _ = env_logger::builder().is_test(true).try_init();

dotenv::from_filename(".env").ok();
dotenv::from_filename("../../../.env").ok();
if env::var("REQSIGN_TENCENT_COS_TEST").is_err()
|| env::var("REQSIGN_TENCENT_COS_TEST").unwrap() != "on"
{
Expand Down