diff --git a/security/py-netbox-secrets/Makefile b/security/py-netbox-secrets/Makefile index a20a46ba97e4..15a7f8ec7100 100644 --- a/security/py-netbox-secrets/Makefile +++ b/security/py-netbox-secrets/Makefile @@ -1,27 +1,28 @@ PORTNAME= netbox-secrets DISTVERSION= 3.0.0 +PORTREVISION= 1 CATEGORIES= security python MASTER_SITES= PYPI PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} DISTNAME= netbox_secrets-${DISTVERSION} MAINTAINER= kai@FreeBSD.org COMMENT= Secret store for NetBox WWW= https://github.com/Onemind-Services-LLC/netbox-secrets LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/LICENSE.md BUILD_DEPENDS= ${PY_SETUPTOOLS} \ ${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR} RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pycryptodome>=3.23.0:security/py-pycryptodome@${PY_FLAVOR} USES= python USE_PYTHON= autoplist pep517 NO_ARCH= yes SUB_FILES= pkg-message SUB_LIST= PYTHON_VER=${PYTHON_VER} .include diff --git a/security/py-netbox-secrets/files/patch-netbox__secrets_api_views.py b/security/py-netbox-secrets/files/patch-netbox__secrets_api_views.py new file mode 100644 index 000000000000..bf80f2407895 --- /dev/null +++ b/security/py-netbox-secrets/files/patch-netbox__secrets_api_views.py @@ -0,0 +1,55 @@ +Fix API schema error caused by LegacyActivateUserKeyViewSet + +Obtained from: + +https://github.com/Onemind-Services-LLC/netbox-secrets/pull/241 + +--- netbox_secrets/api/views.py.orig 2026-03-18 08:56:30 UTC ++++ netbox_secrets/api/views.py +@@ -725,6 +725,46 @@ class LegacyActivateUserKeyViewSet(ViewSet): + permission_classes = [IsAuthenticated] + serializer_class = serializers.ActivateUserKeySerializer + ++ @extend_schema( ++ request=serializers.ActivateUserKeySerializer, ++ responses={ ++ 200: OpenApiResponse( ++ response=OpenApiTypes.STR, ++ description="Plain-text success message.", ++ examples=[ ++ OpenApiExample( ++ "Success", ++ value="Successfully activated 2 user keys.", ++ ) ++ ], ++ ), ++ 400: OpenApiResponse( ++ description="Bad request or validation error.", ++ response=OpenApiTypes.OBJECT, ++ examples=[ ++ OpenApiExample( ++ "Validation error", ++ value={"user_key_ids": ["This field is required."]}, ++ ), ++ OpenApiExample( ++ "Legacy error message", ++ value={"detail": ERR_NO_KEYS_PROVIDED}, ++ ), ++ ], ++ ), ++ 403: OpenApiResponse( ++ response=OpenApiTypes.STR, ++ description="Permission denied.", ++ examples=[ ++ OpenApiExample( ++ "Permission denied", ++ value="You do not have permission to active User Keys.", ++ ) ++ ], ++ ), ++ }, ++ deprecated=True, ++ ) + def create(self, request): + """ + Activate one or more user keys using the caller's private key. diff --git a/security/py-netbox-secrets/files/patch-netbox__secrets_graphql_filters.py b/security/py-netbox-secrets/files/patch-netbox__secrets_graphql_filters.py new file mode 100644 index 000000000000..90dffb5d66e1 --- /dev/null +++ b/security/py-netbox-secrets/files/patch-netbox__secrets_graphql_filters.py @@ -0,0 +1,30 @@ +Fixes following warnings/exceptions: + +UserWarning: FilterLookup[str] may cause DuplicatedTypeName errors. Use StrFilterLookup instead + +Obtained from: + +https://github.com/Onemind-Services-LLC/netbox-secrets/pull/239 + +--- netbox_secrets/graphql/filters.py.orig 2026-03-18 09:11:43 UTC ++++ netbox_secrets/graphql/filters.py +@@ -3,7 +3,7 @@ from strawberry.scalars import ID + import strawberry + import strawberry_django + from strawberry.scalars import ID +-from strawberry_django import FilterLookup ++from strawberry_django import StrFilterLookup + + from netbox.graphql.filters import ( + OrganizationalModelFilter, +@@ -36,8 +36,8 @@ class SecretRoleFilter(OrganizationalModelFilter): + + + @strawberry_django.filter_type(Secret, lookups=True) +-class SecretFilter(ContactFilterMixin, PrimaryModelFilter): +- name: FilterLookup[str] | None = strawberry_django.filter_field() ++class SecretFilter(PrimaryModelFilter, ContactFilterMixin): ++ name: StrFilterLookup[str] | None = strawberry_django.filter_field() + role: Annotated[ + 'SecretRoleFilter', strawberry.lazy('netbox_secrets.graphql.filters') + ] | None = strawberry_django.filter_field()