From 8cf4e75325e6d3933f3c726c504a44c86c7c982a Mon Sep 17 00:00:00 2001 From: Excavator Bot <33266368+svc-excavator-bot@users.noreply.github.com> Date: Thu, 19 Sep 2024 08:40:46 -0700 Subject: [PATCH] Excavator: Upgrade API Version (#28) --- README.md | 2 +- foundry/_core/confidential_client_auth.py | 9 ++------- foundry/_versions.py | 2 +- tests/test_foundry_token_oauth_client.py | 14 -------------- 4 files changed, 4 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 6880bb13..17e612eb 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Palantir provides two different Python Software Development Kits (SDKs) for inte The Ontology SDK allows you to access the full power of the Ontology directly from your development environment. You can generate the Ontology SDK using the Developer Console, a portal for creating and managing applications using Palantir APIs. Review the [Ontology SDK documentation](https://www.palantir.com/docs/foundry/ontology-sdk) for more information. ### Foundry Platform SDK -The Foundry Platform Software Development Kit (SDK) is generated from the Foundry API's OpenAPI specification +The Foundry Platform Software Development Kit (SDK) is generated from the Foundry API specification file. The intention of this SDK is to encompass endpoints related to interacting with the platform itself. Although there are Ontology services included by this SDK, this SDK surfaces endpoints for interacting with Ontological resources such as object types, link types, and action types. In contrast, the OSDK allows you to interact with objects, links and Actions (for example, querying your objects, applying an action). diff --git a/foundry/_core/confidential_client_auth.py b/foundry/_core/confidential_client_auth.py index 9d9da03c..86a11f8d 100644 --- a/foundry/_core/confidential_client_auth.py +++ b/foundry/_core/confidential_client_auth.py @@ -40,7 +40,7 @@ class ConfidentialClientAuth(Auth): :param client_id: OAuth client id to be used by the application. :param client_secret: OAuth client secret to be used by the application. - :param scopes: The list of scopes to request. + :param scopes: The list of scopes to request. By default, no specific scope is provided and a token will be returned with all scopes. :param hostname: Hostname for authentication and ontology endpoints. """ @@ -49,14 +49,9 @@ def __init__( client_id: str, client_secret: str, hostname: str, - scopes: List[str], + scopes: Optional[List[str]] = None, should_refresh: bool = False, ) -> None: - if len(scopes) == 0: - raise ValueError( - "You have not provided any scopes. At least one scope must be provided." - ) - self._client_id = client_id self._client_secret = client_secret self._token: Optional[OAuthToken] = None diff --git a/foundry/_versions.py b/foundry/_versions.py index 74331455..e80f7a17 100644 --- a/foundry/_versions.py +++ b/foundry/_versions.py @@ -17,4 +17,4 @@ # using the autorelease bot __version__ = "0.0.0" -__openapi_document_version__ = "1.926.0" +__openapi_document_version__ = "1.928.0" diff --git a/tests/test_foundry_token_oauth_client.py b/tests/test_foundry_token_oauth_client.py index cad5dab2..8673397d 100644 --- a/tests/test_foundry_token_oauth_client.py +++ b/tests/test_foundry_token_oauth_client.py @@ -19,20 +19,6 @@ from foundry._errors.not_authenticated import NotAuthenticated -def test_fails_no_escopes(): - with pytest.raises(ValueError) as info: - ConfidentialClientAuth( - client_id="123", - client_secret="abc", - hostname="example.com", - scopes=[], - ) - - assert ( - str(info.value) == "You have not provided any scopes. At least one scope must be provided." - ) - - def test_can_pass_config(): config = ConfidentialClientAuth( client_id="123",