-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PT-4349] Drop project authentication (#591)
* Drop project authentication in the main code and viztools.py * Simplify settings detection * Drop project token retriever * Clean up and changelog entries
- Loading branch information
Showing
17 changed files
with
41 additions
and
216 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
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,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "up42-py" | ||
version = "1.0.0a5" | ||
version = "1.0.0a6" | ||
description = "Python SDK for UP42, the geospatial marketplace and developer platform." | ||
authors = ["UP42 GmbH <[email protected]>"] | ||
license = "https://github.com/up42/up42-py/blob/master/LICENSE" | ||
|
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 |
---|---|---|
|
@@ -2,13 +2,12 @@ | |
import requests_mock as req_mock | ||
|
||
from up42 import auth as up42_auth | ||
from up42 import main | ||
|
||
from . import fixtures_globals as constants | ||
|
||
|
||
@pytest.fixture(name="auth_project_mock") | ||
def _auth_project_mock(requests_mock: req_mock.Mocker) -> up42_auth.Auth: | ||
@pytest.fixture | ||
def auth_mock(requests_mock: req_mock.Mocker) -> up42_auth.Auth: | ||
json_get_token = { | ||
"data": {"accessToken": constants.TOKEN}, | ||
"access_token": constants.TOKEN, | ||
|
@@ -19,8 +18,6 @@ def _auth_project_mock(requests_mock: req_mock.Mocker) -> up42_auth.Auth: | |
url="https://api.up42.com/users/me", | ||
json={"data": {"id": constants.WORKSPACE_ID}}, | ||
) | ||
auth = up42_auth.Auth(project_id=constants.PROJECT_ID, project_api_key=constants.PROJECT_APIKEY) | ||
|
||
# get_blocks | ||
url_get_blocks = f"{constants.API_HOST}/blocks" | ||
requests_mock.get( | ||
|
@@ -33,25 +30,4 @@ def _auth_project_mock(requests_mock: req_mock.Mocker) -> up42_auth.Auth: | |
url=url_get_credits_balance, | ||
json=constants.JSON_BALANCE, | ||
) | ||
|
||
return auth | ||
|
||
|
||
@pytest.fixture(name="auth_account_mock") | ||
def _auth_account_mock(requests_mock: req_mock.Mocker) -> up42_auth.Auth: | ||
json_get_token = { | ||
"data": {"accessToken": constants.TOKEN}, | ||
"access_token": constants.TOKEN, | ||
"token_type": "bearer", | ||
} | ||
requests_mock.post("https://api.up42.com/oauth/token", json=json_get_token) | ||
requests_mock.get(url="https://api.up42.com/users/me", json={"data": {"id": constants.WORKSPACE_ID}}) | ||
return up42_auth.Auth(username="[email protected]", password="password") | ||
|
||
|
||
@pytest.fixture(name="auth_mock", params=["project", "account"]) | ||
def _auth_mock(request, auth_project_mock, auth_account_mock) -> up42_auth.Auth: | ||
mocks = {"project": auth_project_mock, "account": auth_account_mock} | ||
auth_mock = mocks[request.param] | ||
main._auth = auth_mock # pylint: disable=protected-access | ||
return auth_mock | ||
return up42_auth.Auth(username=constants.USER_EMAIL, password=constants.PASSWORD) |
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 |
---|---|---|
|
@@ -28,8 +28,6 @@ | |
) | ||
STAC_ASSET_HREF = "https://api.up42.com/v2/assets/v3b3e203-346d-4f67-b79b-895c36983fb8" | ||
STAC_ASSET_ID = "v3b3e203-346d-4f67-b79b-895c36983fb8" | ||
PROJECT_ID = "f19e833d-e698-4d9e-a037-2e6dbd8791ef" | ||
PROJECT_APIKEY = "project_apikey_123" | ||
|
||
# tasking constants | ||
QUOTATION_ID = "805b1f27-1025-43d2-90d0-0bd3416238fb" | ||
|
@@ -40,7 +38,8 @@ | |
|
||
WORKSPACE_ID = "workspace_id_123" | ||
USER_ID = "1094497b-11d8-4fb8-9d6a-5e24a88aa825" | ||
|
||
USER_EMAIL = "[email protected]" | ||
PASSWORD = "<PASSWORD>" | ||
|
||
DATA_PRODUCT_ID = "47dadb27-9532-4552-93a5-48f70a83eaef" | ||
|
||
|
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.