Skip to content
This repository has been archived by the owner on Feb 13, 2025. It is now read-only.

Parse Dsn URL to handle user/password masking #452

Merged
merged 2 commits into from
May 20, 2024

Conversation

vicmarbev
Copy link
Contributor

Description

Parse Dsn URL before trying to connect to be avoid printing user/password. When trying to connect via a malformed Dsn URL, the exporter logs something like this:
caller=collector.go:263 level=error errorpingingoracle:="parse \"oracle://user:password@\\oracleserver.com:1556/sdfef\": net/url: invalid control character in URL"
As this is treated as a generic error, the maskDsn function is not used.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

A test has been added

Screenshots (if appropriate):

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • Updated version in Makefile respecting semver v2

@Yannig Yannig merged commit 719a0ad into iamseth:master May 20, 2024
4 of 5 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants