From 57fefee06adb82c42d94dc5c98196822b1c0d9ed Mon Sep 17 00:00:00 2001 From: Marc 'risson' Schmitt Date: Thu, 4 Jul 2024 13:06:14 +0200 Subject: [PATCH 1/2] Revert "core: applications api: add option to only list apps with launch url (#10336)" This reverts commit 42e0ff6492d518a3c7319a93a9c69eea28475ea1. --- authentik/core/api/applications.py | 18 ------------------ authentik/core/models.py | 5 ----- schema.yml | 4 ---- web/src/user/LibraryPage/ak-library.ts | 1 - 4 files changed, 28 deletions(-) diff --git a/authentik/core/api/applications.py b/authentik/core/api/applications.py index 3126fea69f0f..6e6db93df56b 100644 --- a/authentik/core/api/applications.py +++ b/authentik/core/api/applications.py @@ -147,13 +147,6 @@ def _get_allowed_applications( applications.append(application) return applications - def _filter_applications_with_launch_url(self, pagined_apps: Iterator[Application]) -> list[Application]: - applications = [] - for app in pagined_apps: - if app.get_launch_url(): - applications.append(app) - return applications - @extend_schema( parameters=[ OpenApiParameter( @@ -211,11 +204,6 @@ def check_access(self, request: Request, slug: str) -> Response: location=OpenApiParameter.QUERY, type=OpenApiTypes.INT, ), - OpenApiParameter( - name="only_with_launch_url", - location=OpenApiParameter.QUERY, - type=OpenApiTypes.BOOL, - ), ] ) def list(self, request: Request) -> Response: @@ -228,8 +216,6 @@ def list(self, request: Request) -> Response: if superuser_full_list and request.user.is_superuser: return super().list(request) - only_with_launch_url = str(request.query_params.get("only_with_launch_url", "false")).lower() - queryset = self._filter_queryset_for_list(self.get_queryset()) paginator: Pagination = self.paginator paginated_apps = paginator.paginate_queryset(queryset, request) @@ -265,10 +251,6 @@ def list(self, request: Request) -> Response: allowed_applications, timeout=86400, ) - - if only_with_launch_url == "true": - allowed_applications = self._filter_applications_with_launch_url(allowed_applications) - serializer = self.get_serializer(allowed_applications, many=True) return self.get_paginated_response(serializer.data) diff --git a/authentik/core/models.py b/authentik/core/models.py index 019572b58993..d3ab0095b3d0 100644 --- a/authentik/core/models.py +++ b/authentik/core/models.py @@ -1,7 +1,6 @@ """authentik core models""" from datetime import datetime -from functools import lru_cache from hashlib import sha256 from typing import Any, Optional, Self from uuid import uuid4 @@ -476,10 +475,6 @@ def get_meta_icon(self) -> str | None: return self.meta_icon.name return self.meta_icon.url - # maxsize is set as 2 since that is called once to check - # if we should return applications with a launch URL - # and a second time to actually get the launch_url - @lru_cache(maxsize=2) def get_launch_url(self, user: Optional["User"] = None) -> str | None: """Get launch URL if set, otherwise attempt to get launch URL based on provider.""" url = None diff --git a/schema.yml b/schema.yml index c3b7a02bcd05..31b0d9c51588 100644 --- a/schema.yml +++ b/schema.yml @@ -2682,10 +2682,6 @@ paths: name: name schema: type: string - - in: query - name: only_with_launch_url - schema: - type: boolean - name: ordering required: false in: query diff --git a/web/src/user/LibraryPage/ak-library.ts b/web/src/user/LibraryPage/ak-library.ts index 5555d9ca97af..5388b25119d0 100644 --- a/web/src/user/LibraryPage/ak-library.ts +++ b/web/src/user/LibraryPage/ak-library.ts @@ -70,7 +70,6 @@ export class LibraryPage extends AKElement { ordering: "name", page, pageSize: 100, - onlyWithLaunchUrl: true, }); const applicationListFetch = await coreApi().coreApplicationsList(applicationListParams(1)); From 694769148f1cdf6a6f9c3273edea1e1b44c895c0 Mon Sep 17 00:00:00 2001 From: Marc 'risson' Schmitt Date: Thu, 4 Jul 2024 13:06:34 +0200 Subject: [PATCH 2/2] website: fix ci Signed-off-by: Marc 'risson' Schmitt --- website/integrations/services/gitlab/index.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/website/integrations/services/gitlab/index.md b/website/integrations/services/gitlab/index.md index 9ad16bee7684..02d49712dfee 100644 --- a/website/integrations/services/gitlab/index.md +++ b/website/integrations/services/gitlab/index.md @@ -21,7 +21,6 @@ There are 2 ways to configure single sign on (SSO) for GitLab: - [via SAML](#saml-auth) - [via OIDC Connect (OAuth)](#openid-connect-auth) - ### SAML auth #### Preparation @@ -42,11 +41,9 @@ Under _Advanced protocol settings_, set a certificate for _Signing Certificate_. #### GitLab Configuration - Paste the following block in your `/etc/gitlab/gitlab.rb` file, after replacing the placeholder values from above. To get the value for `idp_cert_fingerprint`, navigate to the authentik Admin interface, expand the **System** section and select **Certificates**. Then, expand the selected certificate and copy the SHA1 Certificate Fingerprint. - ```ruby gitlab_rails['omniauth_enabled'] = true gitlab_rails['omniauth_allow_single_sign_on'] = ['saml']