Groovy EasyForm Password field persists value
- Dominant language
- Jupyter Notebook
- Stars
- 2.9k
- Forks
- 383
- PR merge metrics
- No merged PRs in 30d
Description
I'm using EasyForm to collect username/password in a Notebook. But I don't want to save the password WITH the Notebook for security reasons.
My authentication cell looks like
```
storedPassword = ''
credsForm = new EasyForm("Credentials")
usernameField = credsForm.addTextField("Username", 10)
passwordField = credsForm.addPasswordField("Password", 10)
credsForm.addButton("Go!", tag="postCollectCreds")
credsForm
```
That will go to the ```postCollectCreds``` cell that looks like
```
if (passwordField.value) {
storedPassword = passwordField.value
passwordField.value = ''
}
// Do stuff that requires username (usernameField.value) and password (storedPassword)
```
My hope here is that while the notebook is open, it will remember the password across cells but won't save it (or export it). Visually, the EasyForm password field is blank after the second cell runs, but saving or exporting to .ipynb shows the password; the JSON for the passwordField field
```
"ae83f91f-8048-472b-9d2f-b774d5b30612": {
"model_module": "beakerx",
"model_module_version": "*",
"model_name": "PasswordModel",
"state": {
"background_color": null,
"color": null,
"description": "Password",
"font_family": "",
"font_size": "",
"font_style": "",
"font_weight": "",
"layout": "IPY_MODEL_6ed1e0ba-752e-426c-82ef-809e718f997c",
"msg_throttle": 3,
"placeholder": "",
"size": 10,
"value": "PASSWORD IS IN PLAIN TEXT HERE",
"visible": true
}
},
```
Questions:
1. Am I clearing the field incorrectly?
2. Is it felt that the Password field SHOULD be persisted as it is?
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the EasyForm flow using addPasswordField and the postCollectCreds cell, then inspect the exported .ipynb widget state after clearing passwordField.value. Determine how the password remains persisted and define done as keeping the password usable during the session while excluding it from notebook saves and exports; add a regression test for that behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- groovy, jupyter-notebook
- Domain
- security, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100