You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "hdygxsj (via GitHub)" <gi...@apache.org> on 2025/08/07 13:17:30 UTC
[PR] []bug(authz): Fix NPE when create table failed by not auth [gravitino]
hdygxsj opened a new pull request, #7971:
URL: https://github.com/apache/gravitino/pull/7971
### What changes were proposed in this pull request?
Fix NPE when create table failed by not auth
### Why are the changes needed?
Fix: #(issue)
### Does this PR introduce _any_ user-facing change?
None
### How was this patch tested?
--
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.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7972] fix(authz): Fix NPE when create table failed by not auth [gravitino]
Posted by "hdygxsj (via GitHub)" <gi...@apache.org>.
hdygxsj commented on code in PR #7971:
URL: https://github.com/apache/gravitino/pull/7971#discussion_r2261866118
##########
clients/client-java/src/main/java/org/apache/gravitino/client/HTTPClient.java:
##########
@@ -233,7 +233,9 @@ private void throwFailure(
}
errorHandler.accept(errorResponse);
-
+ if (response.getCode() == 403) {
Review Comment:
fixed
--
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.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7972] fix(authz): Fix NPE when create table failed by not auth [gravitino]
Posted by "hdygxsj (via GitHub)" <gi...@apache.org>.
hdygxsj commented on code in PR #7971:
URL: https://github.com/apache/gravitino/pull/7971#discussion_r2265850603
##########
clients/client-java/src/main/java/org/apache/gravitino/client/ErrorHandlers.java:
##########
@@ -1085,6 +1085,9 @@ public ErrorResponse parseResponse(int code, String json, ObjectMapper mapper) {
@Override
public void accept(ErrorResponse errorResponse) {
+ if (errorResponse.getCode() == ErrorConstants.FORBIDDEN_CODE) {
Review Comment:
We need to convert 403 into a specific Exception instead of using RuntimeException, otherwise, throwing exceptions due to non-403 errors might cause the IT to fail to achieve the expected results.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7972] fix(authz): Fix NPE when create table failed by not auth [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #7971:
URL: https://github.com/apache/gravitino/pull/7971#discussion_r2265881610
##########
clients/client-java/src/main/java/org/apache/gravitino/client/ErrorHandlers.java:
##########
@@ -1085,6 +1085,9 @@ public ErrorResponse parseResponse(int code, String json, ObjectMapper mapper) {
@Override
public void accept(ErrorResponse errorResponse) {
+ if (errorResponse.getCode() == ErrorConstants.FORBIDDEN_CODE) {
Review Comment:
Client handler doesn't need to format the error message. Sorry, I don't have other comments.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7972]bug(authz): Fix NPE when create table failed by not auth [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #7971:
URL: https://github.com/apache/gravitino/pull/7971#discussion_r2261856790
##########
clients/client-java/src/main/java/org/apache/gravitino/client/HTTPClient.java:
##########
@@ -233,7 +233,9 @@ private void throwFailure(
}
errorHandler.accept(errorResponse);
-
+ if (response.getCode() == 403) {
Review Comment:
You should add this to client `ErrorHandlers`.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7972] fix(authz): Fix NPE when create table failed by not auth [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi merged PR #7971:
URL: https://github.com/apache/gravitino/pull/7971
--
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.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7972] fix(authz): Fix NPE when create table failed by not auth [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #7971:
URL: https://github.com/apache/gravitino/pull/7971#discussion_r2265824463
##########
clients/client-java/src/main/java/org/apache/gravitino/client/ErrorHandlers.java:
##########
@@ -1085,6 +1085,9 @@ public ErrorResponse parseResponse(int code, String json, ObjectMapper mapper) {
@Override
public void accept(ErrorResponse errorResponse) {
+ if (errorResponse.getCode() == ErrorConstants.FORBIDDEN_CODE) {
Review Comment:
The error message may be formatted in every type Handler. Do we need formatted error message?
--
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.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7972] fix(authz): Fix NPE when create table failed by not auth [gravitino]
Posted by "hdygxsj (via GitHub)" <gi...@apache.org>.
hdygxsj commented on code in PR #7971:
URL: https://github.com/apache/gravitino/pull/7971#discussion_r2265850603
##########
clients/client-java/src/main/java/org/apache/gravitino/client/ErrorHandlers.java:
##########
@@ -1085,6 +1085,9 @@ public ErrorResponse parseResponse(int code, String json, ObjectMapper mapper) {
@Override
public void accept(ErrorResponse errorResponse) {
+ if (errorResponse.getCode() == ErrorConstants.FORBIDDEN_CODE) {
Review Comment:
I don't understand what you mean. What is a formatted error message?
We need to convert 403 into a specific Exception instead of using RuntimeException, otherwise, throwing exceptions due to non-403 errors might cause the IT to fail to achieve the expected results.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7972]bug(authz): Fix NPE when create table failed by not auth [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on PR #7971:
URL: https://github.com/apache/gravitino/pull/7971#issuecomment-3166371017
Could u add new test cases for this fix? Existing test cases can't cover it.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org