CustomScript Password input field #6751

Closed
opened 2025-12-29 19:44:58 +01:00 by adam · 5 comments
Owner

Originally created by @PieterL75 on GitHub (Aug 1, 2022).

NetBox version

v3.2.7

Feature type

Change to existing functionality

Proposed functionality

Create a new input variable that works as a password field and hides then inputted characters.

Use case

In some cases, I have to enter a password that is provided to the script. Currently the password is shown in cleartext on the screen.
An asterix-box would help to mask the password.

Obviously, the handing of the password in the script is all cleartext and up to the script maintainer to keep it save during the script execution

Database changes

No response

External dependencies

No response

Originally created by @PieterL75 on GitHub (Aug 1, 2022). ### NetBox version v3.2.7 ### Feature type Change to existing functionality ### Proposed functionality Create a new input variable that works as a password field and hides then inputted characters. ### Use case In some cases, I have to enter a password that is provided to the script. Currently the password is shown in cleartext on the screen. An asterix-box would help to mask the password. Obviously, the handing of the password in the script is all cleartext and up to the script maintainer to keep it save during the script execution ### Database changes _No response_ ### External dependencies _No response_
adam added the type: featurestatus: under review labels 2025-12-29 19:44:58 +01:00
adam closed this issue 2025-12-29 19:44:58 +01:00
Author
Owner

@jeremystretch commented on GitHub (Aug 1, 2022):

What about displaying the value of the field? Presumably you wouldn't want to show it in the UI. The old secrets app had a widget to unmask the value with a button, maybe that would work?

@jeremystretch commented on GitHub (Aug 1, 2022): What about displaying the value of the field? Presumably you wouldn't want to show it in the UI. The old secrets app had a widget to unmask the value with a button, maybe that would work?
Author
Owner

@PieterL75 commented on GitHub (Aug 1, 2022):

The only usecase I see to display the password, is when entering it, to verify that it is correct.
Then that unmask button seems a good addition, indeed.

@PieterL75 commented on GitHub (Aug 1, 2022): The only usecase I see to display the password, is when entering it, to verify that it is correct. Then that unmask button seems a good addition, indeed.
Author
Owner

@tom0010 commented on GitHub (Aug 3, 2022):

Is this not the same thing?

https://github.com/netbox-community/netbox/discussions/6406

@tom0010 commented on GitHub (Aug 3, 2022): Is this not the same thing? https://github.com/netbox-community/netbox/discussions/6406
Author
Owner

@jeremystretch commented on GitHub (Aug 3, 2022):

Apologies, I was thinking custom fields when I added my earlier reply. For scripts, yes, it should be sufficient to override the input widget.

@jeremystretch commented on GitHub (Aug 3, 2022): Apologies, I was thinking custom fields when I added my earlier reply. For scripts, yes, it should be sufficient to override the input widget.
Author
Owner

@PieterL75 commented on GitHub (Aug 4, 2022):

Yep, that worked just fine

from django.forms import PasswordInput
password = StringVar(widget=PasswordInput)
@PieterL75 commented on GitHub (Aug 4, 2022): Yep, that worked just fine ``` from django.forms import PasswordInput password = StringVar(widget=PasswordInput) ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6751