Skip to content

Glue: honour HidePassword on get_connection and get_connections - #10252

Open
chiruu12 wants to merge 1 commit into
getmoto:masterfrom
chiruu12:fix/glue-hide-password
Open

Glue: honour HidePassword on get_connection and get_connections#10252
chiruu12 wants to merge 1 commit into
getmoto:masterfrom
chiruu12:fix/glue-hide-password

Conversation

@chiruu12

@chiruu12 chiruu12 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Fixes #10251

HidePassword reached the backend and was then ignored, so asking for a connection without its secret returned the secret.

as_dict now takes the flag and drops the PASSWORD entry, which is what AWS does rather than blanking the value. Both copies are redacted: the top level ConnectionProperties and the nested Connection, which carries the same dict.

The redaction happens on the way out, so the stored connection keeps its password and a later call without the flag still returns it.

I also dropped hide_password from the two backend signatures. With the redaction in as_dict nothing in the backend reads it, and leaving a parameter that is never looked at is what caused this in the first place.

Four tests. Two fail on the parent commit; the other two pin that the default still returns the password and that hiding it does not change what is stored.

tests/test_glue/: 296 passed, with ruff format --check and mypy clean. ruff check reports 7 findings under moto/glue/; the same 7 are on master and none are in this change.

Copilot AI lite review requested due to automatic review settings September 8, 2026 03:43

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codecov

codecov Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.33%. Comparing base (289555e) to head (0f0275f).
⚠️ Report is 22 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10252      +/-   ##
==========================================
+ Coverage   93.32%   93.33%   +0.01%     
==========================================
  Files        1342     1342              
  Lines      122702   122925     +223     
==========================================
+ Hits       114508   114736     +228     
+ Misses       8194     8189       -5     
Flag Coverage Δ
servertests 27.91% <7.14%> (-0.03%) ⬇️
unittests 93.31% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

Glue: GetConnection and GetConnections ignore HidePassword

2 participants