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

Addon: add the possibility to add text/metadata to a connection #5704

Open
amreo opened this issue Nov 1, 2022 · 5 comments · May be fixed by #5983
Open

Addon: add the possibility to add text/metadata to a connection #5704

amreo opened this issue Nov 1, 2022 · 5 comments · May be fixed by #5983
Labels
area/web kind/feature New features / enhancements

Comments

@amreo
Copy link

amreo commented Nov 1, 2022

Problem Description

I modify the flows with a addon, but something the server returns 403, so I want to debug the flows by attaching a text, a comment or a data and see it in the web gui.

Proposal

Create a API HTTPFlow.setComment(text: str) that set a text in the flow info, and in the webgui add a tab for seeing the text.

class ModifyRequest:
    def request(self, flow: HTTPFlow):
          flow.setComment("This request was modified by the addon")

Alternatives

Use ctx.log.info more often

Additional context

None

@amreo amreo added the kind/feature New features / enhancements label Nov 1, 2022
@Prinzhorn
Copy link
Member

Prinzhorn commented Nov 1, 2022

A first basic version could render a serialized readonly version of flow.metadata in mitmweb. So that you can inspect any custom data you've added to the flow. This would be way more generic than adding an additional comment field.

@mhils
Copy link
Member

mhils commented Nov 1, 2022

flow.metadata is already exposed in mitmproxy, a PR that adds support to mitmweb would be very welcome. 👍

@Rishabhg71
Copy link

@mhils I would like to work on the issue I have looked into the flow object and yes it does have metadata exposed
my question is where do I have to show this metadata on the web?
Do I have to show it in a new panel or in an existing panel
image

@mhils
Copy link
Member

mhils commented Mar 8, 2023

@RG7279805: no particular preference, do what you think makes most sense!

@Rishabhg71
Copy link

Rishabhg71 commented Mar 8, 2023

@mhils what should be the data type used in metadata
String : make it a string but then adding a new tab doesn't make a lot of sense, nobody will have a long string that will cover the whole tab (wasted real estate)
Json-Serializable : Json-Serializable then adding a new tab is good since we can use the ContentView and show the data
any idea what should I do, I will try to add a filter for metadata too

my opinion: option-1 seems better

  • less complexity
  • a filter can be added easily for metadata

also, a general question for open source is what the best thing to do in this kind of scenario should we ask the maintainer what he wants or code the feature then make changes later on

@Rishabhg71 Rishabhg71 linked a pull request Mar 10, 2023 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/web kind/feature New features / enhancements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants