Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web: bump API Client version #11706

Merged
merged 1 commit into from
Oct 17, 2024
Merged

web: bump API Client version #11706

merged 1 commit into from
Oct 17, 2024

Conversation

authentik-automation[bot]
Copy link
Contributor

web: bump API Client version

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@authentik-automation authentik-automation bot requested a review from a team as a code owner October 17, 2024 12:06
@authentik-automation authentik-automation bot enabled auto-merge (squash) October 17, 2024 12:06
Copy link

netlify bot commented Oct 17, 2024

Deploy Preview for authentik-docs canceled.

Name Link
🔨 Latest commit cf232a8
🔍 Latest deploy log https://app.netlify.com/sites/authentik-docs/deploys/6710fdc0d4a1810008d8e3bb

Copy link

netlify bot commented Oct 17, 2024

Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit cf232a8
🔍 Latest deploy log https://app.netlify.com/sites/authentik-storybook/deploys/6710fdc0e49ebc0008701576
😎 Deploy Preview https://deploy-preview-11706--authentik-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@BeryJu BeryJu disabled auto-merge October 17, 2024 12:08
@BeryJu BeryJu merged commit 0976e05 into main Oct 17, 2024
43 of 48 checks passed
@BeryJu BeryJu deleted the update-web-api-client branch October 17, 2024 12:08
Copy link

codecov bot commented Oct 17, 2024

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
1545 1 1544 1
View the top 1 failed tests by shortest run time
tests.e2e.test_source_oauth_oauth2.TestSourceOAuth2 test_oauth_enroll
Stack Traces | 3.9s run time
self = &lt;docker.api.client.APIClient object at 0x7f836440de20&gt;
response = &lt;Response [404]&gt;

    def _raise_for_status(self, response):
        """Raises stored :class:`APIError`, if one occurred."""
        try:
&gt;           response.raise_for_status()

../../../..../pypoetry/virtualenvs/authentik-xvtLQ9eE-py3.12/lib/python3.12.../docker/api/client.py:275: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = &lt;Response [404]&gt;

    def raise_for_status(self):
        """Raises :class:`HTTPError`, if one occurred."""
    
        http_error_msg = ""
        if isinstance(self.reason, bytes):
            # We attempt to decode utf-8 first because some servers
            # choose to localize their reason strings. If the string
            # isn't utf-8, we fall back to iso-8859-1 for all other
            # encodings. (See PR #3538)
            try:
                reason = self.reason.decode("utf-8")
            except UnicodeDecodeError:
                reason = self.reason.decode("iso-8859-1")
        else:
            reason = self.reason
    
        if 400 &lt;= self.status_code &lt; 500:
            http_error_msg = (
                f"{self.status_code} Client Error: {reason} for url: {self.url}"
            )
    
        elif 500 &lt;= self.status_code &lt; 600:
            http_error_msg = (
                f"{self.status_code} Server Error: {reason} for url: {self.url}"
            )
    
        if http_error_msg:
&gt;           raise HTTPError(http_error_msg, response=self)
E           requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http+docker:.../localhost/v1.45........./containers/56beb6844052025c22eb66c91734ba787395aefca87193244fd7c1c51b3f1572/json

../../../..../pypoetry/virtualenvs/authentik-xvtLQ9eE-py3.12/lib/python3.12.../site-packages/requests/models.py:1024: HTTPError

The above exception was the direct cause of the following exception:

self = &lt;unittest.case._Outcome object at 0x7f836478b0b0&gt;
test_case = &lt;tests.e2e.test_source_oauth_oauth2.TestSourceOAuth2 testMethod=test_oauth_enroll&gt;
subTest = False

    @contextlib.contextmanager
    def testPartExecutor(self, test_case, subTest=False):
        old_success = self.success
        self.success = True
        try:
&gt;           yield

.../hostedtoolcache/Python/3.12.7........./x64/lib/python3.12/unittest/case.py:58: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = &lt;tests.e2e.test_source_oauth_oauth2.TestSourceOAuth2 testMethod=test_oauth_enroll&gt;
result = &lt;TestCaseFunction test_oauth_enroll&gt;

    def run(self, result=None):
        if result is None:
            result = self.defaultTestResult()
            startTestRun = getattr(result, 'startTestRun', None)
            stopTestRun = getattr(result, 'stopTestRun', None)
            if startTestRun is not None:
                startTestRun()
        else:
            stopTestRun = None
    
        result.startTest(self)
        try:
            testMethod = getattr(self, self._testMethodName)
            if (getattr(self.__class__, "__unittest_skip__", False) or
                getattr(testMethod, "__unittest_skip__", False)):
                # If the class or method was skipped.
                skip_why = (getattr(self.__class__, '__unittest_skip_why__', '')
                            or getattr(testMethod, '__unittest_skip_why__', ''))
                _addSkip(result, self, skip_why)
                return result
    
            expecting_failure = (
                getattr(self, "__unittest_expecting_failure__", False) or
                getattr(testMethod, "__unittest_expecting_failure__", False)
            )
            outcome = _Outcome(result)
            start_time = time.perf_counter()
            try:
                self._outcome = outcome
    
                with outcome.testPartExecutor(self):
