diff --git a/netbox_secrets/__init__.py b/netbox_secrets/__init__.py index e1419ec..7c3b380 100644 --- a/netbox_secrets/__init__.py +++ b/netbox_secrets/__init__.py @@ -8,8 +8,8 @@ class NetBoxSecrets(PluginConfig): name = metadata.get('Name').replace('-', '_') - verbose_name = metadata.get('Summary') - description = metadata.get('Description') + verbose_name = metadata.get('Name') + description = metadata.get('Summary') version = metadata.get('Version') author = metadata.get('Author') author_email = metadata.get('Author-email') diff --git a/netbox_secrets/filtersets.py b/netbox_secrets/filtersets.py index e3109bc..05360d1 100644 --- a/netbox_secrets/filtersets.py +++ b/netbox_secrets/filtersets.py @@ -23,7 +23,7 @@ class SecretRoleFilterSet(NetBoxModelFilterSet): class Meta: model = SecretRole - fields = ['id', 'slug', 'description', 'comments'] + fields = ['id', 'name', 'slug', 'description', 'comments'] def search(self, queryset, name, value): if not value.strip(): @@ -67,6 +67,12 @@ class Meta: model = Secret fields = [ 'id', + 'assigned_object_type', + 'assigned_object_type_id', + 'assigned_object_id', + 'role_id', + 'role', + 'name', 'contact', 'description', 'comments', @@ -111,6 +117,12 @@ class Meta: model = Secret fields = [ 'id', + 'assigned_object_type', + 'assigned_object_type_id', + 'assigned_object_id', + 'role_id', + 'role', + 'name', '_object_repr', 'description', 'comments', diff --git a/netbox_secrets/forms/filterset.py b/netbox_secrets/forms/filterset.py index 5176900..aa5ba41 100644 --- a/netbox_secrets/forms/filterset.py +++ b/netbox_secrets/forms/filterset.py @@ -1,4 +1,3 @@ -from django import forms from django.contrib.contenttypes.models import ContentType from django.utils.translation import gettext as _ diff --git a/netbox_secrets/tests/test_filters.py b/netbox_secrets/tests/test_filters.py index c6595db..131a748 100644 --- a/netbox_secrets/tests/test_filters.py +++ b/netbox_secrets/tests/test_filters.py @@ -1,5 +1,4 @@ from django.test import TestCase -from django.contrib.contenttypes.models import ContentType from dcim.models import Device, DeviceRole, DeviceType, Manufacturer, Site from netbox_secrets.filtersets import * @@ -95,9 +94,9 @@ def test_assigned_object(self): 'assigned_object_type': 'dcim.device', 'assigned_object_id': [Device.objects.first().pk], } - self.assertEqual(self.filterset(params, self.queryset).qs.count(), 3) + self.assertEqual(self.filterset(params, self.queryset).qs.count(), 1) params = { 'assigned_object_type': 'virtualization.virtualmachine', 'assigned_object_id': [VirtualMachine.objects.first().pk], } - self.assertEqual(self.filterset(params, self.queryset).qs.count(), 3) + self.assertEqual(self.filterset(params, self.queryset).qs.count(), 1) diff --git a/setup.py b/setup.py index 2ae413d..8635d69 100644 --- a/setup.py +++ b/setup.py @@ -1,34 +1,19 @@ +import os from setuptools import find_packages, setup -description = """ -Enhance your secret management with encrypted storage and flexible, user-friendly features, seamlessly integrated into -the NetBox environment. -""" +description = "Enhance your secret management with encrypted storage and flexible, user-friendly features." -long_description=""" -# NetBox Secrets +readme = os.path.join(os.path.dirname(__file__), 'README.md') -NetBox Secrets is a comprehensive overhaul of the original NetBox Secretstore plugin. It's designed to address the -limitations and maintenance challenges of the predecessor. This plugin introduces significant enhancements in terms of -flexibility and usability, ensuring seamless integration with the latest NetBox versions. - -## Key Features: - -- Employs RSA public key cryptography for secure storage of secrets in the database. -- Allows secrets to be assigned to any object in NetBox, enhancing the plugin’s applicability and utility. -- Enables assigning secrets to contacts, ideal for scenarios like linking SSH keys with specific individuals. -- The redesigned interface is more intuitive and user-friendly, streamlining navigation and secret management. -- Continuous testing with the latest NetBox releases ensures consistent compatibility and reliability. - -NetBox Secrets is committed to bridging the gap between robust security needs and an optimal user experience in NetBox -environments. -""" +with open(readme) as fh: + long_description = fh.read() setup( name='netbox-secrets', - version='1.9.1', + version='1.9.2', description=description, long_description=long_description, + long_description_content_type="text/markdown", url='https://github.com/Onemind-Services-LLC/netbox-secrets/', author='Abhimanyu Saharan', author_email='asaharan@onemindservices.com',