You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently if a request fails variable validation via renderVariableRequiredNotProvidedError or renderVariableInvalidObjectTypeError the entire variable content is dumped onto the message which then makes it's way onto telemetry as statusMessage regardless of any compliance settings.
This is less then ideal from a compliance perspective because there may be sensitive information leaked that we have no reason to believe is malformed. It makes the complexity of adhering to PII regulations such as PCI more challenging.
A simple solution would be to simply remove the variable content from the message. I would be more then happy to make this change and update relevant tests if y'all believe this is worthwhile.
I see there is also already a secondary mechanism on Cosmo by which you could add export variables as trace attributes (TRACING_EXPORT_GRAPHQL_VARIABLES) so I believe this change has very limited demerits.
Proposed change
func (v *variablesVisitor) renderVariableInvalidObjectTypeError(typeName []byte, variablesNode astjson.Node) {
out := &bytes.Buffer{}
err := v.variables.PrintNode(variablesNode, out)
if err != nil {
v.err = err
return
}
v.err = &InvalidVariableError{
Message: fmt.Sprintf(`Variable "$%s" got invalid value; Expected type "%s" to be an object.`, string(v.currentVariableName), string(typeName)),
}
}
func (v *variablesVisitor) renderVariableRequiredNotProvidedError(fieldName []byte, typeRef int) {
out := &bytes.Buffer{}
err := v.variables.PrintNode(v.variables.Nodes[v.currentVariableJsonNodeRef], out)
if err != nil {
v.err = err
return
}
out.Reset()
err = v.definition.PrintType(typeRef, out)
if err != nil {
v.err = err
return
}
v.err = &InvalidVariableError{
Message: fmt.Sprintf(`Variable "$%s" got invalid value; Field "%s" of required type "%s" was not provided.`, string(v.currentVariableName), string(fieldName), out.String()),
}
}
The text was updated successfully, but these errors were encountered:
RELATED cosmo-issues-1182
Currently if a request fails variable validation via
renderVariableRequiredNotProvidedError
orrenderVariableInvalidObjectTypeError
the entire variable content is dumped onto the message which then makes it's way onto telemetry as statusMessage regardless of any compliance settings.This is less then ideal from a compliance perspective because there may be sensitive information leaked that we have no reason to believe is malformed. It makes the complexity of adhering to PII regulations such as PCI more challenging.
A simple solution would be to simply remove the variable content from the message. I would be more then happy to make this change and update relevant tests if y'all believe this is worthwhile.
I see there is also already a secondary mechanism on Cosmo by which you could add export variables as trace attributes (TRACING_EXPORT_GRAPHQL_VARIABLES) so I believe this change has very limited demerits.
Proposed change
The text was updated successfully, but these errors were encountered: