You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/08/26 05:21:44 UTC
[GitHub] [shardingsphere] sandynz opened a new pull request #7076: Fix PostgreSQL authentication NullPointerException
sandynz opened a new pull request #7076:
URL: https://github.com/apache/shardingsphere/pull/7076
Changes proposed in this pull request:
- Fix PostgreSQL authentication NullPointerException (currentAuthResult not assigned)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] tuohai666 merged pull request #7076: Fix PostgreSQL authentication NullPointerException
Posted by GitBox <gi...@apache.org>.
tuohai666 merged pull request #7076:
URL: https://github.com/apache/shardingsphere/pull/7076
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] sandynz commented on a change in pull request #7076: Fix PostgreSQL authentication NullPointerException
Posted by GitBox <gi...@apache.org>.
sandynz commented on a change in pull request #7076:
URL: https://github.com/apache/shardingsphere/pull/7076#discussion_r478832893
##########
File path: shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/auth/PostgreSQLAuthenticationEngine.java
##########
@@ -91,7 +91,8 @@ public AuthenticationResult auth(final ChannelHandlerContext context, final Pack
}
md5Salt = PostgreSQLRandomGenerator.getInstance().generateRandomBytes(4);
context.writeAndFlush(new PostgreSQLAuthenticationMD5PasswordPacket(md5Salt));
- return AuthenticationResult.continued(username, databaseName);
+ currentAuthResult = AuthenticationResult.continued(username, databaseName);
Review comment:
Probably not, it's latest code after refactoring.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] tuohai666 commented on a change in pull request #7076: Fix PostgreSQL authentication NullPointerException
Posted by GitBox <gi...@apache.org>.
tuohai666 commented on a change in pull request #7076:
URL: https://github.com/apache/shardingsphere/pull/7076#discussion_r478819119
##########
File path: shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/auth/PostgreSQLAuthenticationHandler.java
##########
@@ -66,7 +66,7 @@ public static PostgreSQLLoginResult loginWithMd5Password(final String username,
return new PostgreSQLLoginResult(PostgreSQLErrorCode.SUCCESSFUL_COMPLETION, null);
}
- private static String md5Encode(final String username, final String password, final byte[] md5Salt) {
+ static String md5Encode(final String username, final String password, final byte[] md5Salt) {
Review comment:
why remove private?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] coveralls edited a comment on pull request #7076: Fix PostgreSQL authentication NullPointerException
Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #7076:
URL: https://github.com/apache/shardingsphere/pull/7076#issuecomment-680672156
## Pull Request Test Coverage Report for [Build 14160](https://coveralls.io/builds/33031375)
* **2** of **3** **(66.67%)** changed or added relevant lines in **2** files are covered.
* **127** unchanged lines in **14** files lost coverage.
* Overall coverage decreased (**-0.1%**) to **35.497%**
---
| Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
| :-----|--------------|--------|---: |
| [shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/handshake/PostgreSQLComStartupPacket.java](https://coveralls.io/builds/33031375/source?filename=shardingsphere-db-protocol%2Fshardingsphere-db-protocol-postgresql%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fdb%2Fprotocol%2Fpostgresql%2Fpacket%2Fhandshake%2FPostgreSQLComStartupPacket.java#L39) | 0 | 1 | 0.0%
<!-- | **Total:** | **2** | **3** | **66.67%** | -->
| Files with Coverage Reduction | New Missed Lines | % |
| :-----|--------------|--: |
| [shardingsphere-infra/shardingsphere-infra-executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/group/AbstractExecuteGroupEngine.java](https://coveralls.io/builds/33031375/source?filename=shardingsphere-infra%2Fshardingsphere-infra-executor%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Finfra%2Fexecutor%2Fsql%2Fgroup%2FAbstractExecuteGroupEngine.java#L80) | 1 | 90.91% |
| [shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-namespace/src/main/java/org/apache/shardingsphere/spring/namespace/orchestration/parser/DataSourceBeanDefinitionParser.java](https://coveralls.io/builds/33031375/source?filename=shardingsphere-jdbc%2Fshardingsphere-jdbc-spring%2Fshardingsphere-jdbc-orchestration-spring%2Fshardingsphere-jdbc-orchestration-spring-namespace%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fspring%2Fnamespace%2Forchestration%2Fparser%2FDataSourceBeanDefinitionParser.java#L51) | 2 | 89.47% |
| [shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/java/org/apache/shardingsphere/proxy/Bootstrap.java](https://coveralls.io/builds/33031375/source?filename=shardingsphere-proxy%2Fshardingsphere-proxy-bootstrap%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fproxy%2FBootstrap.java#L108) | 2 | 0% |
| [shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-schema/src/main/java/org/apache/shardingsphere/orchestration/core/schema/OrchestrationSchemaContexts.java](https://coveralls.io/builds/33031375/source?filename=shardingsphere-control-panel%2Fshardingsphere-orchestration%2Fshardingsphere-orchestration-core%2Fshardingsphere-orchestration-core-schema%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Forchestration%2Fcore%2Fschema%2FOrchestrationSchemaContexts.java#L114) | 4 | 96.97% |
| [shardingsphere-control-panel/shardingsphere-orchestration/shardingsphere-orchestration-core/shardingsphere-orchestration-core-config/src/main/java/org/apache/shardingsphere/orchestration/core/config/ConfigCenter.java](https://coveralls.io/builds/33031375/source?filename=shardingsphere-control-panel%2Fshardingsphere-orchestration%2Fshardingsphere-orchestration-core%2Fshardingsphere-orchestration-core-config%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Forchestration%2Fcore%2Fconfig%2FConfigCenter.java#L134) | 6 | 89.42% |
| [shardingsphere-jdbc/shardingsphere-jdbc-orchestration/src/main/java/org/apache/shardingsphere/driver/orchestration/api/yaml/YamlOrchestrationShardingSphereDataSourceFactory.java](https://coveralls.io/builds/33031375/source?filename=shardingsphere-jdbc%2Fshardingsphere-jdbc-orchestration%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fdriver%2Forchestration%2Fapi%2Fyaml%2FYamlOrchestrationShardingSphereDataSourceFactory.java#L121) | 6 | 80.0% |
| [shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-orchestration-spring/shardingsphere-jdbc-orchestration-spring-boot-starter/src/main/java/org/apache/shardingsphere/spring/boot/orchestration/OrchestrationSpringBootConfiguration.java](https://coveralls.io/builds/33031375/source?filename=shardingsphere-jdbc%2Fshardingsphere-jdbc-spring%2Fshardingsphere-jdbc-orchestration-spring%2Fshardingsphere-jdbc-orchestration-spring-boot-starter%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fspring%2Fboot%2Forchestration%2FOrchestrationSpringBootConfiguration.java#L84) | 6 | 66.67% |
| [shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/wrapper/PreparedStatementExecutorWrapper.java](https://coveralls.io/builds/33031375/source?filename=shardingsphere-proxy%2Fshardingsphere-proxy-backend%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fproxy%2Fbackend%2Fcommunication%2Fjdbc%2Fwrapper%2FPreparedStatementExecutorWrapper.java#L64) | 6 | 6.67% |
| [shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/wrapper/StatementExecutorWrapper.java](https://coveralls.io/builds/33031375/source?filename=shardingsphere-proxy%2Fshardingsphere-proxy-backend%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fproxy%2Fbackend%2Fcommunication%2Fjdbc%2Fwrapper%2FStatementExecutorWrapper.java#L47) | 8 | 33.33% |
| [shardingsphere-jdbc/shardingsphere-jdbc-orchestration/src/main/java/org/apache/shardingsphere/driver/orchestration/api/OrchestrationShardingSphereDataSourceFactory.java](https://coveralls.io/builds/33031375/source?filename=shardingsphere-jdbc%2Fshardingsphere-jdbc-orchestration%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fdriver%2Forchestration%2Fapi%2FOrchestrationShardingSphereDataSourceFactory.java#L54) | 11 | 0% |
<!-- | **Total:** | **127** | | -->
| Totals | [](https://coveralls.io/builds/33031375) |
| :-- | --: |
| Change from base [Build 14138](https://coveralls.io/builds/33004779): | -0.1% |
| Covered Lines: | 35574 |
| Relevant Lines: | 100216 |
---
##### 💛 - [Coveralls](https://coveralls.io)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] coveralls edited a comment on pull request #7076: Fix PostgreSQL authentication NullPointerException
Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #7076:
URL: https://github.com/apache/shardingsphere/pull/7076#issuecomment-680672156
## Pull Request Test Coverage Report for [Build 14208](https://coveralls.io/builds/33065881)
* **2** of **2** **(100.0%)** changed or added relevant lines in **1** file are covered.
* No unchanged relevant lines lost coverage.
* Overall coverage increased (+**0.07%**) to **35.397%**
---
| Totals | [](https://coveralls.io/builds/33065881) |
| :-- | --: |
| Change from base [Build 14207](https://coveralls.io/builds/33065258): | 0.07% |
| Covered Lines: | 35332 |
| Relevant Lines: | 99816 |
---
##### 💛 - [Coveralls](https://coveralls.io)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] sandynz commented on a change in pull request #7076: Fix PostgreSQL authentication NullPointerException
Posted by GitBox <gi...@apache.org>.
sandynz commented on a change in pull request #7076:
URL: https://github.com/apache/shardingsphere/pull/7076#discussion_r478831860
##########
File path: shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/handshake/PostgreSQLAuthenticationMD5PasswordPacket.java
##########
@@ -29,6 +29,7 @@
private static final int AUTH_REQ_MD5 = 5;
+ @Getter
Review comment:
It's called in `PostgreSQLAuthenticationEngineTest`, since `md5Salt` is generated random bytes in `PostgreSQLAuthenticationEngine`, test case will get this `md5Salt` to calculate `md5Digest` for login.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] tuohai666 commented on a change in pull request #7076: Fix PostgreSQL authentication NullPointerException
Posted by GitBox <gi...@apache.org>.
tuohai666 commented on a change in pull request #7076:
URL: https://github.com/apache/shardingsphere/pull/7076#discussion_r478811319
##########
File path: shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/auth/PostgreSQLAuthenticationEngine.java
##########
@@ -91,7 +91,8 @@ public AuthenticationResult auth(final ChannelHandlerContext context, final Pack
}
md5Salt = PostgreSQLRandomGenerator.getInstance().generateRandomBytes(4);
context.writeAndFlush(new PostgreSQLAuthenticationMD5PasswordPacket(md5Salt));
- return AuthenticationResult.continued(username, databaseName);
+ currentAuthResult = AuthenticationResult.continued(username, databaseName);
Review comment:
Can remove currentAuthResult?
##########
File path: shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/handshake/PostgreSQLAuthenticationMD5PasswordPacket.java
##########
@@ -29,6 +29,7 @@
private static final int AUTH_REQ_MD5 = 5;
+ @Getter
Review comment:
Where this member be called?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] sandynz commented on a change in pull request #7076: Fix PostgreSQL authentication NullPointerException
Posted by GitBox <gi...@apache.org>.
sandynz commented on a change in pull request #7076:
URL: https://github.com/apache/shardingsphere/pull/7076#discussion_r478832552
##########
File path: shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/auth/PostgreSQLAuthenticationHandler.java
##########
@@ -66,7 +66,7 @@ public static PostgreSQLLoginResult loginWithMd5Password(final String username,
return new PostgreSQLLoginResult(PostgreSQLErrorCode.SUCCESSFUL_COMPLETION, null);
}
- private static String md5Encode(final String username, final String password, final byte[] md5Salt) {
+ static String md5Encode(final String username, final String password, final byte[] md5Salt) {
Review comment:
It's called in `PostgreSQLAuthenticationEngineTest`, since `md5Salt` is generated random bytes in `PostgreSQLAuthenticationEngine`, test case will invoke `md5Encode` to calculate `md5Digest` for login.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] sandynz commented on a change in pull request #7076: Fix PostgreSQL authentication NullPointerException
Posted by GitBox <gi...@apache.org>.
sandynz commented on a change in pull request #7076:
URL: https://github.com/apache/shardingsphere/pull/7076#discussion_r478842866
##########
File path: shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/auth/PostgreSQLAuthenticationHandler.java
##########
@@ -66,7 +66,7 @@ public static PostgreSQLLoginResult loginWithMd5Password(final String username,
return new PostgreSQLLoginResult(PostgreSQLErrorCode.SUCCESSFUL_COMPLETION, null);
}
- private static String md5Encode(final String username, final String password, final byte[] md5Salt) {
+ static String md5Encode(final String username, final String password, final byte[] md5Salt) {
Review comment:
Test case will use Java reflection to get it, just like `MySQLAuthenticationEngineTest`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] sandynz commented on a change in pull request #7076: Fix PostgreSQL authentication NullPointerException
Posted by GitBox <gi...@apache.org>.
sandynz commented on a change in pull request #7076:
URL: https://github.com/apache/shardingsphere/pull/7076#discussion_r478842776
##########
File path: shardingsphere-db-protocol/shardingsphere-db-protocol-postgresql/src/main/java/org/apache/shardingsphere/db/protocol/postgresql/packet/handshake/PostgreSQLAuthenticationMD5PasswordPacket.java
##########
@@ -29,6 +29,7 @@
private static final int AUTH_REQ_MD5 = 5;
+ @Getter
Review comment:
Test case will use Java reflection to get it, just like `MySQLAuthenticationEngineTest`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] coveralls commented on pull request #7076: Fix PostgreSQL authentication NullPointerException
Posted by GitBox <gi...@apache.org>.
coveralls commented on pull request #7076:
URL: https://github.com/apache/shardingsphere/pull/7076#issuecomment-680672156
## Pull Request Test Coverage Report for [Build 14139](https://coveralls.io/builds/33006046)
* **0** of **2** **(0.0%)** changed or added relevant lines in **1** file are covered.
* No unchanged relevant lines lost coverage.
* Overall coverage decreased (**-0.0004%**) to **35.613%**
---
| Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
| :-----|--------------|--------|---: |
| [shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/auth/PostgreSQLAuthenticationEngine.java](https://coveralls.io/builds/33006046/source?filename=shardingsphere-proxy%2Fshardingsphere-proxy-frontend%2Fshardingsphere-proxy-frontend-postgresql%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fproxy%2Ffrontend%2Fpostgresql%2Fauth%2FPostgreSQLAuthenticationEngine.java#L94) | 0 | 2 | 0.0%
<!-- | **Total:** | **0** | **2** | **0.0%** | -->
| Totals | [](https://coveralls.io/builds/33006046) |
| :-- | --: |
| Change from base [Build 14138](https://coveralls.io/builds/33004779): | -0.0004% |
| Covered Lines: | 35822 |
| Relevant Lines: | 100586 |
---
##### 💛 - [Coveralls](https://coveralls.io)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org