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

on_read & on-write config for ConcatenateBytes #186

Merged
merged 1 commit into from
Feb 23, 2021

Conversation

markmandel
Copy link
Contributor

@markmandel markmandel commented Feb 8, 2021

This allows for concatenating bytes both on_write and on_read - whereas previously you could only do on_read.

This is also useful to implement an integration test that checks to see if correct Filter ordering happens both on listening port read and write.

@markmandel markmandel added kind/feature New feature or request area/user-experience Pertaining to developers trying to use Quilkin, e.g. cli interface, configuration, etc labels Feb 8, 2021
@markmandel markmandel requested a review from iffyio February 8, 2021 23:02
@google-cla google-cla bot added the cla: yes label Feb 8, 2021
Copy link
Collaborator

@iffyio iffyio left a comment

Choose a reason for hiding this comment

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

Concatenatebytes doesn't sound like it needs a direction 😯? Thinking prepending isn't the opposite of Appending so that If I append bytes in one direction, nothing suggests I would want to prepend or even mutate packets in the opposite direction? Also There could be more operations to insert bytes into a packet e.g we could have an insert bytes at offset x in each packet so that the current upstream/downstream would not be relevant and we won't be able to support that

@markmandel
Copy link
Contributor Author

But what if I want to add bytes going from server->client, not just client->server ?

@markmandel
Copy link
Contributor Author

Just re-reading this and maybe the confusion is that it sounds like it allows the Filter to add bytes BOTH on data going upstream or downstream -- which is not the case. This only give you the option to append data going EITHER upstream OR downstream.

Does that make more sense?

@markmandel
Copy link
Contributor Author

This is likely also blocked by the conversation in #188 as well.

@markmandel
Copy link
Contributor Author

markmandel commented Feb 20, 2021

From: #188 (comment)

This should be changed to:

on_read=APPEND|PREPEND|...|DO_NOTHING
on_write=APPEND|PREPEND|...|DO_NOTHING

@markmandel markmandel force-pushed the feature/direction-concat branch from f3a6fd0 to f96c52d Compare February 22, 2021 20:56
@markmandel markmandel changed the title direction configuration for ConcatenateBytes on_read & on-write config for ConcatenateBytes Feb 22, 2021
@markmandel markmandel force-pushed the feature/direction-concat branch 2 times, most recently from d741d84 to f34276f Compare February 22, 2021 21:00
@markmandel
Copy link
Contributor Author

This should be good for re-review, as the config structure and documentation is now inline with #188 (comment)

type: string
description: |
Either append or prepend the `bytes` data to each packet filtered on write of the listening port.
default: "DO_NOTHING"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
default: "DO_NOTHING"
default: DO_NOTHING

default: "APPEND"
enum: ['APPEND', 'PREPEND']
Either append or prepend the `bytes` data to each packet filtered on read of the listening port.
default: "DO_NOTHING"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
default: "DO_NOTHING"
default: DO_NOTHING

@markmandel markmandel force-pushed the feature/direction-concat branch from f34276f to b6b4da1 Compare February 23, 2021 23:25
This allows for concatenating bytes both on_write and on_read -
whereas previously you could only do on_read.

This is also useful to implement an integration test that checks to see
if correct Filter ordering happens both on listening port read and
write.
@markmandel markmandel force-pushed the feature/direction-concat branch from b6b4da1 to e40b938 Compare February 23, 2021 23:25
@markmandel markmandel merged commit dd3ce6f into main Feb 23, 2021
@markmandel markmandel deleted the feature/direction-concat branch February 23, 2021 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/user-experience Pertaining to developers trying to use Quilkin, e.g. cli interface, configuration, etc cla: yes kind/feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants