netbox-user-credentials-plugin 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- netbox_user_credentials_plugin-0.1.0/LICENSE +13 -0
- netbox_user_credentials_plugin-0.1.0/MANIFEST.in +11 -0
- netbox_user_credentials_plugin-0.1.0/PKG-INFO +97 -0
- netbox_user_credentials_plugin-0.1.0/README.md +64 -0
- netbox_user_credentials_plugin-0.1.0/docs/images/contact_uc_view.png +0 -0
- netbox_user_credentials_plugin-0.1.0/docs/images/uc_view.png +0 -0
- netbox_user_credentials_plugin-0.1.0/docs/images/vm_uc_view.png +0 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin/__init__.py +16 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin/api/__init__.py +6 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin/api/serializers.py +38 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin/api/urls.py +21 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin/api/views.py +20 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin/filtersets.py +20 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin/forms.py +128 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin/migrations/0001_initial.py +34 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin/migrations/0002_alter_usercredentials_options_and_more.py +76 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin/migrations/0003_rename_usergroups_usercredentialgroups_and_more.py +25 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin/migrations/0004_remove_usercredentials_groups_and_more.py +20 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin/migrations/0005_alter_usercredentials_username.py +18 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin/migrations/0006_alter_usercredentials_virtual_machine.py +20 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin/migrations/0007_alter_usercredentials_username.py +18 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin/migrations/0008_usercredentials_netbox_user_credentials_plugin_usercredentials_unique_usercredentials.py +20 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin/migrations/0009_usercredentials_last_logon_and_more.py +23 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin/migrations/0010_rename_last_logon_usercredentials_last_login_at_and_more.py +25 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin/migrations/0011_alter_usercredentials_last_login_ip.py +20 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin/migrations/__init__.py +7 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin/models.py +83 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin/navigation.py +28 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin/search.py +71 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin/tables.py +98 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin/templates/netbox_user_credentials_plugin/usercredentials.html +43 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin/templates/netbox_user_credentials_plugin/virtual_machine_user_credentials.html +5 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin/urls.py +48 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin/views.py +85 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin.egg-info/PKG-INFO +97 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin.egg-info/SOURCES.txt +39 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin.egg-info/dependency_links.txt +1 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin.egg-info/requires.txt +6 -0
- netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin.egg-info/top_level.txt +1 -0
- netbox_user_credentials_plugin-0.1.0/pyproject.toml +79 -0
- netbox_user_credentials_plugin-0.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
|
2
|
+
Version 2, December 2004
|
|
3
|
+
|
|
4
|
+
Copyright (C) 2026 Dmitry Konyushenko <konyushenko.dmitriy@gmail.com>
|
|
5
|
+
|
|
6
|
+
Everyone is permitted to copy and distribute verbatim or modified
|
|
7
|
+
copies of this license document, and changing it is allowed as long
|
|
8
|
+
as the name is changed.
|
|
9
|
+
|
|
10
|
+
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
|
11
|
+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
|
12
|
+
|
|
13
|
+
0. You just DO WHAT THE FUCK YOU WANT TO.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: netbox-user-credentials-plugin
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: NetBox plugin for User Credentials
|
|
5
|
+
Author-email: Dmitry Konyushenko <konyushenko.dmitriy@gmail.com>
|
|
6
|
+
License-Expression: WTFPL
|
|
7
|
+
Project-URL: Homepage, https://github.com/ilyjorsey/netbox-user-credentials-plugin
|
|
8
|
+
Project-URL: Documentation, https://github.com/ilyjorsey/netbox-user-credentials-plugin/blob/main/README.md
|
|
9
|
+
Project-URL: Source, https://github.com/ilyjorsey/netbox-user-credentials-plugin
|
|
10
|
+
Project-URL: Tracker, https://github.com/ilyjorsey/netbox-user-credentials-plugin/issues
|
|
11
|
+
Keywords: netbox,netbox-plugin
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Framework :: Django
|
|
14
|
+
Classifier: Framework :: Django :: 5.1
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Intended Audience :: System Administrators
|
|
17
|
+
Classifier: Intended Audience :: Telecommunications Industry
|
|
18
|
+
Classifier: Natural Language :: English
|
|
19
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
23
|
+
Classifier: Topic :: System :: Networking
|
|
24
|
+
Requires-Python: >=3.12.0
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Provides-Extra: test
|
|
28
|
+
Requires-Dist: check-manifest==0.51; extra == "test"
|
|
29
|
+
Requires-Dist: ruff==0.14.14; extra == "test"
|
|
30
|
+
Requires-Dist: pre-commit==6.0.0; extra == "test"
|
|
31
|
+
Requires-Dist: pytest==9.0.2; extra == "test"
|
|
32
|
+
Dynamic: license-file
|
|
33
|
+
|
|
34
|
+
# NetBox User Credentials Plugin
|
|
35
|
+
|
|
36
|
+
NetBox plugin for managing User Credentials.
|
|
37
|
+
|
|
38
|
+
The standard NetBox VM model only allows contacts to be assigned. However, if you need to keep an inventory of users associated with virtual machines, including multiple users linked to the same contact, NetBox does not provide sufficient functionality out of the box. The User Credentials plugin helps solve this problem.
|
|
39
|
+
|
|
40
|
+
- Free software: WTFPL
|
|
41
|
+
- Documentation: https://ilyjorsey.github.io/netbox-user-credentials-plugin/
|
|
42
|
+
|
|
43
|
+
## Screenshots
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
| User Credentials page |
|
|
47
|
+
|:---:|
|
|
48
|
+

|
|
49
|
+
|
|
50
|
+
| Contact page - User Credentials | Virtual Machine page - User Credentials |
|
|
51
|
+
|:---:|:---:|
|
|
52
|
+
|  |  |
|
|
53
|
+
|
|
54
|
+
## Compatibility
|
|
55
|
+
|
|
56
|
+
This plugin requires **NetBox 4.5** or later.
|
|
57
|
+
|
|
58
|
+
| NetBox Version | Plugin Version |
|
|
59
|
+
|----------------|----------------|
|
|
60
|
+
| 4.5+ | 0.1.0 |
|
|
61
|
+
|
|
62
|
+
For more detailed compatibility information, see [COMPATIBILITY.md](COMPATIBILITY.md).
|
|
63
|
+
|
|
64
|
+
## REST API
|
|
65
|
+
|
|
66
|
+
This plugin provides a REST API endpoint for managing User Credentials resources:
|
|
67
|
+
|
|
68
|
+
- `/api/plugins/netbox_user_credentials_plugin/user-credentials/` - List and create plugin objects
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
## Installing
|
|
73
|
+
|
|
74
|
+
For adding to a NetBox Docker setup see
|
|
75
|
+
[the general instructions for using netbox-docker with plugins](https://github.com/netbox-community/netbox-docker/wiki/Using-Netbox-Plugins).
|
|
76
|
+
|
|
77
|
+
Enable the plugin in `/opt/netbox/netbox/netbox/configuration.py`,
|
|
78
|
+
or if you use netbox-docker, your `/configuration/plugins.py` file :
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
PLUGINS = [
|
|
82
|
+
'netbox_user_credentials_plugin'
|
|
83
|
+
]
|
|
84
|
+
|
|
85
|
+
PLUGINS_CONFIG = {
|
|
86
|
+
"netbox_user_credentials_plugin": {},
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Usage
|
|
91
|
+
|
|
92
|
+
For detailed usage instructions, please refer to the [documentation](https://ilyjorsey.github.io/netbox-user-credentials-plugin/).
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
### Feature Requests & Reporting Bugs
|
|
96
|
+
|
|
97
|
+
Feature Requests & Reporting Bugs can be submitted as [GitHub Issues](https://github.com/ilyjorsey/netbox-user-credentials-plugin/issues).
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# NetBox User Credentials Plugin
|
|
2
|
+
|
|
3
|
+
NetBox plugin for managing User Credentials.
|
|
4
|
+
|
|
5
|
+
The standard NetBox VM model only allows contacts to be assigned. However, if you need to keep an inventory of users associated with virtual machines, including multiple users linked to the same contact, NetBox does not provide sufficient functionality out of the box. The User Credentials plugin helps solve this problem.
|
|
6
|
+
|
|
7
|
+
- Free software: WTFPL
|
|
8
|
+
- Documentation: https://ilyjorsey.github.io/netbox-user-credentials-plugin/
|
|
9
|
+
|
|
10
|
+
## Screenshots
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
| User Credentials page |
|
|
14
|
+
|:---:|
|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
| Contact page - User Credentials | Virtual Machine page - User Credentials |
|
|
18
|
+
|:---:|:---:|
|
|
19
|
+
|  |  |
|
|
20
|
+
|
|
21
|
+
## Compatibility
|
|
22
|
+
|
|
23
|
+
This plugin requires **NetBox 4.5** or later.
|
|
24
|
+
|
|
25
|
+
| NetBox Version | Plugin Version |
|
|
26
|
+
|----------------|----------------|
|
|
27
|
+
| 4.5+ | 0.1.0 |
|
|
28
|
+
|
|
29
|
+
For more detailed compatibility information, see [COMPATIBILITY.md](COMPATIBILITY.md).
|
|
30
|
+
|
|
31
|
+
## REST API
|
|
32
|
+
|
|
33
|
+
This plugin provides a REST API endpoint for managing User Credentials resources:
|
|
34
|
+
|
|
35
|
+
- `/api/plugins/netbox_user_credentials_plugin/user-credentials/` - List and create plugin objects
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
## Installing
|
|
40
|
+
|
|
41
|
+
For adding to a NetBox Docker setup see
|
|
42
|
+
[the general instructions for using netbox-docker with plugins](https://github.com/netbox-community/netbox-docker/wiki/Using-Netbox-Plugins).
|
|
43
|
+
|
|
44
|
+
Enable the plugin in `/opt/netbox/netbox/netbox/configuration.py`,
|
|
45
|
+
or if you use netbox-docker, your `/configuration/plugins.py` file :
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
PLUGINS = [
|
|
49
|
+
'netbox_user_credentials_plugin'
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
PLUGINS_CONFIG = {
|
|
53
|
+
"netbox_user_credentials_plugin": {},
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Usage
|
|
58
|
+
|
|
59
|
+
For detailed usage instructions, please refer to the [documentation](https://ilyjorsey.github.io/netbox-user-credentials-plugin/).
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
### Feature Requests & Reporting Bugs
|
|
63
|
+
|
|
64
|
+
Feature Requests & Reporting Bugs can be submitted as [GitHub Issues](https://github.com/ilyjorsey/netbox-user-credentials-plugin/issues).
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from netbox.plugins import PluginConfig
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class UserCredentialsConfig(PluginConfig):
|
|
5
|
+
name = "netbox_user_credentials_plugin"
|
|
6
|
+
verbose_name = "NetBox User Credentials"
|
|
7
|
+
description = "NetBox plugin for managing virtual machine users credentials"
|
|
8
|
+
author = "Dmitry Konyushenko"
|
|
9
|
+
author_email = "konyushenko.dmitriy@gmail.com"
|
|
10
|
+
version = "0.1.0"
|
|
11
|
+
base_url = "netbox_user_credentials_plugin"
|
|
12
|
+
min_version = "4.5.0"
|
|
13
|
+
max_version = "4.6.2"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
config = UserCredentialsConfig
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""
|
|
2
|
+
API serializers for NetBox User Credentials Plugin.
|
|
3
|
+
|
|
4
|
+
Serializers are required for NetBox event handling (webhooks, change logging).
|
|
5
|
+
They also power the REST API endpoints.
|
|
6
|
+
|
|
7
|
+
For more information on NetBox REST API serializers, see:
|
|
8
|
+
https://docs.netbox.dev/en/stable/plugins/development/rest-api/#serializers
|
|
9
|
+
|
|
10
|
+
For Django REST Framework serializers, see:
|
|
11
|
+
https://www.django-rest-framework.org/api-guide/serializers/
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from netbox.api.serializers import NetBoxModelSerializer
|
|
15
|
+
from rest_framework import serializers
|
|
16
|
+
|
|
17
|
+
from ..models import UserCredentials
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class UserCredentialsSerializer(NetBoxModelSerializer):
|
|
21
|
+
url = serializers.HyperlinkedIdentityField(
|
|
22
|
+
view_name="plugins-api:netbox_user_credentials_plugin-api:usercredentials-detail"
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
class Meta:
|
|
26
|
+
model = UserCredentials
|
|
27
|
+
fields = ("id",
|
|
28
|
+
"url",
|
|
29
|
+
"display",
|
|
30
|
+
"username",
|
|
31
|
+
"virtual_machine",
|
|
32
|
+
"contact",
|
|
33
|
+
"password_valid_from",
|
|
34
|
+
"password_valid_to",
|
|
35
|
+
"tags",
|
|
36
|
+
"custom_fields",
|
|
37
|
+
"created",
|
|
38
|
+
"last_updated")
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"""
|
|
2
|
+
API URL patterns for NetBox User Credentials Plugin.
|
|
3
|
+
|
|
4
|
+
For more information on NetBox REST API routing, see:
|
|
5
|
+
https://docs.netbox.dev/en/stable/plugins/development/rest-api/#routers
|
|
6
|
+
|
|
7
|
+
For Django REST Framework routers, see:
|
|
8
|
+
https://www.django-rest-framework.org/api-guide/routers/
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from netbox.api.routers import NetBoxRouter
|
|
12
|
+
|
|
13
|
+
from .views import UserCredentialsViewSet
|
|
14
|
+
|
|
15
|
+
app_name = "netbox_user_credentials_plugin"
|
|
16
|
+
|
|
17
|
+
router = NetBoxRouter()
|
|
18
|
+
router.register("user-credentials", UserCredentialsViewSet)
|
|
19
|
+
|
|
20
|
+
urlpatterns = router.urls
|
|
21
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""
|
|
2
|
+
API viewsets for NetBox User Credentials Plugin.
|
|
3
|
+
|
|
4
|
+
For more information on NetBox REST API viewsets, see:
|
|
5
|
+
https://docs.netbox.dev/en/stable/plugins/development/rest-api/#viewsets
|
|
6
|
+
|
|
7
|
+
For Django REST Framework viewsets, see:
|
|
8
|
+
https://www.django-rest-framework.org/api-guide/viewsets/
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from netbox.api.viewsets import NetBoxModelViewSet
|
|
12
|
+
|
|
13
|
+
from ..models import UserCredentials
|
|
14
|
+
from .serializers import UserCredentialsSerializer
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class UserCredentialsViewSet(NetBoxModelViewSet):
|
|
18
|
+
queryset = UserCredentials.objects.all()
|
|
19
|
+
serializer_class = UserCredentialsSerializer
|
|
20
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from netbox.filtersets import NetBoxModelFilterSet
|
|
2
|
+
|
|
3
|
+
from .models import UserCredentials
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class UserCredentialsFilterSet(NetBoxModelFilterSet):
|
|
7
|
+
class Meta:
|
|
8
|
+
model = UserCredentials
|
|
9
|
+
fields = [
|
|
10
|
+
"username",
|
|
11
|
+
"virtual_machine",
|
|
12
|
+
"contact",
|
|
13
|
+
"password_valid_from",
|
|
14
|
+
"password_valid_to",
|
|
15
|
+
"last_login_at",
|
|
16
|
+
"last_login_ip",
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
def search(self, queryset, username, value):
|
|
20
|
+
return queryset.filter(username__icontains=value)
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
from django import forms
|
|
2
|
+
from netbox.forms import (
|
|
3
|
+
NetBoxModelBulkEditForm,
|
|
4
|
+
NetBoxModelFilterSetForm,
|
|
5
|
+
NetBoxModelForm,
|
|
6
|
+
)
|
|
7
|
+
from tenancy.models import Contact
|
|
8
|
+
from utilities.forms.fields import (
|
|
9
|
+
DynamicModelChoiceField,
|
|
10
|
+
DynamicModelMultipleChoiceField,
|
|
11
|
+
)
|
|
12
|
+
from utilities.forms.widgets import DatePicker
|
|
13
|
+
from virtualization.models import VirtualMachine
|
|
14
|
+
from ipam.models import IPAddress
|
|
15
|
+
|
|
16
|
+
from .models import UserCredentials
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class UserCredentialsForm(NetBoxModelForm):
|
|
20
|
+
|
|
21
|
+
class Meta:
|
|
22
|
+
model = UserCredentials
|
|
23
|
+
fields = (
|
|
24
|
+
"username",
|
|
25
|
+
"virtual_machine",
|
|
26
|
+
"contact",
|
|
27
|
+
"password_valid_from",
|
|
28
|
+
"password_valid_to",
|
|
29
|
+
"last_login_at",
|
|
30
|
+
"last_login_ip",
|
|
31
|
+
"comments",
|
|
32
|
+
)
|
|
33
|
+
widgets = {
|
|
34
|
+
"password_valid_from": DatePicker(),
|
|
35
|
+
"password_valid_to": DatePicker(),
|
|
36
|
+
"last_login_at": DatePicker(),
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class UserCredentialsFilterForm(NetBoxModelFilterSetForm):
|
|
41
|
+
model = UserCredentials
|
|
42
|
+
|
|
43
|
+
username = forms.CharField(
|
|
44
|
+
required=False,
|
|
45
|
+
label="Username",
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
virtual_machine = DynamicModelMultipleChoiceField(
|
|
49
|
+
queryset=VirtualMachine.objects.all(),
|
|
50
|
+
required=False,
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
contact = DynamicModelMultipleChoiceField(
|
|
54
|
+
queryset=Contact.objects.all(),
|
|
55
|
+
required=False,
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
last_login_ip = DynamicModelMultipleChoiceField(
|
|
59
|
+
queryset=IPAddress.objects.all(),
|
|
60
|
+
required=False,
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
password_valid_from = forms.DateField(
|
|
64
|
+
required=False,
|
|
65
|
+
widget=DatePicker(),
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
password_valid_to = forms.DateField(
|
|
69
|
+
required=False,
|
|
70
|
+
widget=DatePicker(),
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
last_login_at = forms.DateField(
|
|
74
|
+
required=False,
|
|
75
|
+
widget=DatePicker(),
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
class UserCredentialsBulkEditForm(NetBoxModelBulkEditForm):
|
|
80
|
+
|
|
81
|
+
username = forms.CharField(
|
|
82
|
+
required=False,
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
virtual_machine = DynamicModelChoiceField(
|
|
86
|
+
queryset=VirtualMachine.objects.all(),
|
|
87
|
+
required=False,
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
contact = DynamicModelChoiceField(
|
|
91
|
+
queryset=Contact.objects.all(),
|
|
92
|
+
required=False,
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
password_valid_from = forms.DateField(
|
|
96
|
+
required=False,
|
|
97
|
+
widget=DatePicker(),
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
password_valid_to = forms.DateField(
|
|
101
|
+
required=False,
|
|
102
|
+
widget=DatePicker(),
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
last_login_at = forms.DateField(
|
|
106
|
+
required=False,
|
|
107
|
+
widget=DatePicker(),
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
last_login_ip = forms.GenericIPAddressField(
|
|
111
|
+
required=False,
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
comments = forms.CharField(
|
|
115
|
+
required=False,
|
|
116
|
+
widget=forms.Textarea,
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
model = UserCredentials
|
|
120
|
+
|
|
121
|
+
nullable_fields = (
|
|
122
|
+
"contact",
|
|
123
|
+
"password_valid_from",
|
|
124
|
+
"password_valid_to",
|
|
125
|
+
"last_login_at",
|
|
126
|
+
"last_login_ip",
|
|
127
|
+
"comments",
|
|
128
|
+
)
|
netbox_user_credentials_plugin-0.1.0/netbox_user_credentials_plugin/migrations/0001_initial.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Generated by Django 6.0.5 on 2026-06-14 20:13
|
|
2
|
+
|
|
3
|
+
import netbox.models.deletion
|
|
4
|
+
import taggit.managers
|
|
5
|
+
import utilities.json
|
|
6
|
+
from django.db import migrations, models
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Migration(migrations.Migration):
|
|
10
|
+
|
|
11
|
+
initial = True
|
|
12
|
+
|
|
13
|
+
dependencies = [
|
|
14
|
+
('extras', '0138_customfieldchoiceset_choice_colors'),
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
operations = [
|
|
18
|
+
migrations.CreateModel(
|
|
19
|
+
name='Usercredentials',
|
|
20
|
+
fields=[
|
|
21
|
+
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
22
|
+
('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
23
|
+
('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
24
|
+
('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
25
|
+
('name', models.CharField(max_length=100, unique=True)),
|
|
26
|
+
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
|
27
|
+
],
|
|
28
|
+
options={
|
|
29
|
+
'verbose_name_plural': 'Usercredentialss',
|
|
30
|
+
'ordering': ('name',),
|
|
31
|
+
},
|
|
32
|
+
bases=(netbox.models.deletion.DeleteMixin, models.Model),
|
|
33
|
+
),
|
|
34
|
+
]
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Generated by Django 6.0.5 on 2026-06-15 18:06
|
|
2
|
+
|
|
3
|
+
import django.db.models.deletion
|
|
4
|
+
import netbox.models.deletion
|
|
5
|
+
import taggit.managers
|
|
6
|
+
import utilities.json
|
|
7
|
+
from django.db import migrations, models
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Migration(migrations.Migration):
|
|
11
|
+
|
|
12
|
+
dependencies = [
|
|
13
|
+
('extras', '0138_customfieldchoiceset_choice_colors'),
|
|
14
|
+
('netbox_user_credentials_plugin', '0001_initial'),
|
|
15
|
+
('tenancy', '0024_default_ordering_indexes'),
|
|
16
|
+
('virtualization', '0056_virtualmachine_render_config_permission'),
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
operations = [
|
|
20
|
+
migrations.AlterModelOptions(
|
|
21
|
+
name='usercredentials',
|
|
22
|
+
options={'ordering': ('username',)},
|
|
23
|
+
),
|
|
24
|
+
migrations.RenameField(
|
|
25
|
+
model_name='usercredentials',
|
|
26
|
+
old_name='name',
|
|
27
|
+
new_name='username',
|
|
28
|
+
),
|
|
29
|
+
migrations.AddField(
|
|
30
|
+
model_name='usercredentials',
|
|
31
|
+
name='comments',
|
|
32
|
+
field=models.TextField(blank=True),
|
|
33
|
+
),
|
|
34
|
+
migrations.AddField(
|
|
35
|
+
model_name='usercredentials',
|
|
36
|
+
name='contact',
|
|
37
|
+
field=models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='user_credentials_contact', to='tenancy.contact'),
|
|
38
|
+
),
|
|
39
|
+
migrations.AddField(
|
|
40
|
+
model_name='usercredentials',
|
|
41
|
+
name='password_valid_from',
|
|
42
|
+
field=models.DateField(blank=True, default=None, null=True),
|
|
43
|
+
),
|
|
44
|
+
migrations.AddField(
|
|
45
|
+
model_name='usercredentials',
|
|
46
|
+
name='password_valid_to',
|
|
47
|
+
field=models.DateField(blank=True, default=None, null=True),
|
|
48
|
+
),
|
|
49
|
+
migrations.AddField(
|
|
50
|
+
model_name='usercredentials',
|
|
51
|
+
name='virtual_machine',
|
|
52
|
+
field=models.OneToOneField(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='user_credentials_virtual_machine', to='virtualization.virtualmachine'),
|
|
53
|
+
preserve_default=False,
|
|
54
|
+
),
|
|
55
|
+
migrations.CreateModel(
|
|
56
|
+
name='UserGroups',
|
|
57
|
+
fields=[
|
|
58
|
+
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False)),
|
|
59
|
+
('created', models.DateTimeField(auto_now_add=True, null=True)),
|
|
60
|
+
('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
61
|
+
('custom_field_data', models.JSONField(blank=True, default=dict, encoder=utilities.json.CustomFieldJSONEncoder)),
|
|
62
|
+
('name', models.CharField(max_length=100, unique=True)),
|
|
63
|
+
('comments', models.TextField(blank=True)),
|
|
64
|
+
('tags', taggit.managers.TaggableManager(through='extras.TaggedItem', to='extras.Tag')),
|
|
65
|
+
],
|
|
66
|
+
options={
|
|
67
|
+
'abstract': False,
|
|
68
|
+
},
|
|
69
|
+
bases=(netbox.models.deletion.DeleteMixin, models.Model),
|
|
70
|
+
),
|
|
71
|
+
migrations.AddField(
|
|
72
|
+
model_name='usercredentials',
|
|
73
|
+
name='groups',
|
|
74
|
+
field=models.ManyToManyField(blank=True, related_name='user_credentials_groups', to='netbox_user_credentials_plugin.usergroups'),
|
|
75
|
+
),
|
|
76
|
+
]
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Generated by Django 6.0.5 on 2026-06-16 18:40
|
|
2
|
+
|
|
3
|
+
import django.db.models.deletion
|
|
4
|
+
from django.db import migrations, models
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Migration(migrations.Migration):
|
|
8
|
+
|
|
9
|
+
dependencies = [
|
|
10
|
+
('extras', '0138_customfieldchoiceset_choice_colors'),
|
|
11
|
+
('netbox_user_credentials_plugin', '0002_alter_usercredentials_options_and_more'),
|
|
12
|
+
('tenancy', '0024_default_ordering_indexes'),
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
operations = [
|
|
16
|
+
migrations.RenameModel(
|
|
17
|
+
old_name='UserGroups',
|
|
18
|
+
new_name='UserCredentialGroups',
|
|
19
|
+
),
|
|
20
|
+
migrations.AlterField(
|
|
21
|
+
model_name='usercredentials',
|
|
22
|
+
name='contact',
|
|
23
|
+
field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='user_credentials_contact', to='tenancy.contact'),
|
|
24
|
+
),
|
|
25
|
+
]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Generated by Django 6.0.5 on 2026-06-17 19:35
|
|
2
|
+
|
|
3
|
+
from django.db import migrations
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
|
|
8
|
+
dependencies = [
|
|
9
|
+
('netbox_user_credentials_plugin', '0003_rename_usergroups_usercredentialgroups_and_more'),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
operations = [
|
|
13
|
+
migrations.RemoveField(
|
|
14
|
+
model_name='usercredentials',
|
|
15
|
+
name='groups',
|
|
16
|
+
),
|
|
17
|
+
migrations.DeleteModel(
|
|
18
|
+
name='UserCredentialGroups',
|
|
19
|
+
),
|
|
20
|
+
]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Generated by Django 6.0.5 on 2026-06-17 19:41
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
|
|
8
|
+
dependencies = [
|
|
9
|
+
('netbox_user_credentials_plugin', '0004_remove_usercredentials_groups_and_more'),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
operations = [
|
|
13
|
+
migrations.AlterField(
|
|
14
|
+
model_name='usercredentials',
|
|
15
|
+
name='username',
|
|
16
|
+
field=models.CharField(max_length=101, unique=True),
|
|
17
|
+
),
|
|
18
|
+
]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Generated by Django 6.0.5 on 2026-06-18 19:49
|
|
2
|
+
|
|
3
|
+
import django.db.models.deletion
|
|
4
|
+
from django.db import migrations, models
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Migration(migrations.Migration):
|
|
8
|
+
|
|
9
|
+
dependencies = [
|
|
10
|
+
('netbox_user_credentials_plugin', '0005_alter_usercredentials_username'),
|
|
11
|
+
('virtualization', '0056_virtualmachine_render_config_permission'),
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
operations = [
|
|
15
|
+
migrations.AlterField(
|
|
16
|
+
model_name='usercredentials',
|
|
17
|
+
name='virtual_machine',
|
|
18
|
+
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_credentials_virtual_machine', to='virtualization.virtualmachine'),
|
|
19
|
+
),
|
|
20
|
+
]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Generated by Django 6.0.5 on 2026-06-21 10:03
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
|
|
8
|
+
dependencies = [
|
|
9
|
+
('netbox_user_credentials_plugin', '0006_alter_usercredentials_virtual_machine'),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
operations = [
|
|
13
|
+
migrations.AlterField(
|
|
14
|
+
model_name='usercredentials',
|
|
15
|
+
name='username',
|
|
16
|
+
field=models.CharField(max_length=101),
|
|
17
|
+
),
|
|
18
|
+
]
|