Skip to content

Commit

Permalink
reverted 8257a03 to fix filtersets
Browse files Browse the repository at this point in the history
  • Loading branch information
abhi1693 committed Jan 26, 2024
1 parent b1abd4c commit 401ab62
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 29 deletions.
4 changes: 2 additions & 2 deletions netbox_secrets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
14 changes: 13 additions & 1 deletion netbox_secrets/filtersets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down
1 change: 0 additions & 1 deletion netbox_secrets/forms/filterset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from django import forms
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import gettext as _

Expand Down
5 changes: 2 additions & 3 deletions netbox_secrets/tests/test_filters.py
Original file line number Diff line number Diff line change
@@ -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 *
Expand Down Expand Up @@ -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)
29 changes: 7 additions & 22 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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='[email protected]',
Expand Down

0 comments on commit 401ab62

Please sign in to comment.