&gt;                   self._callSetUp()

.../hostedtoolcache/Python/3.12.7........./x64/lib/python3.12/unittest/case.py:630: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = &lt;tests.e2e.test_source_oauth_oauth2.TestSourceOAuth2 testMethod=test_oauth_enroll&gt;

    def _callSetUp(self):
&gt;       self.setUp()

.../hostedtoolcache/Python/3.12.7........./x64/lib/python3.12/unittest/case.py:586: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = &lt;tests.e2e.test_source_oauth_oauth2.TestSourceOAuth2 testMethod=test_oauth_enroll&gt;

    def setUp(self):
        self.client_secret = generate_key()
        self.slug = generate_id()
        super().setUp()
&gt;       self.run_container(
            image="ghcr.io/dexidp/dex:v2.28.1",
            ports={"5556": "5556"},
            healthcheck=Healthcheck(
                test=["CMD", "wget", "--spider", "http://localhost:5556/dex/healthz"],
                interval=5 * 1_000 * 1_000_000,
                start_period=1 * 1_000 * 1_000_000,
            ),
            environment={
                "AK_REDIRECT_URL": self.url(
                    "authentik_sources_oauth:oauth-client-callback",
                    source_slug=self.slug,
                ),
                "AK_CLIENT_SECRET": self.client_secret,
            },
            volumes={
                f"{Path(__file__).parent / "sources_oauth2_dex" / "dex.yaml"}": {
                    "bind": ".../etc/dex/config.docker.yaml",
                }
            },
        )

tests/e2e/test_source_oauth_oauth2.py:29: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = &lt;tests.e2e.test_source_oauth_oauth2.TestSourceOAuth2 testMethod=test_oauth_enroll&gt;
specs = {'auto_remove': True, 'detach': True, 'environment': {'AK_CLIENT_SECRET': '|c#{ZLl^(!`QUb0^{wp{\\70O"Y0,K&gt;:*]"&gt;i*qM;Z#...ocalhost:5556/dex/healthz'], 'Interval': 5000000000, 'Timeout': None, 'Retries': None, 'StartPeriod': 1000000000}, ...}
container = &lt;Container: 56beb6844052&gt;
state = {'Dead': False, 'Error': '', 'ExitCode': 0, 'FinishedAt': '0001-01-01T00:00:00Z', ...}

    def run_container(self, **specs: dict[str, Any]) -&gt; Container:
        if "network_mode" not in specs:
            specs["network"] = self.__network.name
        specs["labels"] = self.docker_labels
        specs["detach"] = True
        specs["auto_remove"] = True
        if hasattr(self, "live_server_url"):
            specs.setdefault("environment", {})
            specs["environment"]["AUTHENTIK_HOST"] = self.live_server_url
        container = self.docker_client.containers.run(**specs)
        container.reload()
        state = container.attrs.get("State", {})
        if "Health" not in state:
            return container
&gt;       self.wait_for_container(container)

tests/e2e/utils.py:124: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = &lt;tests.e2e.test_source_oauth_oauth2.TestSourceOAuth2 testMethod=test_oauth_enroll&gt;
container = &lt;Container: 56beb6844052&gt;

    def wait_for_container(self, container: Container):
        """Check that container is health"""
        attempt = 0
        while True:
&gt;           container.reload()

tests/e2e/utils.py:90: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = &lt;Container: 56beb6844052&gt;

    def reload(self):
        """
        Load this object from the server again and update ``attrs`` with the
        new data.
        """
&gt;       new_model = self.collection.get(self.id)

../../../..../pypoetry/virtualenvs/authentik-xvtLQ9eE-py3.12/lib/python3.12.../docker/models/resource.py:47: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = &lt;docker.models.containers.ContainerCollection object at 0x7f83744fb4a0&gt;
container_id = '56beb6844052025c22eb66c91734ba787395aefca87193244fd7c1c51b3f1572'

    def get(self, container_id):
        """
        Get a container by name or ID.
    
        Args:
            container_id (str): Container name or ID.
    
        Returns:
            A :py:class:`Container` object.
    
        Raises:
            :py:class:`docker.errors.NotFound`
                If the container does not exist.
            :py:class:`docker.errors.APIError`
                If the server returns an error.
        """
&gt;       resp = self.client.api.inspect_container(container_id)

../../../..../pypoetry/virtualenvs/authentik-xvtLQ9eE-py3.12/lib/python3.12.../docker/models/containers.py:954: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = &lt;docker.api.client.APIClient object at 0x7f836440de20&gt;
resource_id = '56beb6844052025c22eb66c91734ba787395aefca87193244fd7c1c51b3f1572'
args = (), kwargs = {}

    @functools.wraps(f)
    def wrapped(self, resource_id=None, *args, **kwargs):
        if resource_id is None and kwargs.get(resource_name):
            resource_id = kwargs.pop(resource_name)
        if isinstance(resource_id, dict):
            resource_id = resource_id.get('Id', resource_id.get('ID'))
        if not resource_id:
            raise errors.NullResource(
                'Resource ID was not provided'
            )
&gt;       return f(self, resource_id, *args, **kwargs)

../../../..../pypoetry/virtualenvs/authentik-xvtLQ9eE-py3.12/lib/python3.12.../docker/utils/decorators.py:19: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = &lt;docker.api.client.APIClient object at 0x7f836440de20&gt;
container = '56beb6844052025c22eb66c91734ba787395aefca87193244fd7c1c51b3f1572'

    @utils.check_resource('container')
    def inspect_container(self, container):
        """
        Identical to the `docker inspect` command, but only for containers.
    
        Args:
            container (str): The container to inspect
    
        Returns:
            (dict): Similar to the output of `docker inspect`, but as a
            single dict
    
        Raises:
            :py:class:`docker.errors.APIError`
                If the server returns an error.
        """
&gt;       return self._result(
            self._get(self._url("/containers/{0}/json", container)), True
        )

../../../..../pypoetry/virtualenvs/authentik-xvtLQ9eE-py3.12/lib/python3.12.../docker/api/container.py:793: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = &lt;docker.api.client.APIClient object at 0x7f836440de20&gt;
response = &lt;Response [404]&gt;, json = True, binary = False

    def _result(self, response, json=False, binary=False):
        assert not (json and binary)
&gt;       self._raise_for_status(response)

../../../..../pypoetry/virtualenvs/authentik-xvtLQ9eE-py3.12/lib/python3.12.../docker/api/client.py:281: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = &lt;docker.api.client.APIClient object at 0x7f836440de20&gt;
response = &lt;Response [404]&gt;

    def _raise_for_status(self, response):
        """Raises stored :class:`APIError`, if one occurred."""
        try:
            response.raise_for_status()
        except requests.exceptions.HTTPError as e:
&gt;           raise create_api_error_from_http_exception(e) from e

../../../..../pypoetry/virtualenvs/authentik-xvtLQ9eE-py3.12/lib/python3.12.../docker/api/client.py:277: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

e = HTTPError('404 Client Error: Not Found for url: http+docker:.../localhost/v1.45........./containers/56beb6844052025c22eb66c91734ba787395aefca87193244fd7c1c51b3f1572/json')

    def create_api_error_from_http_exception(e):
        """
        Create a suitable APIError from requests.exceptions.HTTPError.
        """
        response = e.response
        try:
            explanation = response.json()['message']
        except ValueError:
            explanation = (response.text or '').strip()
        cls = APIError
        if response.status_code == 404:
            explanation_msg = (explanation or '').lower()
            if any(fragment in explanation_msg
                   for fragment in _image_not_found_explanation_fragments):
                cls = ImageNotFound
            else:
                cls = NotFound
&gt;       raise cls(e, response=response, explanation=explanation) from e
E       docker.errors.NotFound: 404 Client Error for http+docker:.../localhost/v1.45........./containers/56beb6844052025c22eb66c91734ba787395aefca87193244fd7c1c51b3f1572/json: Not Found ("No such container: 56beb6844052025c22eb66c91734ba787395aefca87193244fd7c1c51b3f1572")

../../../..../pypoetry/virtualenvs/authentik-xvtLQ9eE-py3.12/lib/python3.12.../site-packages/docker/errors.py:39: NotFound

To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard

kensternberg-authentik added a commit that referenced this pull request Oct 18, 2024
* main: (68 commits)
  core: extract object matching from flow manager (#11458)
  admin: store version history (#11520)
  web: bump API Client version (#11706)
  providers/oauth2: add initial JWE support (#11344)
  core, web: update translations (#11703)
  tests/e2e: add forward auth e2e test (#11374)
  web/admin: fix duplicate flow labels (#11689)
  providers/saml: fix incorrect ds:Reference URI (#11699)
  website/docs: Fix websocket default config for nginx proxy manager (#11621)
  core, web: update translations (#11692)
  core: bump uvicorn from 0.31.1 to 0.32.0 (#11693)
  core: bump github.com/prometheus/client_golang from 1.20.4 to 1.20.5 (#11694)
  website/docs: add missing file to sidebar (#11695)
  website/docs: rewrote too long sentence (#11696)
  translate: Updates for file locale/en/LC_MESSAGES/django.po in fr (#11697)
  translate: Updates for file web/xliff/en.xlf in fr (#11698)
  stages/authenticator_webauthn: Update FIDO MDS3 & Passkey aaguid blobs (#11683)
  core, web: update translations (#11682)
  core: bump github.com/getsentry/sentry-go from 0.29.0 to 0.29.1 (#11684)
  core: bump github.com/redis/go-redis/v9 from 9.6.1 to 9.6.2 (#11685)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant