diff --git a/CLI_REFERENCE.md b/CLI_REFERENCE.md index d198aeaa..9d69aefe 100644 --- a/CLI_REFERENCE.md +++ b/CLI_REFERENCE.md @@ -987,8 +987,8 @@ $ aignostics qupath install [OPTIONS] * `--version TEXT`: Version of QuPath to install. Do not change this unless you know what you are doing. [default: 0.6.0-rc5] * `--path DIRECTORY`: Path to install QuPath to. If not specified, the default installation path will be used.Do not change this unless you know what you are doing. [default: (~/Library/Application Support/aignostics)] * `--reinstall / --no-reinstall`: Reinstall QuPath even if it is already installed. This will overwrite the existing installation. [default: reinstall] -* `--platform-system TEXT`: Override the system to assume for the installation. This is useful for testing purposes. [default: Darwin] -* `--platform-machine TEXT`: Override the machine architecture to assume for the installation. This is useful for testing purposes. [default: arm64] +* `--platform-system TEXT`: Override the system to assume for the installation. This is useful for testing purposes. [default: Linux] +* `--platform-machine TEXT`: Override the machine architecture to assume for the installation. This is useful for testing purposes. [default: x86_64] * `--help`: Show this message and exit. ### `aignostics qupath launch` diff --git a/src/aignostics/platform/_authentication.py b/src/aignostics/platform/_authentication.py index d7683007..8213dcd0 100644 --- a/src/aignostics/platform/_authentication.py +++ b/src/aignostics/platform/_authentication.py @@ -141,6 +141,8 @@ def get_token(use_cache: bool = True, use_device_flow: bool = False) -> str: # 1. Do not want to use the cached token # 2. The cached token is expired # 3. No token was cached yet + + token = _authenticate(use_device_flow) claims = verify_and_decode_token(token) @@ -186,6 +188,7 @@ def _authenticate(use_device_flow: bool) -> str: RuntimeError: If authentication fails. AssertionError: If the returned token doesn't have the expected format. """ + # have another setting which says no authentication if refresh_token := settings().refresh_token: token = _access_token_from_refresh_token(refresh_token) elif _can_open_browser() and not use_device_flow: diff --git a/src/aignostics/platform/_client.py b/src/aignostics/platform/_client.py index 02f8dd01..584b4c34 100644 --- a/src/aignostics/platform/_client.py +++ b/src/aignostics/platform/_client.py @@ -291,6 +291,8 @@ def get_api_client(cache_token: bool = True) -> PublicApi: return Client._api_client_uncached def token_provider() -> str: + # # given some setting do not inject token_provider into client + return None return get_token(use_cache=cache_token) ca_file = os.getenv("REQUESTS_CA_BUNDLE") # point to .cer file of proxy if defined diff --git a/src/aignostics/platform/_settings.py b/src/aignostics/platform/_settings.py index b6c58610..a3f21b69 100644 --- a/src/aignostics/platform/_settings.py +++ b/src/aignostics/platform/_settings.py @@ -543,6 +543,14 @@ def pre_init(cls, values: dict) -> dict: # type: ignore[type-arg] # noqa: N805 values["device_url"] = DEVICE_URL_DEV values["jws_json_url"] = JWS_JSON_URL_DEV values["client_id_interactive"] = CLIENT_ID_INTERACTIVE_DEV + case x if x == "http://localhost:8000": + values["audience"] = "abcfsofihaosfih" + values["authorization_base_url"] = "abc" + values["token_url"] = "http://localhost:8000" + values["redirect_uri"] = "http://localhost:8000" + values["device_url"] = "http://localhost:8000" + values["jws_json_url"] = "http://localhost:8000" + values["client_id_interactive"] = "abc" case _: raise ValueError(UNKNOWN_ENDPOINT_URL) diff --git a/tests/constants_test.py b/tests/constants_test.py index d3407035..39edd8ea 100644 --- a/tests/constants_test.py +++ b/tests/constants_test.py @@ -38,6 +38,8 @@ SPOT_3_WIDTH = 4016 SPOT_3_HEIGHT = 3952 +# adapt to the DB seed + match os.getenv("AIGNOSTICS_PLATFORM_ENVIRONMENT", "production"): case "production": TEST_APPLICATION_ID = "test-app"