Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Secrets are not found in Jupyter Notebooks #781

Closed
1 of 2 tasks
mosc9575 opened this issue Jan 2, 2024 · 1 comment
Closed
1 of 2 tasks

Secrets are not found in Jupyter Notebooks #781

mosc9575 opened this issue Jan 2, 2024 · 1 comment
Labels
duplicate The issue has already already been reported.

Comments

@mosc9575
Copy link

mosc9575 commented Jan 2, 2024

  • I'm submitting a ...

    • bug report
    • feature request
  • What is the current behavior?

If I open an new Jupyter Notebook (in JupyterLab 4.0.9) and write in the first cell

def my_very_secret_function(my_password = "bar"):
    pass

see secret is not found while using detect secrets as a pre-commit hook.

This is because the cell has the following form in the saved file.

  {
   "cell_type": "code",
   "execution_count": null,
   "id": "aa11ab85-ce4e-4803-92c9-0f48e2ce4c52",
   "metadata": {},
   "outputs": [],
   "source": [
    "def my_very_secret_function(my_password = \"bar\"):\n",
    "    pass"
   ]
  }

As you can see there is a backslash \ before the quotation mark ". I think because of this no regular expressions matches the secret.

  • What is the expected behavior?
    I expect that detect_secrets finds secrets in pure python and jupyter notebooks.
  • Technical information

Detect secrets version : 1.4.0
Python version : 3.10.13 | packaged by conda-forge | (main, Oct 26 2023, 18:07:37) [GCC 12.3.0]
IPython version : 8.14.0
Tornado version : 6.3.3
Operating system : Linux-4.19.0-21-amd64-x86_64-with-glibc2.35
JupyterLab version : 4.0.9

@lorenzodb1 lorenzodb1 added the duplicate The issue has already already been reported. label May 16, 2024
@lorenzodb1
Copy link
Contributor

Closing as duplicate of #780.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate The issue has already already been reported.
Projects
None yet
Development

No branches or pull requests

2 participants