Skip to content

Commit

Permalink
Merge pull request #79 from globus/release/0.13.0b2
Browse files Browse the repository at this point in the history
Release/0.13.0b2
  • Loading branch information
kurtmckee authored Dec 16, 2022
2 parents eed727a + c0973d8 commit 3aa0437
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 38 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PyPi Publish
name: Publish to PyPI

on:
release:
Expand All @@ -7,18 +7,18 @@ on:

jobs:
publish:
name: Publish a release to PyPi
name: Publish a release to PyPI
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v1
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Set target python version
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: "3.6.x"
python-version: "3.11"

- name: Install poetry
run: python -m pip install poetry
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ Unreleased changes are documented in files in the `changelog.d`_ directory.

.. scriv-insert-here
.. _changelog-0.13.0b2:

0.13.0b2 — 2022-12-16
=====================

Changes
-------

- Remove an unused parameter from ``TokenChecker``: ``cache_config``.
- Remove a no-op call to Globus Auth during ``TokenChecker`` instantiation.
- Remove the ``ConfigurationError`` class.

.. _changelog-0.13.0b1:

0.13.0b1 — 2022-12-14
Expand Down
10 changes: 0 additions & 10 deletions globus_action_provider_tools/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
RefreshTokenAuthorizer,
)

from globus_action_provider_tools.errors import ConfigurationError

log = logging.getLogger(__name__)


Expand Down Expand Up @@ -356,7 +354,6 @@ def __init__(
client_secret: str,
expected_scopes: Iterable[str],
expected_audience: Optional[str] = None,
cache_config: Optional[dict] = None,
) -> None:
self.auth_client = ConfidentialAppAuthClient(client_id, client_secret)
self.default_expected_scopes = frozenset(expected_scopes)
Expand All @@ -366,13 +363,6 @@ def __init__(
else:
self.expected_audience = expected_audience

# Try to check a 'token' and fail fast here in case client_id/secret are bad:
try:
self.check_token("NotAToken").introspect_token()
except GlobusAPIError as err:
if err.http_status == 401:
raise ConfigurationError("Check client_id and client_secret", err)

def check_token(
self, access_token: str, expected_scopes: Iterable[str] = None
) -> AuthState:
Expand Down
6 changes: 0 additions & 6 deletions globus_action_provider_tools/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,3 @@ class AuthenticationError(ActionProviderToolsError):
"""
An Exception class for errors triggered due to Authentication.
"""


class ConfigurationError(ActionProviderToolsError):
"""
An Exception class for errors triggered by misconfiguration.
"""
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "globus-action-provider-tools"
version = "0.13.0b1"
version = "0.13.0b2"
description = "Tools to help developers build services that implement the Action Provider specification."
authors = [
"Kurt McKee <[email protected]>",
Expand Down
17 changes: 1 addition & 16 deletions tests/test_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@
import pytest
from globus_sdk._testing import load_response

from globus_action_provider_tools.authentication import (
AuthState,
TokenChecker,
identity_principal,
)
from globus_action_provider_tools.errors import ConfigurationError
from globus_action_provider_tools.authentication import AuthState, identity_principal


def get_auth_state_instance(
Expand Down Expand Up @@ -42,16 +37,6 @@ def auth_state(mocked_responses) -> t.Iterator[AuthState]:
yield get_auth_state_instance(["expected-scope"], "expected-audience")


def test_token_checker_bad_credentials():
load_response("token-introspect", case="invalid-client")
with pytest.raises(ConfigurationError):
TokenChecker(
client_id="bogus",
client_secret="bogus",
expected_scopes=("fakescope",),
)


def test_get_identities(auth_state, freeze_time):
response = freeze_time(load_response("token-introspect", case="success"))
assert len(auth_state.identities) == len(response.metadata["identities"])
Expand Down

0 comments on commit 3aa0437

Please sign in to comment.