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

Revert "core: applications api: add option to only list apps with launch url (#10336)" #10370

Merged
merged 2 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions authentik/core/api/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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:
Expand All @@ -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)
Expand Down Expand Up @@ -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)

Expand Down
5 changes: 0 additions & 5 deletions authentik/core/models.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion web/src/user/LibraryPage/ak-library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export class LibraryPage extends AKElement {
ordering: "name",
page,
pageSize: 100,
onlyWithLaunchUrl: true,
});

const applicationListFetch = await coreApi().coreApplicationsList(applicationListParams(1));
Expand Down
3 changes: 0 additions & 3 deletions website/integrations/services/gitlab/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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']
Expand Down
Loading