-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: optimize authentication for the new rdu-stage (#122)
- Loading branch information
Showing
2 changed files
with
8 additions
and
4 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import os | ||
import re | ||
|
||
from dotenv import load_dotenv | ||
|
||
|
@@ -14,9 +15,12 @@ def _get_login_credentials(host: str) -> tuple[str, str]: | |
if host == Hosts.LOCALHOST: | ||
user = "[email protected]" | ||
pw = "test" | ||
elif host == Hosts.TEST: | ||
user = os.getenv("TEST_EMAIL") or "" | ||
pw = os.getenv("TEST_PASSWORD") or "" | ||
elif host == Hosts.RDU_STAGE: | ||
user = os.getenv("RDU_STAGE_EMAIL") or "" | ||
pw = os.getenv("RDU_STAGE_PASSWORD") or "" | ||
elif re.search(r"api.rdu-\d\d.dasch.swiss", host): | ||
user = os.getenv("RDU_TEST_EMAIL") or "" | ||
pw = os.getenv("RDU_TEST_PASSWORD") or "" | ||
elif host == Hosts.DEV: | ||
user = os.getenv("DEV_EMAIL") or "" | ||
pw = os.getenv("DEV_PASSWORD") or "" | ||
|