Skip to content

Commit

Permalink
restrict to NASA organization
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Carlson committed Aug 21, 2024
1 parent 59047d8 commit 6ceafa9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/notebook-viewer/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ def convertNotebookToHtml():

# if we're including a github.com URL, we'll provide some additional links to the original github repo
if notebookUrl.startswith('https://github.com'):
# make sure we are only rendering notebooks from the nasa organization
if not notebookUrl.startswith('https://github.com/nasa/'):
return "Invalid notebook URL, must be in the NASA organization", 400

githubUrl = notebookUrl
notebookUrl = notebookUrl.replace(
"https://github.com", "https://raw.githubusercontent.com").replace("/blob/", "/")
Expand Down

0 comments on commit 6ceafa9

Please sign in to comment.