Skip to content

Conversation

@TristanSpeakEasy
Copy link
Member

No description provided.

@linear
Copy link

linear bot commented Oct 31, 2022

SPE-349 [SDK] Implement masking in Java sdk

  • Some facsimile of the following should be implemented.
controller.maskRequestHeader([]string{"Authorization"}, "[masked]"); // or response header; key/value
controller.maskRequestCookie(""); // or response cookie; key/value
controller.maskRequestBodyRegex("", ""); // or response body; regex
controller.maskQueryString("", "", ""); // key/value
  • The sdk should record which fields were masked for later use in the UI.
  • The sdk should mask in a type-safe manner (numbers for numbers, strings for strings; no bools & no arrays or objects)

Copy link

@alexadrake alexadrake left a comment

Choose a reason for hiding this comment

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

Looks good to me

private Map<String, String> requestBodyMasksNumber = new HashMap<>();
private Map<String, String> responseBodyMasksNumber = new HashMap<>();

public static class Builder {

Choose a reason for hiding this comment

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

why is this static?

Copy link
Member Author

Choose a reason for hiding this comment

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

was actually based on a blog post I was reading about the builder pattern and they had it as static, I blindly followed tbh I will look if there is any impact to changing this

Copy link
Member Author

Choose a reason for hiding this comment

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

ah figured it out, as I instantiate it with a static method that is why

@TristanSpeakEasy TristanSpeakEasy merged commit ccc85ab into main Oct 31, 2022
@TristanSpeakEasy TristanSpeakEasy deleted the feature/spe-349 branch October 31, 2022 15:24
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.

3 participants