-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed the fallback to environment vars
I asked for feedback about the inclusion of a fallback to ENV. I concluded that it's better to be explicit.
- Loading branch information
Eric Biggs
committed
Sep 13, 2024
1 parent
57c107c
commit f8019e6
Showing
2 changed files
with
14 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,11 +9,7 @@ async fn create_client_test_valid() { | |
let test_api_key = env::var("SUPABASE_API_KEY").unwrap(); | ||
let test_jwt_secret = env::var("SUPABASE_JWT_SECRET").unwrap(); | ||
|
||
let auth_client = AuthClient::new( | ||
Some(&test_project_url), | ||
Some(&test_api_key), | ||
Some(&test_jwt_secret), | ||
); | ||
let auth_client = AuthClient::new(&test_project_url, &test_api_key, &test_jwt_secret); | ||
|
||
assert!(auth_client.project_url == test_project_url) | ||
} | ||
|
@@ -24,11 +20,7 @@ async fn sign_in_with_password_test_valid() { | |
let test_api_key = env::var("SUPABASE_API_KEY").unwrap(); | ||
let test_jwt_secret = env::var("SUPABASE_JWT_SECRET").unwrap(); | ||
|
||
let auth_client = AuthClient::new( | ||
Some(&test_project_url), | ||
Some(&test_api_key), | ||
Some(&test_jwt_secret), | ||
); | ||
let auth_client = AuthClient::new(&test_project_url, &test_api_key, &test_jwt_secret); | ||
|
||
let demo_email = "[email protected]"; | ||
let demo_password = "qwerqwer"; | ||
|
@@ -50,11 +42,7 @@ async fn sign_in_with_password_test_invalid() { | |
let test_api_key = env::var("SUPABASE_API_KEY").unwrap(); | ||
let test_jwt_secret = env::var("SUPABASE_JWT_SECRET").unwrap(); | ||
|
||
let auth_client = AuthClient::new( | ||
Some(&test_project_url), | ||
Some(&test_api_key), | ||
Some(&test_jwt_secret), | ||
); | ||
let auth_client = AuthClient::new(&test_project_url, &test_api_key, &test_jwt_secret); | ||
|
||
let demo_email = "[email protected]"; | ||
let demo_password = "invalid"; | ||
|
@@ -76,11 +64,7 @@ async fn sign_up_with_email_test_valid() { | |
let test_api_key = env::var("SUPABASE_API_KEY").unwrap(); | ||
let test_jwt_secret = env::var("SUPABASE_JWT_SECRET").unwrap(); | ||
|
||
let auth_client = AuthClient::new( | ||
Some(&test_project_url), | ||
Some(&test_api_key), | ||
Some(&test_jwt_secret), | ||
); | ||
let auth_client = AuthClient::new(&test_project_url, &test_api_key, &test_jwt_secret); | ||
|
||
let uuid = uuid::Uuid::now_v7(); | ||
|
||
|
@@ -108,11 +92,7 @@ async fn sign_up_with_phone_test_valid() { | |
let test_api_key = env::var("SUPABASE_API_KEY").unwrap(); | ||
let test_jwt_secret = env::var("SUPABASE_JWT_SECRET").unwrap(); | ||
|
||
let auth_client = AuthClient::new( | ||
Some(&test_project_url), | ||
Some(&test_api_key), | ||
Some(&test_jwt_secret), | ||
); | ||
let auth_client = AuthClient::new(&test_project_url, &test_api_key, &test_jwt_secret); | ||
|
||
let demo_phone = "13334445555"; | ||
let demo_password = "ciJUAojfZZYKfCxkiUWH"; | ||
|
@@ -138,11 +118,7 @@ async fn send_login_email_with_magic_link() { | |
let test_api_key = env::var("SUPABASE_API_KEY").unwrap(); | ||
let test_jwt_secret = env::var("SUPABASE_JWT_SECRET").unwrap(); | ||
|
||
let auth_client = AuthClient::new( | ||
Some(&test_project_url), | ||
Some(&test_api_key), | ||
Some(&test_jwt_secret), | ||
); | ||
let auth_client = AuthClient::new(&test_project_url, &test_api_key, &test_jwt_secret); | ||
|
||
let demo_email = "[email protected]"; | ||
|
||
|
@@ -167,11 +143,7 @@ async fn send_sms_with_otp() { | |
let test_api_key = env::var("SUPABASE_API_KEY").unwrap(); | ||
let test_jwt_secret = env::var("SUPABASE_JWT_SECRET").unwrap(); | ||
|
||
let auth_client = AuthClient::new( | ||
Some(&test_project_url), | ||
Some(&test_api_key), | ||
Some(&test_jwt_secret), | ||
); | ||
let auth_client = AuthClient::new(&test_project_url, &test_api_key, &test_jwt_secret); | ||
|
||
let demo_phone = "1333444555"; | ||
|
||
|
@@ -194,11 +166,7 @@ async fn sign_in_with_oauth_test() { | |
let test_api_key = env::var("SUPABASE_API_KEY").unwrap(); | ||
let test_jwt_secret = env::var("SUPABASE_JWT_SECRET").unwrap(); | ||
|
||
let auth_client = AuthClient::new( | ||
Some(&test_project_url), | ||
Some(&test_api_key), | ||
Some(&test_jwt_secret), | ||
); | ||
let auth_client = AuthClient::new(&test_project_url, &test_api_key, &test_jwt_secret); | ||
|
||
// Must login to get a user bearer token | ||
let demo_email = "[email protected]"; | ||
|
@@ -234,11 +202,7 @@ async fn get_user_test() { | |
let test_api_key = env::var("SUPABASE_API_KEY").unwrap(); | ||
let test_jwt_secret = env::var("SUPABASE_JWT_SECRET").unwrap(); | ||
|
||
let auth_client = AuthClient::new( | ||
Some(&test_project_url), | ||
Some(&test_api_key), | ||
Some(&test_jwt_secret), | ||
); | ||
let auth_client = AuthClient::new(&test_project_url, &test_api_key, &test_jwt_secret); | ||
|
||
// Must login to get a user bearer token | ||
let demo_email = "[email protected]"; | ||
|
@@ -267,11 +231,7 @@ async fn update_user_test() { | |
let test_api_key = env::var("SUPABASE_API_KEY").unwrap(); | ||
let test_jwt_secret = env::var("SUPABASE_JWT_SECRET").unwrap(); | ||
|
||
let auth_client = AuthClient::new( | ||
Some(&test_project_url), | ||
Some(&test_api_key), | ||
Some(&test_jwt_secret), | ||
); | ||
let auth_client = AuthClient::new(&test_project_url, &test_api_key, &test_jwt_secret); | ||
|
||
// Must login to get a user bearer token | ||
let demo_email = "[email protected]"; | ||
|