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

Hide GET params that contain senstive data from error output #47

Merged
merged 6 commits into from
Nov 4, 2024

Conversation

thedoubl3j
Copy link
Member

Currently, the AIM plugin is showing AppID, Object_Query and reason in the constructed URL when an error is throw and streamed back to stdout. This PR will hide those GET params from being displayed.

@thedoubl3j
Copy link
Member Author

just to note as well @webknjaz it looks like one of the linters that formats code added in a \ for a line break that then causes https://github.com/wemake-services/flake8-broken-line#error-codes to be thrown. Not sure which one but we might want to update it so we don't have one linter causing another one to error.

Copy link
Member

@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

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

just to note as well @webknjaz it looks like one of the linters that formats code added in a \ for a line break that then causes wemake-services/flake8-broken-line#error-codes to be thrown. Not sure which one but we might want to update it so we don't have one linter causing another one to error.

@thedoubl3j it's an inevitable consequence of the formatter (I'm assuming autopep8 made the change) being separate from the linters. It's also because the formatter uses one of the variants that are compliant with PEP 8 but that the rule disallows that specific variant. Trailing backslashes are dangerous, it's good to disallow them. If you use different compliant formatting, autopep8 won't change it. Perhaps, I'll check out Ruff at some point to see if it could be as non-invasive as autopep8, but I'm not sure.
Additionally, such cases cannot be fully avoided for as long as there's more than one linting/formatting tool integrated and must be addressed by a human.
Another side of this is whenever linting issues arise, they often alert you about the possibility to refactor. In the case you hit, for example, the line was complex. A formatter would make it formatted, but formatted and good are not equal things. These situations always require a human to think about whatever's the underlying issue that tripped the alert.

On another note, find some concrete suggestions below.

pyproject.toml Outdated Show resolved Hide resolved
src/awx_plugins/credentials/aim.py Outdated Show resolved Hide resolved
tests/credential_plugins_test.py Outdated Show resolved Hide resolved
@webknjaz
Copy link
Member

pre-commit.ci run

.pre-commit-config.yaml Outdated Show resolved Hide resolved
.pre-commit-config.yaml Outdated Show resolved Hide resolved
Copy link
Member

@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

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

Looks like there's a few things to correct.

tests/credential_plugins_test.py Outdated Show resolved Hide resolved
tests/credential_plugins_test.py Outdated Show resolved Hide resolved
tests/credential_plugins_test.py Outdated Show resolved Hide resolved
@webknjaz
Copy link
Member

webknjaz commented Nov 4, 2024

pre-commit.ci run

@thedoubl3j thedoubl3j force-pushed the aim_url_fix branch 3 times, most recently from b23e4de to abe40cb Compare November 4, 2024 19:21
@thedoubl3j thedoubl3j force-pushed the aim_url_fix branch 2 times, most recently from dfd5a22 to 01f58c8 Compare November 4, 2024 19:28
@webknjaz webknjaz merged commit cfcafa5 into ansible:devel Nov 4, 2024
30 of 34 checks passed
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