-
Notifications
You must be signed in to change notification settings - Fork 820
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
Feature/urlparser improve3 pr2 #2646
base: master
Are you sure you want to change the base?
Conversation
|
GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
---|---|---|---|---|---|
- | PostgreSQL Credentials | ab4e427 | pgjdbc/src/test/java/org/postgresql/jdbcurlresolver/JdbcUrlResolverTest.java | View secret | |
- | Generic Password | ab4e427 | pgjdbc/src/test/java/org/postgresql/jdbcurlresolver/JdbcUrlResolverTest.java | View secret | |
- | Generic Password | ab4e427 | pgjdbc/src/test/java/org/postgresql/jdbcurlresolver/JdbcUrlResolverTest.java | View secret | |
- | PostgreSQL Credentials | ab4e427 | pgjdbc/src/test/java/org/postgresql/jdbcurlresolver/JdbcUrlResolverTest.java | View secret | |
- | Generic Password | ab4e427 | pgjdbc/src/test/resources/pg_service/pgservicefileProps.conf | View secret | |
- | Generic Password | ab4e427 | pgjdbc/src/test/java/org/postgresql/jdbcurlresolver/JdbcUrlResolverTest.java | View secret | |
- | Generic Database Assignment | ab4e427 | pgjdbc/src/test/java/org/postgresql/jdbcurlresolver/JdbcUrlResolverTest.java | View secret | |
- | Generic Password | ab4e427 | pgjdbc/src/test/resources/pg_service/pgservicefileProps.conf | View secret | |
- | Generic Password | ab4e427 | pgjdbc/src/test/java/org/postgresql/jdbcurlresolver/JdbcUrlResolverTest.java | View secret | |
- | Generic Password | ab4e427 | pgjdbc/src/test/java/org/postgresql/jdbcurlresolver/JdbcUrlResolverTest.java | View secret | |
- | Generic Password | ab4e427 | pgjdbc/src/test/java/org/postgresql/jdbcurlresolver/JdbcUrlResolverTest.java | View secret | |
- | Generic Password | ab4e427 | pgjdbc/src/test/java/org/postgresql/jdbcurlresolver/JdbcUrlResolverTest.java | View secret | |
- | Generic Password | ab4e427 | pgjdbc/src/test/java/org/postgresql/jdbcurlresolver/JdbcUrlResolverTest.java | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
@davecramer |
@MarekUniq currently my plans are 1) merge in the issue with longs #2710 will be reopened and merged. A release with this fix will be released. I would hold off rebasing until after the above happens. Thanks for your patience |
@davecramer |
@davecramer Hi! What are merge plans? |
Is there any progress on merging this? |
I'm generally in favour of this PR. It will need to be rebased. |
|
@MarekUniq , the change reads |
@vlsi - I agree that GitHub displayed this PR in a strange way. I saw it too. (was it a glitch or my mistake, I do not know) But I noticed there were 5 new commits in |
@MarekUniq , please rebase commits so they appear "on top of the master branch". The project uses linear history rather than merge commits. |
pgjdbc/src/main/java/org/postgresql/jdbcurlresolver/PgPassParser.java
Outdated
Show resolved
Hide resolved
The key question I have here is how do we test and ensure backward compatibility? |
@vlsi I think I can't change the order of commits anymore. |
What do you mean by "can't change the order of commits"? Could you please squash at your side? |
24c5eba
to
464f9b9
Compare
@vlsi Is this the result you were expecting? I did the following:
|
464f9b9
to
a611da6
Compare
@@ -47,7 +127,7 @@ public enum PGEnvironment { | |||
*/ | |||
PGSERVICEFILE( | |||
"PGSERVICEFILE", | |||
"pg_service.conf", | |||
null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a backward compatible change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no one constant default value for given parameter.
The default value is operating system specific.
Yes, functionality is backward compatible (the same).
Can you recommend proper approach?
This enum is not meant to be used outside pgjdbc driver.
There should not be any promises assumed regarding this enum outside pgjdbc driver.
At the same time I can not remove keyword public
.
How could we avoid "backward compatible" questions which are relevant only because of technical restrictions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This enum is not meant to be used outside pgjdbc driver.
The enum is public, it is located in a public org.postgresql
package, nothing in its javadoc says anything regarding "for pgjdbc internal use only" and so on.
There might be usages of the enum outside of the driver.
How could we avoid "backward compatible" questions which are relevant only because of technical restrictions?
I do not understand the question.
I think the only case we can merge a PR is if the PR keeps full backward compatibility or if the breakage is minimal.
If there's a significant breakage of the backward compatibility, there's very little we can do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The enum is public, it is located in a public org.postgresql package, nothing in its javadoc says anything regarding "for pgjdbc internal use only" and so on.
There might be usages of the enum outside of the driver.
Exactly, this was the point of my question.
There is an enum. It is meant to be used only internally by pgjdbc project.
But, I have to make enum public
because it is used by different packages inside pgjdbc project (technical/language limitation)
Javadoc etc is soft restriction, public enum can still be used.
I was wondering if there was an approach to the problem described above. How should we create classes/enums that are used by different packages in the pgjdbc project internally, but when renaming/moving/deleting them, the issue of "backward compatibility" is irrelevant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... is if the PR keeps full backward compatibility or if the breakage is minimal.
In my estimation, the real impact is close to zero.
The old value is incorrect and there is no common constant default value for this parameter across all operating systems.
If someone has adopted this default value and has tested their system, they must have realized that this value is wrong
adc3c6a
to
e9676f2
Compare
1. Compatibility with libpq is improved regarding URL syntax and resolving url values
1.1.
user
andpassword
are supportedComplete syntax:
jdbc:postgresql://[[user][:password]@][host1[:port1][,host2[:port2]][,...]][/database][?property1=value1[&property2=value2][&...]]
URL may include:
user
(Optional) is the user to connect. Defaults to operating system username.password
(Optional) is the password to connect. No default value.1.2. property
passfile
is supportedExample:
1.3. Code is more clear regarding Properties override rules (source and result are logged at FINE logging level)
There are multiple sources for connection properties. If same property is specified in multiple sources then highest priority source is used. Priority list is here:
1.4. References
Related to: #2260 #2278 #2398 #2393 #2395 #2424 #2569 #2641 #2644
All Submissions:
New Feature Submissions:
./gradlew autostyleCheck checkstyleAll
pass ?Changes to Existing Features: