-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Apply privateVariables to properties of custom input variables. #1498
Comments
@martijnwalraven @abernix Isn't that actually a pretty big security risk exposing secret data like this? |
Just realised today that my users' passwords are being sent to apollo engine because of that exactly 😨 I have Is there something available as of today to solve this? (couldn't find it) |
@Shahor Until this functionality is expanded the easiest thing to do is hotfix your server and make all variables private, if you haven't already. Then, if it is worth it to have variables in traces, you could change your API to accept passwords only as variables instead of properties on inputs so they can be made private. |
Hi @erikkrieg, @Shahor -- We just published a release of Apollo server (2.7.0-alpha.1) that includes a fix for this issue, using something along the lines of Suggestion C mentioned above: accepting a custom method for modifying variable values as input to an EngineReportingOption. We’ve included that functionality with a new option, Here’s an example custom function input to Also, we've changed the default reporting settings so that, unless specified, no variable values will be included in the traces. We’re still looking for feedback on this, so please let us know if you have any ideas on how we might be able to make this better! |
Feature suggestion
Expand the
privateVariables
functionality to omit properties of custom input variables in Optics traces. Currently variables can be hidden, but properties cannot be targeted specifically.Use case
Given the following mutation, we want to hide
input.password
from Optics, while still supporting a flexible mutation interface using inputs.UpdateUserInput schema:
Query:
Variables:
It is also possible that in the future we learn we need to start hiding
input.email
or another property in order to comply with some new regulations.Workarounds
Right now the workarounds we considered are:
For an issue we are encountering we are going with the first workaround, but are not very satisfied with any of the present options.
Interface suggestions
Suggestion A:
By default (or based on a flag) compare variables and their properties against the array of private variables. There are no variables named "password" in the
updateUser
mutation, but the "input" variable does have a "password" property, so omit it!Example:
Suggestion B:
Use an interface like Lodash's
get
method that can use a string to match a specific variable's properties. This is my personal favorite :PExample:
Suggestion C:
Accept a method to map over the variables and return the values that will be sent to Optics.
Example:
The text was updated successfully, but these errors were encountered: