diff --git a/authentik/api/tests/test_viewsets.py b/authentik/api/tests/test_viewsets.py new file mode 100644 index 000000000..dee956461 --- /dev/null +++ b/authentik/api/tests/test_viewsets.py @@ -0,0 +1,29 @@ +"""authentik API Modelviewset tests""" +from typing import Callable + +from django.test import TestCase +from rest_framework.viewsets import ModelViewSet, ReadOnlyModelViewSet + +from authentik.api.v3.urls import router + + +class TestModelViewSets(TestCase): + """Test Viewset""" + + +def viewset_tester_factory(test_viewset: type[ModelViewSet]) -> Callable: + """Test Viewset""" + + def tester(self: TestModelViewSets): + self.assertIsNotNone(getattr(test_viewset, "search_fields", None)) + filterset_class = getattr(test_viewset, "filterset_class", None) + if not filterset_class: + self.assertIsNotNone(getattr(test_viewset, "filterset_fields", None)) + + return tester + + +for _, viewset, _ in router.registry: + if not issubclass(viewset, (ModelViewSet, ReadOnlyModelViewSet)): + continue + setattr(TestModelViewSets, f"test_viewset_{viewset.__name__}", viewset_tester_factory(viewset)) diff --git a/authentik/core/api/applications.py b/authentik/core/api/applications.py index e1e810cf3..fd8761d1b 100644 --- a/authentik/core/api/applications.py +++ b/authentik/core/api/applications.py @@ -89,6 +89,7 @@ class ApplicationViewSet(UsedByMixin, ModelViewSet): "group", ] lookup_field = "slug" + filterset_fields = ["name", "slug"] ordering = ["name"] def _filter_queryset_for_list(self, queryset: QuerySet) -> QuerySet: diff --git a/authentik/core/api/sources.py b/authentik/core/api/sources.py index 97d47cd85..25202c034 100644 --- a/authentik/core/api/sources.py +++ b/authentik/core/api/sources.py @@ -66,6 +66,7 @@ class SourceViewSet( queryset = Source.objects.none() serializer_class = SourceSerializer lookup_field = "slug" + search_fields = ["slug", "name"] def get_queryset(self): # pragma: no cover return Source.objects.select_subclasses() diff --git a/authentik/events/api/notification_mappings.py b/authentik/events/api/notification_mappings.py index 89fed5d9c..37d3b9770 100644 --- a/authentik/events/api/notification_mappings.py +++ b/authentik/events/api/notification_mappings.py @@ -26,3 +26,4 @@ class NotificationWebhookMappingViewSet(UsedByMixin, ModelViewSet): serializer_class = NotificationWebhookMappingSerializer filterset_fields = ["name"] ordering = ["name"] + search_fields = ["name"] diff --git a/authentik/events/api/notification_rules.py b/authentik/events/api/notification_rules.py index 45903271d..b8aa7e579 100644 --- a/authentik/events/api/notification_rules.py +++ b/authentik/events/api/notification_rules.py @@ -32,3 +32,4 @@ class NotificationRuleViewSet(UsedByMixin, ModelViewSet): serializer_class = NotificationRuleSerializer filterset_fields = ["name", "severity", "group__name"] ordering = ["name"] + search_fields = ["name", "group__name"] diff --git a/authentik/events/api/notification_transports.py b/authentik/events/api/notification_transports.py index 763d24fe4..611fa9a5c 100644 --- a/authentik/events/api/notification_transports.py +++ b/authentik/events/api/notification_transports.py @@ -68,6 +68,7 @@ class NotificationTransportViewSet(UsedByMixin, ModelViewSet): queryset = NotificationTransport.objects.all() serializer_class = NotificationTransportSerializer filterset_fields = ["name", "mode", "webhook_url", "send_once"] + search_fields = ["name", "mode", "webhook_url"] ordering = ["name"] @permission_required("authentik_events.change_notificationtransport") diff --git a/authentik/flows/api/bindings.py b/authentik/flows/api/bindings.py index 13fd04887..bdcac396d 100644 --- a/authentik/flows/api/bindings.py +++ b/authentik/flows/api/bindings.py @@ -35,3 +35,4 @@ class FlowStageBindingViewSet(UsedByMixin, ModelViewSet): queryset = FlowStageBinding.objects.all() serializer_class = FlowStageBindingSerializer filterset_fields = "__all__" + search_fields = ["stage__name"] diff --git a/authentik/outposts/api/service_connections.py b/authentik/outposts/api/service_connections.py index 8ba05ce92..c118156d1 100644 --- a/authentik/outposts/api/service_connections.py +++ b/authentik/outposts/api/service_connections.py @@ -118,6 +118,7 @@ class DockerServiceConnectionViewSet(UsedByMixin, ModelViewSet): serializer_class = DockerServiceConnectionSerializer filterset_fields = ["name", "local", "url", "tls_verification", "tls_authentication"] ordering = ["name"] + search_fields = ["name"] class KubernetesServiceConnectionSerializer(ServiceConnectionSerializer): @@ -152,3 +153,4 @@ class KubernetesServiceConnectionViewSet(UsedByMixin, ModelViewSet): serializer_class = KubernetesServiceConnectionSerializer filterset_fields = ["name", "local"] ordering = ["name"] + search_fields = ["name"] diff --git a/authentik/policies/dummy/api.py b/authentik/policies/dummy/api.py index 5dbe1b0d7..344089a0d 100644 --- a/authentik/policies/dummy/api.py +++ b/authentik/policies/dummy/api.py @@ -21,3 +21,4 @@ class DummyPolicyViewSet(UsedByMixin, ModelViewSet): serializer_class = DummyPolicySerializer filterset_fields = "__all__" ordering = ["name"] + search_fields = ["name"] diff --git a/authentik/policies/event_matcher/api.py b/authentik/policies/event_matcher/api.py index e73c70053..4a4a74551 100644 --- a/authentik/policies/event_matcher/api.py +++ b/authentik/policies/event_matcher/api.py @@ -25,3 +25,4 @@ class EventMatcherPolicyViewSet(UsedByMixin, ModelViewSet): serializer_class = EventMatcherPolicySerializer filterset_fields = "__all__" ordering = ["name"] + search_fields = ["name"] diff --git a/authentik/policies/expiry/api.py b/authentik/policies/expiry/api.py index 73eb0c366..2f72cc6e8 100644 --- a/authentik/policies/expiry/api.py +++ b/authentik/policies/expiry/api.py @@ -21,3 +21,4 @@ class PasswordExpiryPolicyViewSet(UsedByMixin, ModelViewSet): serializer_class = PasswordExpiryPolicySerializer filterset_fields = "__all__" ordering = ["name"] + search_fields = ["name"] diff --git a/authentik/policies/expression/api.py b/authentik/policies/expression/api.py index 176afb068..c587f1b15 100644 --- a/authentik/policies/expression/api.py +++ b/authentik/policies/expression/api.py @@ -28,3 +28,4 @@ class ExpressionPolicyViewSet(UsedByMixin, ModelViewSet): serializer_class = ExpressionPolicySerializer filterset_fields = "__all__" ordering = ["name"] + search_fields = ["name"] diff --git a/authentik/policies/hibp/api.py b/authentik/policies/hibp/api.py index de7a86a2d..499853f3f 100644 --- a/authentik/policies/hibp/api.py +++ b/authentik/policies/hibp/api.py @@ -20,4 +20,5 @@ class HaveIBeenPwendPolicyViewSet(UsedByMixin, ModelViewSet): queryset = HaveIBeenPwendPolicy.objects.all() serializer_class = HaveIBeenPwendPolicySerializer filterset_fields = "__all__" + search_fields = ["name", "password_field"] ordering = ["name"] diff --git a/authentik/policies/password/api.py b/authentik/policies/password/api.py index 4b9810a8d..227162e0e 100644 --- a/authentik/policies/password/api.py +++ b/authentik/policies/password/api.py @@ -30,3 +30,4 @@ class PasswordPolicyViewSet(UsedByMixin, ModelViewSet): serializer_class = PasswordPolicySerializer filterset_fields = "__all__" ordering = ["name"] + search_fields = ["name"] diff --git a/authentik/policies/reputation/api.py b/authentik/policies/reputation/api.py index ba6fda761..fc9eafcab 100644 --- a/authentik/policies/reputation/api.py +++ b/authentik/policies/reputation/api.py @@ -26,6 +26,7 @@ class ReputationPolicyViewSet(UsedByMixin, ModelViewSet): queryset = ReputationPolicy.objects.all() serializer_class = ReputationPolicySerializer filterset_fields = "__all__" + search_fields = ["name", "threshold"] ordering = ["name"] diff --git a/authentik/providers/ldap/api.py b/authentik/providers/ldap/api.py index e1649f41a..ba1250998 100644 --- a/authentik/providers/ldap/api.py +++ b/authentik/providers/ldap/api.py @@ -47,6 +47,7 @@ class LDAPProviderViewSet(UsedByMixin, ModelViewSet): "uid_start_number": ["iexact"], "gid_start_number": ["iexact"], } + search_fields = ["name"] ordering = ["name"] @@ -81,3 +82,5 @@ class LDAPOutpostConfigViewSet(ReadOnlyModelViewSet): queryset = LDAPProvider.objects.filter(application__isnull=False) serializer_class = LDAPOutpostConfigSerializer ordering = ["name"] + search_fields = ["name"] + filterset_fields = ["name"] diff --git a/authentik/providers/oauth2/api/provider.py b/authentik/providers/oauth2/api/provider.py index cd058e829..53dcf57b7 100644 --- a/authentik/providers/oauth2/api/provider.py +++ b/authentik/providers/oauth2/api/provider.py @@ -72,6 +72,7 @@ class OAuth2ProviderViewSet(UsedByMixin, ModelViewSet): "property_mappings", "issuer_mode", ] + search_fields = ["name"] ordering = ["name"] @extend_schema( diff --git a/authentik/providers/oauth2/api/scope.py b/authentik/providers/oauth2/api/scope.py index 3ef0814f1..685715394 100644 --- a/authentik/providers/oauth2/api/scope.py +++ b/authentik/providers/oauth2/api/scope.py @@ -39,3 +39,4 @@ class ScopeMappingViewSet(UsedByMixin, ModelViewSet): serializer_class = ScopeMappingSerializer filterset_class = ScopeMappingFilter ordering = ["scope_name", "name"] + search_fields = ["name", "scope_name"] diff --git a/authentik/providers/proxy/api.py b/authentik/providers/proxy/api.py index 3ca998614..2561b4377 100644 --- a/authentik/providers/proxy/api.py +++ b/authentik/providers/proxy/api.py @@ -103,6 +103,7 @@ class ProxyProviderViewSet(UsedByMixin, ModelViewSet): "redirect_uris": ["iexact"], "cookie_domain": ["iexact"], } + search_fields = ["name"] ordering = ["name"] @@ -166,3 +167,5 @@ class ProxyOutpostConfigViewSet(ReadOnlyModelViewSet): queryset = ProxyProvider.objects.filter(application__isnull=False) serializer_class = ProxyOutpostConfigSerializer ordering = ["name"] + search_fields = ["name"] + filterset_fields = ["name"] diff --git a/authentik/providers/saml/api.py b/authentik/providers/saml/api.py index 71f714bc9..1658fd02c 100644 --- a/authentik/providers/saml/api.py +++ b/authentik/providers/saml/api.py @@ -99,6 +99,7 @@ class SAMLProviderViewSet(UsedByMixin, ModelViewSet): serializer_class = SAMLProviderSerializer filterset_fields = "__all__" ordering = ["name"] + search_fields = ["name"] @extend_schema( responses={ @@ -216,4 +217,5 @@ class SAMLPropertyMappingViewSet(UsedByMixin, ModelViewSet): queryset = SAMLPropertyMapping.objects.all() serializer_class = SAMLPropertyMappingSerializer filterset_class = SAMLPropertyMappingFilter + search_fields = ["name"] ordering = ["name"] diff --git a/authentik/sources/ldap/api.py b/authentik/sources/ldap/api.py index 952fa7e86..edf1b6547 100644 --- a/authentik/sources/ldap/api.py +++ b/authentik/sources/ldap/api.py @@ -91,6 +91,7 @@ class LDAPSourceViewSet(UsedByMixin, ModelViewSet): "property_mappings", "property_mappings_group", ] + search_fields = ["name", "slug"] ordering = ["name"] @extend_schema( @@ -142,4 +143,5 @@ class LDAPPropertyMappingViewSet(UsedByMixin, ModelViewSet): queryset = LDAPPropertyMapping.objects.all() serializer_class = LDAPPropertyMappingSerializer filterset_class = LDAPPropertyMappingFilter + search_fields = ["name"] ordering = ["name"] diff --git a/authentik/sources/oauth/api/source.py b/authentik/sources/oauth/api/source.py index 645082cf9..f43e9ce1c 100644 --- a/authentik/sources/oauth/api/source.py +++ b/authentik/sources/oauth/api/source.py @@ -90,7 +90,6 @@ class OAuthSourceSerializer(SourceSerializer): if getattr(provider_type, url, None) is None: if url not in attrs: raise ValidationError(f"{url} is required for provider {provider_type.name}") - print(attrs) return attrs class Meta: @@ -135,6 +134,7 @@ class OAuthSourceViewSet(UsedByMixin, ModelViewSet): "consumer_key", "additional_scopes", ] + search_fields = ["name", "slug"] ordering = ["name"] @extend_schema( diff --git a/authentik/sources/oauth/api/source_connection.py b/authentik/sources/oauth/api/source_connection.py index c44edeeeb..311ce5bad 100644 --- a/authentik/sources/oauth/api/source_connection.py +++ b/authentik/sources/oauth/api/source_connection.py @@ -26,6 +26,7 @@ class UserOAuthSourceConnectionViewSet(UsedByMixin, ModelViewSet): queryset = UserOAuthSourceConnection.objects.all() serializer_class = UserOAuthSourceConnectionSerializer filterset_fields = ["source__slug"] + search_fields = ["source__slug"] permission_classes = [OwnerSuperuserPermissions] filter_backends = [OwnerFilter, DjangoFilterBackend, OrderingFilter, SearchFilter] ordering = ["source__slug"] diff --git a/authentik/sources/plex/api/source.py b/authentik/sources/plex/api/source.py index 4e14e51d6..dd15b9a2b 100644 --- a/authentik/sources/plex/api/source.py +++ b/authentik/sources/plex/api/source.py @@ -60,6 +60,7 @@ class PlexSourceViewSet(UsedByMixin, ModelViewSet): "client_id", "allow_friends", ] + search_fields = ["name", "slug"] ordering = ["name"] @permission_required(None) diff --git a/authentik/sources/plex/api/source_connection.py b/authentik/sources/plex/api/source_connection.py index 32847dcb4..f046a300f 100644 --- a/authentik/sources/plex/api/source_connection.py +++ b/authentik/sources/plex/api/source_connection.py @@ -35,3 +35,4 @@ class PlexSourceConnectionViewSet(UsedByMixin, ModelViewSet): permission_classes = [OwnerSuperuserPermissions] filter_backends = [OwnerFilter, DjangoFilterBackend, OrderingFilter, SearchFilter] ordering = ["pk"] + search_fields = ["source__slug"] diff --git a/authentik/sources/saml/api.py b/authentik/sources/saml/api.py index ec6a78799..618dc0311 100644 --- a/authentik/sources/saml/api.py +++ b/authentik/sources/saml/api.py @@ -41,6 +41,7 @@ class SAMLSourceViewSet(UsedByMixin, ModelViewSet): serializer_class = SAMLSourceSerializer lookup_field = "slug" filterset_fields = "__all__" + search_fields = ["name", "slug"] ordering = ["name"] @extend_schema(responses={200: SAMLMetadataSerializer(many=False)}) diff --git a/authentik/stages/authenticator_duo/api.py b/authentik/stages/authenticator_duo/api.py index 13054f2d7..66fbba77e 100644 --- a/authentik/stages/authenticator_duo/api.py +++ b/authentik/stages/authenticator_duo/api.py @@ -51,6 +51,7 @@ class AuthenticatorDuoStageViewSet(UsedByMixin, ModelViewSet): "client_id", "api_hostname", ] + search_fields = ["name"] ordering = ["name"] @extend_schema( diff --git a/authentik/stages/authenticator_sms/api.py b/authentik/stages/authenticator_sms/api.py index 661c5939d..dfe22de75 100644 --- a/authentik/stages/authenticator_sms/api.py +++ b/authentik/stages/authenticator_sms/api.py @@ -36,6 +36,7 @@ class AuthenticatorSMSStageViewSet(UsedByMixin, ModelViewSet): serializer_class = AuthenticatorSMSStageSerializer filterset_fields = "__all__" ordering = ["name"] + search_fields = ["name"] class SMSDeviceSerializer(ModelSerializer): diff --git a/authentik/stages/authenticator_static/api.py b/authentik/stages/authenticator_static/api.py index f2d639e14..414950a66 100644 --- a/authentik/stages/authenticator_static/api.py +++ b/authentik/stages/authenticator_static/api.py @@ -29,6 +29,7 @@ class AuthenticatorStaticStageViewSet(UsedByMixin, ModelViewSet): serializer_class = AuthenticatorStaticStageSerializer filterset_fields = "__all__" ordering = ["name"] + search_fields = ["name"] class StaticDeviceTokenSerializer(ModelSerializer): diff --git a/authentik/stages/authenticator_totp/api.py b/authentik/stages/authenticator_totp/api.py index dd651bb5b..3feb127fe 100644 --- a/authentik/stages/authenticator_totp/api.py +++ b/authentik/stages/authenticator_totp/api.py @@ -29,6 +29,7 @@ class AuthenticatorTOTPStageViewSet(UsedByMixin, ModelViewSet): serializer_class = AuthenticatorTOTPStageSerializer filterset_fields = "__all__" ordering = ["name"] + search_fields = ["name"] class TOTPDeviceSerializer(ModelSerializer): diff --git a/authentik/stages/authenticator_validate/api.py b/authentik/stages/authenticator_validate/api.py index d0de49bb1..429055657 100644 --- a/authentik/stages/authenticator_validate/api.py +++ b/authentik/stages/authenticator_validate/api.py @@ -41,3 +41,4 @@ class AuthenticatorValidateStageViewSet(UsedByMixin, ModelViewSet): serializer_class = AuthenticatorValidateStageSerializer filterset_fields = ["name", "not_configured_action", "configuration_stages"] ordering = ["name"] + search_fields = ["name"] diff --git a/authentik/stages/authenticator_webauthn/api.py b/authentik/stages/authenticator_webauthn/api.py index 0302988ab..e8f8567eb 100644 --- a/authentik/stages/authenticator_webauthn/api.py +++ b/authentik/stages/authenticator_webauthn/api.py @@ -33,6 +33,7 @@ class AuthenticateWebAuthnStageViewSet(UsedByMixin, ModelViewSet): serializer_class = AuthenticateWebAuthnStageSerializer filterset_fields = "__all__" ordering = ["name"] + search_fields = ["name"] class WebAuthnDeviceSerializer(ModelSerializer): diff --git a/authentik/stages/captcha/api.py b/authentik/stages/captcha/api.py index 9dcaef06c..496342808 100644 --- a/authentik/stages/captcha/api.py +++ b/authentik/stages/captcha/api.py @@ -22,4 +22,5 @@ class CaptchaStageViewSet(UsedByMixin, ModelViewSet): queryset = CaptchaStage.objects.all() serializer_class = CaptchaStageSerializer filterset_fields = ["name", "public_key"] + search_fields = ["name"] ordering = ["name"] diff --git a/authentik/stages/consent/api.py b/authentik/stages/consent/api.py index 693288c35..f170020b0 100644 --- a/authentik/stages/consent/api.py +++ b/authentik/stages/consent/api.py @@ -28,6 +28,7 @@ class ConsentStageViewSet(UsedByMixin, ModelViewSet): serializer_class = ConsentStageSerializer filterset_fields = "__all__" ordering = ["name"] + search_fields = ["name"] class UserConsentSerializer(StageSerializer): @@ -60,6 +61,7 @@ class UserConsentViewSet( OrderingFilter, SearchFilter, ] + search_fields = ["user__username"] def get_queryset(self): user = self.request.user if self.request else get_anonymous_user() diff --git a/authentik/stages/deny/api.py b/authentik/stages/deny/api.py index 48bcc7cae..92d2a0e80 100644 --- a/authentik/stages/deny/api.py +++ b/authentik/stages/deny/api.py @@ -22,3 +22,4 @@ class DenyStageViewSet(UsedByMixin, ModelViewSet): serializer_class = DenyStageSerializer filterset_fields = "__all__" ordering = ["name"] + search_fields = ["name"] diff --git a/authentik/stages/dummy/api.py b/authentik/stages/dummy/api.py index 8569eb2dd..25f23abfd 100644 --- a/authentik/stages/dummy/api.py +++ b/authentik/stages/dummy/api.py @@ -21,4 +21,5 @@ class DummyStageViewSet(UsedByMixin, ModelViewSet): queryset = DummyStage.objects.all() serializer_class = DummyStageSerializer filterset_fields = "__all__" + search_fields = ["name"] ordering = ["name"] diff --git a/authentik/stages/email/api.py b/authentik/stages/email/api.py index ec9d461a4..4bc1d4c96 100644 --- a/authentik/stages/email/api.py +++ b/authentik/stages/email/api.py @@ -68,6 +68,7 @@ class EmailStageViewSet(UsedByMixin, ModelViewSet): "template", "activate_user_on_success", ] + search_fields = ["name"] ordering = ["name"] @extend_schema(responses={200: TypeCreateSerializer(many=True)}) diff --git a/authentik/stages/identification/api.py b/authentik/stages/identification/api.py index 5b3f8450c..682d2cc0c 100644 --- a/authentik/stages/identification/api.py +++ b/authentik/stages/identification/api.py @@ -40,4 +40,5 @@ class IdentificationStageViewSet(UsedByMixin, ModelViewSet): "passwordless_flow", "show_source_labels", ] + search_fields = ["name"] ordering = ["name"] diff --git a/authentik/stages/invitation/api.py b/authentik/stages/invitation/api.py index 789ba69de..56b60c02b 100644 --- a/authentik/stages/invitation/api.py +++ b/authentik/stages/invitation/api.py @@ -41,6 +41,7 @@ class InvitationStageViewSet(UsedByMixin, ModelViewSet): serializer_class = InvitationStageSerializer filterset_class = InvitationStageFilter ordering = ["name"] + search_fields = ["name"] class InvitationSerializer(ModelSerializer): diff --git a/authentik/stages/password/api.py b/authentik/stages/password/api.py index 95b654ade..1ba780b2d 100644 --- a/authentik/stages/password/api.py +++ b/authentik/stages/password/api.py @@ -29,4 +29,5 @@ class PasswordStageViewSet(UsedByMixin, ModelViewSet): "configure_flow", "failed_attempts_before_cancel", ] + search_fields = ["name"] ordering = ["name"] diff --git a/authentik/stages/prompt/api.py b/authentik/stages/prompt/api.py index 51b8daf3e..6af7d2609 100644 --- a/authentik/stages/prompt/api.py +++ b/authentik/stages/prompt/api.py @@ -29,6 +29,7 @@ class PromptStageViewSet(UsedByMixin, ModelViewSet): serializer_class = PromptStageSerializer filterset_fields = "__all__" ordering = ["name"] + search_fields = ["name"] class PromptSerializer(ModelSerializer): @@ -59,3 +60,4 @@ class PromptViewSet(UsedByMixin, ModelViewSet): queryset = Prompt.objects.all().prefetch_related("promptstage_set") serializer_class = PromptSerializer filterset_fields = ["field_key", "label", "type", "placeholder"] + search_fields = ["field_key", "label", "type", "placeholder"] diff --git a/authentik/stages/user_delete/api.py b/authentik/stages/user_delete/api.py index a2f65c42c..1ba14d8f8 100644 --- a/authentik/stages/user_delete/api.py +++ b/authentik/stages/user_delete/api.py @@ -22,3 +22,4 @@ class UserDeleteStageViewSet(UsedByMixin, ModelViewSet): serializer_class = UserDeleteStageSerializer filterset_fields = "__all__" ordering = ["name"] + search_fields = ["name"] diff --git a/authentik/stages/user_login/api.py b/authentik/stages/user_login/api.py index ec62c4827..e8f8048b8 100644 --- a/authentik/stages/user_login/api.py +++ b/authentik/stages/user_login/api.py @@ -23,4 +23,5 @@ class UserLoginStageViewSet(UsedByMixin, ModelViewSet): queryset = UserLoginStage.objects.all() serializer_class = UserLoginStageSerializer filterset_fields = "__all__" + search_fields = ["name"] ordering = ["name"] diff --git a/authentik/stages/user_logout/api.py b/authentik/stages/user_logout/api.py index d5f506b2b..16e061f2f 100644 --- a/authentik/stages/user_logout/api.py +++ b/authentik/stages/user_logout/api.py @@ -21,4 +21,5 @@ class UserLogoutStageViewSet(UsedByMixin, ModelViewSet): queryset = UserLogoutStage.objects.all() serializer_class = UserLogoutStageSerializer filterset_fields = "__all__" + search_fields = ["name"] ordering = ["name"] diff --git a/authentik/stages/user_write/api.py b/authentik/stages/user_write/api.py index fd7b7dee5..c1a1baf56 100644 --- a/authentik/stages/user_write/api.py +++ b/authentik/stages/user_write/api.py @@ -21,4 +21,5 @@ class UserWriteStageViewSet(UsedByMixin, ModelViewSet): queryset = UserWriteStage.objects.all() serializer_class = UserWriteStageSerializer filterset_fields = "__all__" + search_fields = ["name"] ordering = ["name"] diff --git a/schema.yml b/schema.yml index 39b716538..1be18cbe3 100644 --- a/schema.yml +++ b/schema.yml @@ -1601,6 +1601,10 @@ paths: operationId: core_applications_list description: Custom list method that checks Policy based access instead of guardian parameters: + - in: query + name: name + schema: + type: string - name: ordering required: false in: query @@ -1625,6 +1629,10 @@ paths: description: A search term. schema: type: string + - in: query + name: slug + schema: + type: string - in: query name: superuser_full_list schema: @@ -6114,6 +6122,10 @@ paths: operationId: outposts_ldap_list description: LDAPProvider Viewset parameters: + - in: query + name: name + schema: + type: string - name: ordering required: false in: query @@ -6184,6 +6196,10 @@ paths: operationId: outposts_proxy_list description: ProxyProvider Viewset parameters: + - in: query + name: name + schema: + type: string - name: ordering required: false in: query