diff --git a/.env b/.env index 131d6d5..4905119 100644 --- a/.env +++ b/.env @@ -8,3 +8,4 @@ POSTGRES_MAIN_DB=my_db POSTGRES_MAIN_HOST=localhost DATABASE_URL=postgres://${POSTGRES_MAIN_USER}:${POSTGRES_MAIN_PASSWORD}@${POSTGRES_MAIN_HOST}:5432/${POSTGRES_MAIN_DB} ICARUS_BASE_API_URL=https://icarus.com +ICARUS_AUTH_BASE_API_URL=https://auth.icarus.com diff --git a/.env.sample b/.env.sample index 131d6d5..4905119 100644 --- a/.env.sample +++ b/.env.sample @@ -8,3 +8,4 @@ POSTGRES_MAIN_DB=my_db POSTGRES_MAIN_HOST=localhost DATABASE_URL=postgres://${POSTGRES_MAIN_USER}:${POSTGRES_MAIN_PASSWORD}@${POSTGRES_MAIN_HOST}:5432/${POSTGRES_MAIN_DB} ICARUS_BASE_API_URL=https://icarus.com +ICARUS_AUTH_BASE_API_URL=https://auth.icarus.com diff --git a/.gitea/workflows/tag_release.yml b/.gitea/workflows/tag_release.yml index 5a4e49c..f7b78e7 100644 --- a/.gitea/workflows/tag_release.yml +++ b/.gitea/workflows/tag_release.yml @@ -4,6 +4,9 @@ on: push: branches: - main + pull_request: + branches: + - main jobs: release: diff --git a/Cargo.lock b/Cargo.lock index d52baf3..ab87d49 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -297,7 +297,7 @@ checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" [[package]] name = "icarus_envy" -version = "0.3.1" +version = "0.3.2" dependencies = [ "async-std", "const_format", diff --git a/Cargo.toml b/Cargo.toml index 0f08fad..8cfc376 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "icarus_envy" -version = "0.3.1" +version = "0.3.2" edition = "2024" rust-version = "1.88" diff --git a/src/environment.rs b/src/environment.rs index 1b36c8e..d001768 100644 --- a/src/environment.rs +++ b/src/environment.rs @@ -27,3 +27,9 @@ pub async fn get_icarus_base_api_url() -> String { dotenvy::dotenv().ok(); std::env::var(crate::keys::ICARUS_BASE_API_URL).expect(crate::keys::error::ICARUS_BASE_API_URL) } + +pub async fn get_icarus_auth_base_api_url() -> String { + dotenvy::dotenv().ok(); + std::env::var(crate::keys::ICARUS_AUTH_BASE_API_URL) + .expect(crate::keys::error::ICARUS_AUTH_BASE_API_URL) +} diff --git a/src/keys.rs b/src/keys.rs index 2d88721..2a9a8aa 100644 --- a/src/keys.rs +++ b/src/keys.rs @@ -18,6 +18,9 @@ pub const ROOT_DIRECTORY: &str = "ROOT_DIRECTORY"; // Environment key for icarus api url pub const ICARUS_BASE_API_URL: &str = "ICARUS_BASE_API_URL"; +// Environment key for icarus auth api url +pub const ICARUS_AUTH_BASE_API_URL: &str = "ICARUS_AUTH_BASE_API_URL"; + pub mod error { use const_format::concatcp; @@ -28,4 +31,6 @@ pub mod error { pub const SECRET_KEY: &str = concatcp!(super::SECRET_KEY, " ", GENERAL_ERROR); pub const ROOT_DIRECTORY: &str = concatcp!(super::ROOT_DIRECTORY, " ", GENERAL_ERROR); pub const ICARUS_BASE_API_URL: &str = concatcp!(super::ICARUS_BASE_API_URL, " ", GENERAL_ERROR); + pub const ICARUS_AUTH_BASE_API_URL: &str = + concatcp!(super::ICARUS_AUTH_BASE_API_URL, " ", GENERAL_ERROR); }