nevzheng commented on code in PR #13057:
URL: https://github.com/apache/gravitino/pull/13057#discussion_r3998049529
##########
server-common/src/main/java/org/apache/gravitino/server/web/JettyServerConfig.java:
##########
@@ -112,6 +112,17 @@ public final class JettyServerConfig {
.checkValue(value -> value > 0,
ConfigConstants.POSITIVE_NUMBER_ERROR_MSG)
.createWithDefault(128 * 1024);
+ public static final ConfigEntry<Boolean> INCLUDE_ERROR_STACK_TRACE =
+ new ConfigBuilder("includeErrorStackTrace")
+ .doc(
+ "Whether to include server-side stack traces in HTTP error
responses. Set this to "
+ + "false in new deployments because stack traces can expose
internal "
+ + "implementation details. It remains true by default only
to avoid breaking "
+ + "legacy clients that expect the stack field")
+ .version(ConfigConstants.VERSION_2_0_0)
+ .booleanConf()
Review Comment:
Fixed in
https://github.com/apache/gravitino/pull/13057/commits/e408edd0a945a721fd7a9b772b5cf312dca6cc12.
Iceberg REST and Lance REST now honor `includeErrorStackTrace` from their own
service config: `IcebergRESTUtils.errorResponse` adds the stack only when
enabled, and `LanceExceptionMapper.errorDetail` returns an empty `detail` when
disabled, used by every Lance mapping path including the authorization
interceptor. Lance exceptions that already carry their own `detail` keep it.
Each service sets the flag at startup, and the option is documented for both.
Covered by `TestIcebergRESTUtils#testErrorResponseStackTraceFollowsSetting`,
`TestLanceExceptionMapper#testErrorDetailFollowsSetting`,
`TestLanceMetadataAuthorizationMethodInterceptor#testForbiddenResponseOmitsStackTraceWhenDisabled`,
and a config-key test in each service.
On the default: per
https://github.com/apache/gravitino/pull/13057#discussion_r3976636024, it stays
`true` for compatibility.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]