-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #921 from sirosen/deprecate-validate
Deprecate `oauth2_validate_token`
- Loading branch information
Showing
3 changed files
with
31 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Deprecated | ||
~~~~~~~~~~ | ||
|
||
- ``NativeAppAuthClient.oauth2_validate_token`` and | ||
``ConfidentialAppAuthClient.oauth2_validate_token`` have been deprecated, as | ||
their usage is discouraged by the Auth service. (:pr:`NUMBER`) |
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
18 changes: 15 additions & 3 deletions
18
tests/functional/services/auth/base/test_oauth2_validate_token.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 |
---|---|---|
@@ -1,6 +1,18 @@ | ||
import pytest | ||
|
||
import globus_sdk | ||
from globus_sdk._testing import RegisteredResponse, load_response | ||
|
||
@pytest.mark.xfail | ||
def test_oauth2_validate_token(): | ||
raise NotImplementedError | ||
|
||
def test_oauth2_validate_token_emits_deprecation_warning(): | ||
nc = globus_sdk.NativeAppAuthClient("dummy_client_id") | ||
load_response( | ||
RegisteredResponse( | ||
service="auth", | ||
path="/v2/oauth2/token/validate", | ||
method="POST", | ||
json={"foo": "bar"}, | ||
) | ||
) | ||
with pytest.warns(globus_sdk.RemovedInV4Warning): | ||
nc.oauth2_validate_token("dummy_token") |