Skip to content
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

Hide internal errors from responses to client #5917

Merged
merged 11 commits into from
May 22, 2024

Conversation

ychebotarev
Copy link
Contributor

@ychebotarev ychebotarev commented May 13, 2024

What changed?

Add an interceptor for frontend service.
Interceptor will looks at error messages and replace unknown/internal messages to a common message

Why?

We are exposing/can expose to much of the internal details/customer info in errors.
Instead external error will be a simple message, and real error will be logged.

How did you test it?

Add unit test. Build/run tests

Potential risks

N/A

Documentation

N/A

Is hotfix candidate?

No

common/dynamicconfig/constants.go Outdated Show resolved Hide resolved
common/rpc/grpc.go Outdated Show resolved Hide resolved
common/rpc/grpc.go Outdated Show resolved Hide resolved
common/dynamicconfig/constants.go Outdated Show resolved Hide resolved
common/rpc/grpc.go Outdated Show resolved Hide resolved
common/rpc/grpc.go Outdated Show resolved Hide resolved
common/rpc/grpc.go Outdated Show resolved Hide resolved
common/rpc/grpc.go Outdated Show resolved Hide resolved
common/rpc/grpc.go Outdated Show resolved Hide resolved
common/rpc/grpc.go Outdated Show resolved Hide resolved
service/frontend/fx.go Outdated Show resolved Hide resolved
common/dynamicconfig/constants.go Outdated Show resolved Hide resolved
common/rpc/grpc.go Outdated Show resolved Hide resolved
common/rpc/interceptor/telemetry.go Outdated Show resolved Hide resolved
@ychebotarev ychebotarev marked this pull request as ready for review May 15, 2024 18:13
@ychebotarev ychebotarev requested a review from a team as a code owner May 15, 2024 18:13
@ychebotarev ychebotarev requested a review from yiminc May 16, 2024 17:35
service/frontend/fx.go Outdated Show resolved Hide resolved
service/frontend/service.go Outdated Show resolved Hide resolved
common/rpc/grpc.go Outdated Show resolved Hide resolved
common/rpc/interceptor/mask_internal_error.go Outdated Show resolved Hide resolved
common/rpc/interceptor/mask_internal_error.go Outdated Show resolved Hide resolved
common/rpc/interceptor/mask_internal_error.go Outdated Show resolved Hide resolved
common/rpc/interceptor/mask_internal_error.go Outdated Show resolved Hide resolved
common/rpc/interceptor/mask_internal_error.go Outdated Show resolved Hide resolved
common/util.go Outdated Show resolved Hide resolved
common/util.go Outdated Show resolved Hide resolved
common/dynamicconfig/constants.go Outdated Show resolved Hide resolved
service/frontend/service.go Outdated Show resolved Hide resolved
common/rpc/grpc.go Outdated Show resolved Hide resolved
common/util.go Outdated Show resolved Hide resolved
Copy link
Member

@yiminc yiminc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm now

@ychebotarev ychebotarev merged commit 711f27a into temporalio:main May 22, 2024
42 checks passed
@ychebotarev ychebotarev deleted the y_replace_fe_errors branch May 22, 2024 16:21
ResourceExhaustedScopeHeader, reErr.Scope.String(),
))
if headerErr != nil {
logger.Error("Failed to add Resource-Exhausted headers to response", tag.Error(err))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be tag.Error(headerErr)? 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants