forked from ITISFoundation/osparc-simcore
-
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.
Merge branch 'master' into buy-credits
- Loading branch information
Showing
13 changed files
with
189 additions
and
101 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
26 changes: 26 additions & 0 deletions
26
packages/simcore-sdk/src/simcore_sdk/node_ports_common/storage_endpoint.py
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from functools import lru_cache | ||
|
||
from aiohttp import BasicAuth | ||
from settings_library.node_ports import NodePortsSettings | ||
|
||
|
||
@lru_cache | ||
def get_base_url() -> str: | ||
settings = NodePortsSettings.create_from_envs() | ||
base_url: str = settings.NODE_PORTS_STORAGE_AUTH.api_base_url | ||
return base_url | ||
|
||
|
||
@lru_cache | ||
def get_basic_auth() -> BasicAuth | None: | ||
settings = NodePortsSettings.create_from_envs() | ||
node_ports_storage_auth = settings.NODE_PORTS_STORAGE_AUTH | ||
|
||
if node_ports_storage_auth.auth_required: | ||
assert node_ports_storage_auth.STORAGE_USERNAME is not None # nosec | ||
assert node_ports_storage_auth.STORAGE_PASSWORD is not None # nosec | ||
return BasicAuth( | ||
login=node_ports_storage_auth.STORAGE_USERNAME, | ||
password=node_ports_storage_auth.STORAGE_PASSWORD.get_secret_value(), | ||
) | ||
return None |
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
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
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
Oops, something went wrong.