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

feat(model): introduce ArchivalBinaryData #1321

Merged
merged 2 commits into from
Sep 28, 2023
Merged

feat(model): introduce ArchivalBinaryData #1321

merged 2 commits into from
Sep 28, 2023

Conversation

bassosimone
Copy link
Contributor

@bassosimone bassosimone commented Sep 28, 2023

There are cases where we know we have binary data in input and we want the output to be binary data using the dictionary encoding like {"format":"base64","data":"..."}.

Such cases are, for example, DNS messages bodies.

There is no need for us to pass through the MaybeArchivalBinaryData in such cases. Additionally, this makes MaybeArchivalBinaryData a bit more complex than it probably needs to be.

What's more, ArchivalBinaryData is for when you do not require to scrub the data. I want to introduce new data types that automatically perform scrubbing when they're used.

But this puts even more pressure on MaybeArchivalBinaryData, and hence this commit, to start differentiating between:

  1. always binary data vs maybe binary data

  2. no scrubbing required vs scrubbing required

The rationale for doing this set of changes has been explained in #1319.

The reference issue is ooni/probe#2531.

For now, this commit just adds the new type and tests for it without using the type, which we'll do later once we have added better marshal/unmarshal testing for the interested types.

There are cases where we know we have binary data in input and we
want the output to be binary data using the dictionary encoding like
`{"format":"base64","data":"..."}`.

Such cases are, for example, DNS messages bodies.

There is no need for us to pass through the MaybeArchivalBinaryData
in such cases. Additionally, this makes MaybeArchivalBinaryData a bit
more complex than it probably needs to be.

What's more, ArchivalBinaryData is for when you do not require to
scrub the data. I want to introduce new data types that automatically
perform scrubbing when they're used.

But this puts even more pressure on MaybeArchivalBinaryData, and
hence this commit, to start differentiating between:

1. always binary data vs maybe binary data

2. no scrubbing requires vs scrubbing required

The rationale for doing this set of changes has been explained in
#1319.

The reference issue is ooni/probe#2531.

For now, this commit just adds the new type and tests for it
without using the type, which we'll do later once we have added
better marshal/unmarshal testing for the interested types.
@bassosimone bassosimone merged commit c73d761 into master Sep 28, 2023
6 checks passed
@bassosimone bassosimone deleted the issue/2531 branch September 28, 2023 11:20
Murphy-OrangeMud pushed a commit to Murphy-OrangeMud/probe-cli that referenced this pull request Feb 13, 2024
There are cases where we know we have binary data in input and we want
the output to be binary data using the dictionary encoding like
`{"format":"base64","data":"..."}`.

Such cases are, for example, DNS messages bodies.

There is no need for us to pass through the MaybeArchivalBinaryData in
such cases. Additionally, this makes MaybeArchivalBinaryData a bit more
complex than it probably needs to be.

What's more, ArchivalBinaryData is for when you do not require to scrub
the data. I want to introduce new data types that automatically perform
scrubbing when they're used.

But this puts even more pressure on MaybeArchivalBinaryData, and hence
this commit, to start differentiating between:

1. always binary data vs maybe binary data

2. no scrubbing required vs scrubbing required

The rationale for doing this set of changes has been explained in
ooni#1319.

The reference issue is ooni/probe#2531.

For now, this commit just adds the new type and tests for it without
using the type, which we'll do later once we have added better
marshal/unmarshal testing for the interested types.
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.

1 participant