Skip to content

Commit

Permalink
Merge branch 'main' into wip/make-wordweb-public
Browse files Browse the repository at this point in the history
  • Loading branch information
jnussbaum authored Aug 9, 2024
2 parents 0e781d6 + 46c799e commit c3934fc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dsp_permissions_scripts/models/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class Hosts:

LOCALHOST = "http://0.0.0.0:3333"
PROD = "https://api.dasch.swiss"
TEST = "https://api.test.dasch.swiss"
RDU_STAGE = "https://api.rdu-stage.dasch.swiss"
DEV = "https://api.dev.dasch.swiss"
LS_PROD = "https://api.ls-prod.admin.ch"
STAGE = "https://api.stage.dasch.swiss"
Expand Down
4 changes: 2 additions & 2 deletions dsp_permissions_scripts/models/scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,6 @@ def remove(
)

PRIVATE = PermissionScope.create(
CR={PROJECT_ADMIN, CREATOR},
V={PROJECT_MEMBER},
CR={PROJECT_ADMIN},
M={PROJECT_MEMBER},
)
10 changes: 7 additions & 3 deletions dsp_permissions_scripts/utils/authentication.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import re

from dotenv import load_dotenv

Expand All @@ -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 ""
Expand Down

0 comments on commit c3934fc

Please sign in to comment.