feat(jdbc): enforce strict JDBC URL parsing and sync `DataSource` properties by keshavdandeva · Pull Request #4107 · googleapis/java-bigquery · GitHub
Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

feat(jdbc): enforce strict JDBC URL parsing and sync DataSource properties#4107

Merged
keshavdandeva merged 13 commits into
mainfrom
jdbc/feat-strict-url-parse-and-sync-dataSource
Feb 25, 2026
Merged

feat(jdbc): enforce strict JDBC URL parsing and sync DataSource properties#4107
keshavdandeva merged 13 commits into
mainfrom
jdbc/feat-strict-url-parse-and-sync-dataSource

Conversation

@keshavdandeva

Copy link
Copy Markdown
Contributor

b/429272203

This PR refactors the JDBC connection string parsing logic to be stricter and more robust, preventing silent failures due to typos. It also synchronizes DataSource properties with BigQueryConnection to ensure full feature parity.

@product-auto-label product-auto-label Bot added size: l Pull request size is large. api: bigquery Issues related to the googleapis/java-bigquery API. labels Feb 17, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request enhances the robustness of JDBC URL parsing through stricter validation, refactored logic, and synchronization of DataSource properties. However, the new parsing logic introduces a connection string injection vulnerability due to unescaped delimiters in property values and insufficient validation for sensitive properties like LogPath. This flaw could enable path traversal or the overriding of security-sensitive connection settings. It is recommended to implement proper escaping for property values and add validation for security-critical properties during URL parsing.

@keshavdandeva

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request significantly improves the JDBC driver's connection string parsing by introducing stricter validation for property names, preventing silent failures, and correctly URL-encoding property values. It also synchronizes DataSource properties with BigQueryConnection for enhanced feature parity. However, a potential information exposure vulnerability exists: the parseUrl method could leak sensitive data in SQLException messages if a secret is accidentally provided as a property key, as the raw key is included in error messages. Additionally, there is a minor suggestion to reduce code duplication.

@keshavdandeva keshavdandeva marked this pull request as ready for review February 18, 2026 13:42
@keshavdandeva keshavdandeva requested a review from a team February 18, 2026 13:42
@keshavdandeva keshavdandeva requested a review from a team as a code owner February 18, 2026 13:42

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.

hm, ok. No need to change it in this PR, but I think we should get rid of parseStringProperty handling default values. We already have defaultValue() available in various property maps (e.g. link)

I don't see a lot of benefit in using map to map upper-to-camel case.. We can just normalize keys and always use upper case instead.

@keshavdandeva keshavdandeva merged commit 0b0c1ce into main Feb 25, 2026
26 checks passed
@keshavdandeva keshavdandeva deleted the jdbc/feat-strict-url-parse-and-sync-dataSource branch February 25, 2026 15:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: bigquery Issues related to the googleapis/java-bigquery API. size: l Pull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants