Compare commits

...

8 Commits

Author SHA1 Message Date
a6b072369b Merge remote-tracking branch 'origin/main' into sources/oauth--change-azure-ad-UI-to-entra-id 2025-07-01 14:43:47 +03:00
c85471575a stages/authenticator_webauthn: Update FIDO MDS3 & Passkey aaguid blobs (#15327)
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: authentik-automation[bot] <135050075+authentik-automation[bot]@users.noreply.github.com>
2025-07-01 10:40:19 +02:00
5d00dc7e9e enterprise/search: fix search fallback for non QL queries (#15325)
* enterprise/search: fix search fallback for non QL queries

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* fix fixed tests

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
2025-07-01 00:55:23 +02:00
6982e7d1c9 web/elements: fix table search not resetting page when query changes (#15324)
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
2025-07-01 00:55:09 +02:00
c67188aee2 Merge remote-tracking branch 'origin/main' into sources/oauth--change-azure-ad-UI-to-entra-id 2025-06-30 23:54:48 +03:00
16a5c37cbd Change OIDC url to none
Signed-off-by: Dewi Roberts <dewi@goauthentik.io>
2025-06-30 20:53:49 +01:00
b25e7877c3 Blank OIDC well known URL 2025-06-25 23:02:30 +03:00
6c68068551 Change UI and blank well known URL 2025-06-25 18:28:16 +03:00
7 changed files with 24 additions and 20 deletions

View File

@ -6,7 +6,7 @@ from djangoql.ast import Name
from djangoql.exceptions import DjangoQLError from djangoql.exceptions import DjangoQLError
from djangoql.queryset import apply_search from djangoql.queryset import apply_search
from djangoql.schema import DjangoQLSchema from djangoql.schema import DjangoQLSchema
from rest_framework.filters import SearchFilter from rest_framework.filters import BaseFilterBackend, SearchFilter
from rest_framework.request import Request from rest_framework.request import Request
from structlog.stdlib import get_logger from structlog.stdlib import get_logger
@ -39,19 +39,21 @@ class BaseSchema(DjangoQLSchema):
return super().resolve_name(name) return super().resolve_name(name)
class QLSearch(SearchFilter): class QLSearch(BaseFilterBackend):
"""rest_framework search filter which uses DjangoQL""" """rest_framework search filter which uses DjangoQL"""
def __init__(self):
super().__init__()
self._fallback = SearchFilter()
@property @property
def enabled(self): def enabled(self):
return apps.get_app_config("authentik_enterprise").enabled() return apps.get_app_config("authentik_enterprise").enabled()
def get_search_terms(self, request) -> str: def get_search_terms(self, request: Request) -> str:
""" """Search terms are set by a ?search=... query parameter,
Search terms are set by a ?search=... query parameter, and may be comma and/or whitespace delimited."""
and may be comma and/or whitespace delimited. params = request.query_params.get("search", "")
"""
params = request.query_params.get(self.search_param, "")
params = params.replace("\x00", "") # strip null characters params = params.replace("\x00", "") # strip null characters
return params return params
@ -70,9 +72,9 @@ class QLSearch(SearchFilter):
search_query = self.get_search_terms(request) search_query = self.get_search_terms(request)
schema = self.get_schema(request, view) schema = self.get_schema(request, view)
if len(search_query) == 0 or not self.enabled: if len(search_query) == 0 or not self.enabled:
return super().filter_queryset(request, queryset, view) return self._fallback.filter_queryset(request, queryset, view)
try: try:
return apply_search(queryset, search_query, schema=schema) return apply_search(queryset, search_query, schema=schema)
except DjangoQLError as exc: except DjangoQLError as exc:
LOGGER.debug("Failed to parse search expression", exc=exc) LOGGER.debug("Failed to parse search expression", exc=exc)
return super().filter_queryset(request, queryset, view) return self._fallback.filter_queryset(request, queryset, view)

View File

@ -57,7 +57,7 @@ class QLTest(APITestCase):
) )
self.assertEqual(res.status_code, 200) self.assertEqual(res.status_code, 200)
content = loads(res.content) content = loads(res.content)
self.assertGreaterEqual(content["pagination"]["count"], 1) self.assertEqual(content["pagination"]["count"], 1)
self.assertEqual(content["results"][0]["username"], self.user.username) self.assertEqual(content["results"][0]["username"], self.user.username)
def test_search_json(self): def test_search_json(self):

View File

@ -232,12 +232,12 @@ class GoogleOAuthSource(CreatableType, OAuthSource):
class AzureADOAuthSource(CreatableType, OAuthSource): class AzureADOAuthSource(CreatableType, OAuthSource):
"""Social Login using Azure AD.""" """Social Login using Entra ID."""
class Meta: class Meta:
abstract = True abstract = True
verbose_name = _("Azure AD OAuth Source") verbose_name = _("Entra ID OAuth Source")
verbose_name_plural = _("Azure AD OAuth Sources") verbose_name_plural = _("Entra ID OAuth Sources")
class OpenIDConnectOAuthSource(CreatableType, OAuthSource): class OpenIDConnectOAuthSource(CreatableType, OAuthSource):

View File

@ -73,9 +73,7 @@ class AzureADType(SourceType):
authorization_url = "https://login.microsoftonline.com/common/oauth2/v2.0/authorize" authorization_url = "https://login.microsoftonline.com/common/oauth2/v2.0/authorize"
access_token_url = "https://login.microsoftonline.com/common/oauth2/v2.0/token" # nosec access_token_url = "https://login.microsoftonline.com/common/oauth2/v2.0/token" # nosec
profile_url = "https://graph.microsoft.com/v1.0/me" profile_url = "https://graph.microsoft.com/v1.0/me"
oidc_well_known_url = ( oidc_well_known_url = None
"https://login.microsoftonline.com/common/.well-known/openid-configuration"
)
oidc_jwks_url = "https://login.microsoftonline.com/common/discovery/keys" oidc_jwks_url = "https://login.microsoftonline.com/common/discovery/keys"
authorization_code_auth_method = AuthorizationCodeAuthMethod.POST_BODY authorization_code_auth_method = AuthorizationCodeAuthMethod.POST_BODY

File diff suppressed because one or more lines are too long

View File

@ -478,8 +478,10 @@ export abstract class Table<T> extends WithLicenseSummary(AKElement) implements
renderSearch(): TemplateResult { renderSearch(): TemplateResult {
const runSearch = (value: string) => { const runSearch = (value: string) => {
this.search = value; this.search = value;
this.page = 1;
updateURLParams({ updateURLParams({
search: value, search: value,
tablePage: 1,
}); });
this.fetch(); this.fetch();
}; };

View File

@ -3,7 +3,7 @@ import { updateURLParams } from "#elements/router/RouteMatch";
import { Table } from "#elements/table/Table"; import { Table } from "#elements/table/Table";
import { msg } from "@lit/localize"; import { msg } from "@lit/localize";
import { CSSResult } from "lit"; import { CSSResult, nothing } from "lit";
import { TemplateResult, html } from "lit"; import { TemplateResult, html } from "lit";
import { ifDefined } from "lit/directives/if-defined.js"; import { ifDefined } from "lit/directives/if-defined.js";
@ -45,7 +45,7 @@ export abstract class TablePage<T> extends Table<T> {
: html`<ak-empty-state icon=${this.pageIcon()} : html`<ak-empty-state icon=${this.pageIcon()}
><span>${msg("No objects found.")}</span> ><span>${msg("No objects found.")}</span>
<div slot="body"> <div slot="body">
${this.searchEnabled() ? this.renderEmptyClearSearch() : html``} ${this.searchEnabled() ? this.renderEmptyClearSearch() : nothing}
</div> </div>
<div slot="primary">${this.renderObjectCreate()}</div> <div slot="primary">${this.renderObjectCreate()}</div>
</ak-empty-state>`} </ak-empty-state>`}
@ -61,8 +61,10 @@ export abstract class TablePage<T> extends Table<T> {
this.search = ""; this.search = "";
this.requestUpdate(); this.requestUpdate();
this.fetch(); this.fetch();
this.page = 1;
updateURLParams({ updateURLParams({
search: "", search: "",
tablePage: 1,
}); });
}} }}
class="pf-c-button pf-m-link" class="pf-c-button pf-m-link"