How do you mask sensitive request params in gqlgen?

How do you mask sensitive request params in gqlgen?


1

I am currently using gqlgen and would like to log request parameters for error investigation purposes.

While I know how to access request parameters like below, I am concerned that this way may log sensitive information such as email addresses or passwords.

srv.SetErrorPresenter(func(ctx context.Context, err error) *gqlerror.Error {
    goc := graphql.GetOperationContext(ctx)

    fmt.Println(goc.Variables) // i can access request params here, but these might include sensitive data

    gqlErr := graphql.DefaultErrorPresenter(ctx, err)
    return gqlErr
})

Therefore, I believe data masking is necessary.
What would be a good approach to handle this?


Load 3 more related questions


Show fewer related questions

0



Leave a Reply

Your email address will not be published. Required fields are marked *