Skip to content

fix: use runtime credentials in connection examples and diagnostics - #518

Merged
hossain-rayhan merged 1 commit into
documentdb:mainfrom
hossain-rayhan:rhossain/sync-safe-examples
Nov 19, 2026
Merged

hossain-rayhan merged 1 commit into
documentdb:mainfrom
hossain-rayhan:rhossain/sync-safe-examples

Conversation

@hossain-rayhan

Copy link
Copy Markdown
Collaborator

Summary

  • Replace embedded example credentials in connection, quickstart, failover, and sync-service documentation with password prompts, explicit placeholders, or environment-backed driver authentication.
  • Read the EKS playground diagnostic credentials from its existing Kubernetes Secret using secretKeyRef, rather than embedding them in the URI or pod arguments.
  • Authenticate explicitly with SCRAM-SHA-256 before reporting a successful diagnostic ping.

Hard-coded illustrative credentials are easy to copy into application code and can trigger credential scanners. Runtime credential lookup also keeps diagnostics working when the deployment's Secret changes.

Scope

  • Preserve existing connection/TLS options and application behavior.
  • Keep operator/core code, CRDs, and dynamic URI formatting/test fixtures unchanged.
  • Only the sync service's explanatory URI examples change; its runtime behavior is unchanged.
  • Add a regression test for emitted diagnostic pod configuration, credential metacharacters, and failed-authentication handling. Run it in the documentation workflow with an explicit Node.js version.

Validation

  • New diagnostic regression test and all nine existing documentation-checker tests pass.
  • The exact diagnostic JavaScript ran successfully against a network-isolated MongoDB 7 container using credentials containing reserved characters.
  • Bash syntax checks pass.
  • MkDocs build and candidate documentation-link checks pass.
  • Updated Node.js/Python examples parse; the extracted Go example builds and passes go vet with MongoDB Go driver v1.

No AWS resources were provisioned. The container check exercises mongosh authentication, not an EKS deployment.

Read driver credentials from the environment, prompt interactively in shell examples, and use the deployment Secret in EKS diagnostics. Preserve dynamic URI formatting and add focused diagnostic regression coverage.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 33b3cb3c-1b25-4ffb-bff1-ebf0f3d04058
Signed-off-by: Rayhan Hossain <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 19, 2026 17:41

Copilot AI 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.

🟢 Approval recommended

No active review issues were identified in the changes to remove embedded credentials and use runtime authentication for diagnostics.

No open issues 🎉

What changed in this PR

This PR removes embedded credentials from DocumentDB connection examples and makes EKS playground diagnostics use runtime credentials, while preserving existing connection and TLS options.

Changes:

  • Uses password prompts, explicit placeholders, and environment-backed driver authentication.
  • Loads diagnostic credentials from a Kubernetes Secret and authenticates with SCRAM-SHA-256 before pinging.
  • Adds diagnostic regression coverage to the documentation workflow with Node.js 22.
File Description
documentdb-playground/​sync_service/​sync.py Updates URI examples in the docstring only.
documentdb-playground/​sync_service/​README.md Uses credential placeholders and a prompted source password.
documentdb-playground/​multi-cloud-deployment/​README.md Replaces the example password with a prompt.
documentdb-playground/​contrib/​telemetry-and-cost-optimized-eks/​scripts/​test_create_cluster.py Tests Secret references, credential metacharacters, and failed authentication.
documentdb-playground/​contrib/​telemetry-and-cost-optimized-eks/​scripts/​create-cluster.sh Uses Secret-backed diagnostic authentication and removes passwords from connection guidance.
documentdb-playground/​aks-setup/​README.md Makes connection-string placeholders explicit.
docs/​operator-public-documentation/​v1/​multi-region-deployment/​failover-procedures.md Uses password prompts in failover validation commands.
docs/​operator-public-documentation/​v1/​index.md Replaces embedded connection passwords with prompts.
docs/​operator-public-documentation/​v1/​getting-started/​quickstart-kind.md Uses a password prompt and clarifies credential guidance.
docs/​operator-public-documentation/​v1/​getting-started/​quickstart-k3s.md Uses password prompts for local and external connections.
docs/​operator-public-documentation/​v1/​getting-started/​connecting-to-documentdb.md Updates shell examples and supplies driver credentials through environment variables.
.github/​workflows/​test-docs.yml Runs diagnostic tests with Node.js 22 and expands path triggers.

Review effort: Balanced

@hossain-rayhan
hossain-rayhan merged commit 0ce25ac into documentdb:main Nov 19, 2026
2 checks passed
hossain-rayhan added a commit to hossain-rayhan/documentdb-kubernetes-operator that referenced this pull request Nov 19, 2026
…elease-strategy.md per release

- CHANGELOG: list documentdb#518 under 1.2.0. It merged just before the release
  commit and shipped in 1.2.0 but had no entry.
- Release agent: release-strategy.md is a policy/design document, not a
  per-release compatibility matrix, so drop it from the files a release
  updates and exclude docs/designs from the leftover-version grep. The
  before-you-start.md version-compatibility table remains the
  per-release record.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 9f1a71b4-9969-4456-9f65-8d19dd550d8e
Signed-off-by: Rayhan Hossain <[email protected]>
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.

4 participants