Skip to content

MLE-34176 fix hard-coded credentials in examples - #149

Merged
RitaChen609 merged 3 commits into
developfrom
MLE-34176-fix-hard-coded-credentials
Nov 6, 2026
Merged

RitaChen609 merged 3 commits into
developfrom
MLE-34176-fix-hard-coded-credentials

Conversation

@RitaChen609

Copy link
Copy Markdown

Removed the hard-coded admin password and user password. Both are now read from environment variables, with a getpass prompt as the fallback.

Updated the stale 500-employees URL to the new location so that the test can run successfully.

Copilot AI balanced review requested due to automatic review settings November 5, 2026 14:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the notebook credential and sample-data URL updates.

No open issues 🎉

What changed in this PR

This PR removes hard-coded passwords from two MarkLogic example notebooks and updates their employee sample-data URLs.

Changes:

  • Read passwords from environment variables, with getpass prompts as fallbacks.
  • Reuse the configured credentials in the Spark example through separate connection options.
  • Update both notebooks to the relocated 500-employees.json file.
File Description
examples/​release-1.1-examples.ipynb Externalizes client and Spark credentials and updates the sample-data URL.
examples/​python-blog-post.ipynb Externalizes admin and example-user passwords and updates the sample-data URL.

Review effort: Balanced

@rjrudin rjrudin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I strongly recommend against spending time and money on these Polaris warnings about what are clearly examples. Requiring environment variables makes the examples harder to use and accomplishes nothing from a security perspective.

@rjrudin

rjrudin commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Note as well that the password is in plaintext at https://github.com/marklogic/marklogic-python-client/blob/master/test-app/src/main/ml-config/security/users/python-docs-user.json . That's in a folder called "test-app".

@RitaChen609

Copy link
Copy Markdown
Author

python-docs-user.json

Yes, we have agreed on not spending time to fix the hard-coded credentials used for testing.

@RitaChen609
RitaChen609 merged commit 805020c into develop Nov 6, 2026
4 checks passed
@RitaChen609
RitaChen609 deleted the MLE-34176-fix-hard-coded-credentials branch November 6, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants