Skip to content

Commit 7447924

Browse files
Closes: #5278 - Remove Secrets (#6397)
* Remove Secrets * #5278: Remove secrets javascript from netbox core * Remove userkey references * Fix PEP8 * Remove a few more instances of secrets. Rebundle * Remove Secrets Co-authored-by: checktheroads <[email protected]>
1 parent dc5c765 commit 7447924

File tree

97 files changed

+36
-3732
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+36
-3732
lines changed

docs/administration/netbox-shell.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ To delete multiple objects at once, call `delete()` on a filtered queryset. It's
194194
>>> Device.objects.filter(name__icontains='test').count()
195195
27
196196
>>> Device.objects.filter(name__icontains='test').delete()
197-
(35, {'dcim.DeviceBay': 0, 'secrets.Secret': 0, 'dcim.InterfaceConnection': 4,
197+
(35, {'dcim.DeviceBay': 0, 'dcim.InterfaceConnection': 4,
198198
'extras.ImageAttachment': 0, 'dcim.Device': 27, 'dcim.Interface': 4,
199199
'dcim.ConsolePort': 0, 'dcim.PowerPort': 0})
200200
```

docs/configuration/optional-settings.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ LOGGING = {
261261

262262
Default: False
263263

264-
Setting this to True will permit only authenticated users to access any part of NetBox. By default, anonymous users are permitted to access most data in NetBox (excluding secrets) but not make any changes.
264+
Setting this to True will permit only authenticated users to access any part of NetBox. By default, anonymous users are permitted to access most data in NetBox but not make any changes.
265265

266266
---
267267

docs/core-functionality/secrets.md

-8
This file was deleted.

docs/development/index.md

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ NetBox components are arranged into functional subsections called _apps_ (a carr
2525
* `dcim`: Datacenter infrastructure management (sites, racks, and devices)
2626
* `extras`: Additional features not considered part of the core data model
2727
* `ipam`: IP address management (VRFs, prefixes, IP addresses, and VLANs)
28-
* `secrets`: Encrypted storage of sensitive data (e.g. login credentials)
2928
* `tenancy`: Tenants (such as customers) to which NetBox objects may be assigned
3029
* `users`: Authentication and user preferences
3130
* `utilities`: Resources which are not user-facing (extendable classes, etc.)

docs/development/models.md

-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ The Django [content types](https://docs.djangoproject.com/en/stable/ref/contrib/
4747
* [ipam.Service](../models/ipam/service.md)
4848
* [ipam.VLAN](../models/ipam/vlan.md)
4949
* [ipam.VRF](../models/ipam/vrf.md)
50-
* [secrets.Secret](../models/secrets/secret.md)
5150
* [tenancy.Tenant](../models/tenancy/tenant.md)
5251
* [virtualization.Cluster](../models/virtualization/cluster.md)
5352
* [virtualization.VirtualMachine](../models/virtualization/virtualmachine.md)
@@ -62,7 +61,6 @@ The Django [content types](https://docs.djangoproject.com/en/stable/ref/contrib/
6261
* [ipam.RIR](../models/ipam/rir.md)
6362
* [ipam.Role](../models/ipam/role.md)
6463
* [ipam.VLANGroup](../models/ipam/vlangroup.md)
65-
* [secrets.SecretRole](../models/secrets/secretrole.md)
6664
* [virtualization.ClusterGroup](../models/virtualization/clustergroup.md)
6765
* [virtualization.ClusterType](../models/virtualization/clustertype.md)
6866

docs/models/dcim/virtualchassis.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
A virtual chassis represents a set of devices which share a common control plane. A common example of this is a stack of switches which are connected and configured to operate as a single device. A virtual chassis must be assigned a name and may be assigned a domain.
44

5-
Each device in the virtual chassis is referred to as a VC member, and assigned a position and (optionally) a priority. VC member devices commonly reside within the same rack, though this is not a requirement. One of the devices may be designated as the VC master: This device will typically be assigned a name, secrets, services, and other attributes related to managing the VC.
5+
Each device in the virtual chassis is referred to as a VC member, and assigned a position and (optionally) a priority. VC member devices commonly reside within the same rack, though this is not a requirement. One of the devices may be designated as the VC master: This device will typically be assigned a name, services, and other attributes related to managing the VC.
66

77
!!! note
88
It's important to recognize the distinction between a virtual chassis and a chassis-based device. A virtual chassis is **not** suitable for modeling a chassis-based switch with removable line cards (such as the Juniper EX9208), as its line cards are _not_ physically autonomous devices.

docs/models/secrets/secret.md

-5
This file was deleted.

docs/models/secrets/secretrole.md

-9
This file was deleted.

docs/models/secrets/userkey.md

-35
This file was deleted.

docs/rest-api/overview.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Comprehensive, interactive documentation of all REST API endpoints is available
6767

6868
## Endpoint Hierarchy
6969

70-
NetBox's entire REST API is housed under the API root at `https://<hostname>/api/`. The URL structure is divided at the root level by application: circuits, DCIM, extras, IPAM, plugins, secrets, tenancy, users, and virtualization. Within each application exists a separate path for each model. For example, the provider and circuit objects are located under the "circuits" application:
70+
NetBox's entire REST API is housed under the API root at `https://<hostname>/api/`. The URL structure is divided at the root level by application: circuits, DCIM, extras, IPAM, plugins, tenancy, users, and virtualization. Within each application exists a separate path for each model. For example, the provider and circuit objects are located under the "circuits" application:
7171

7272
* `/api/circuits/providers/`
7373
* `/api/circuits/circuits/`

docs/rest-api/working-with-secrets.md

-172
This file was deleted.

mkdocs.yml

-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ nav:
5858
- Service Mapping: 'core-functionality/services.md'
5959
- Circuits: 'core-functionality/circuits.md'
6060
- Power Tracking: 'core-functionality/power.md'
61-
- Secrets: 'core-functionality/secrets.md'
6261
- Tenancy: 'core-functionality/tenancy.md'
6362
- Additional Features:
6463
- Caching: 'additional-features/caching.md'
@@ -85,7 +84,6 @@ nav:
8584
- Overview: 'rest-api/overview.md'
8685
- Filtering: 'rest-api/filtering.md'
8786
- Authentication: 'rest-api/authentication.md'
88-
- Working with Secrets: 'rest-api/working-with-secrets.md'
8987
- Development:
9088
- Introduction: 'development/index.md'
9189
- Getting Started: 'development/getting-started.md'

netbox/dcim/models/devices.py

-6
Original file line numberDiff line numberDiff line change
@@ -592,12 +592,6 @@ class Device(PrimaryModel, ConfigContextModel):
592592
images = GenericRelation(
593593
to='extras.ImageAttachment'
594594
)
595-
secrets = GenericRelation(
596-
to='secrets.Secret',
597-
content_type_field='assigned_object_type',
598-
object_id_field='assigned_object_id',
599-
related_query_name='device'
600-
)
601595

602596
objects = ConfigContextModelQuerySet.as_manager()
603597

netbox/dcim/views.py

-5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from ipam.models import IPAddress, Prefix, Service, VLAN
2020
from ipam.tables import InterfaceIPAddressTable, InterfaceVLANTable
2121
from netbox.views import generic
22-
from secrets.models import Secret
2322
from utilities.forms import ConfirmationForm
2423
from utilities.paginator import EnhancedPaginator, get_paginate_count
2524
from utilities.permissions import get_permission_for_model
@@ -1293,9 +1292,6 @@ def get_extra_context(self, request, instance):
12931292
# Services
12941293
services = Service.objects.restrict(request.user, 'view').filter(device=instance)
12951294

1296-
# Secrets
1297-
secrets = Secret.objects.restrict(request.user, 'view').filter(device=instance)
1298-
12991295
# Find up to ten devices in the same site with the same functional role for quick reference.
13001296
related_devices = Device.objects.restrict(request.user, 'view').filter(
13011297
site=instance.site, device_role=instance.device_role
@@ -1307,7 +1303,6 @@ def get_extra_context(self, request, instance):
13071303

13081304
return {
13091305
'services': services,
1310-
'secrets': secrets,
13111306
'vc_members': vc_members,
13121307
'related_devices': related_devices,
13131308
'active_tab': 'device',

netbox/extras/management/commands/nbshell.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from django.contrib.contenttypes.models import ContentType
1010
from django.core.management.base import BaseCommand
1111

12-
APPS = ['circuits', 'dcim', 'extras', 'ipam', 'secrets', 'tenancy', 'users', 'virtualization']
12+
APPS = ['circuits', 'dcim', 'extras', 'ipam', 'tenancy', 'users', 'virtualization']
1313

1414
BANNER_TEXT = """### NetBox interactive shell ({node})
1515
### Python {python} | Django {django} | NetBox {netbox}

netbox/extras/migrations/0020_tag_data.py

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ class Migration(migrations.Migration):
5252
('circuits', '0015_custom_tag_models'),
5353
('dcim', '0070_custom_tag_models'),
5454
('ipam', '0025_custom_tag_models'),
55-
('secrets', '0006_custom_tag_models'),
5655
('tenancy', '0006_custom_tag_models'),
5756
('virtualization', '0009_custom_tag_models'),
5857
]

0 commit comments

Comments
 (0)