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

Nothing shows up in the output file #29

Closed
tweska opened this issue Apr 7, 2023 · 10 comments
Closed

Nothing shows up in the output file #29

tweska opened this issue Apr 7, 2023 · 10 comments

Comments

@tweska
Copy link
Contributor

tweska commented Apr 7, 2023

Hi,

I have installed mitmproxy and mitmproxy2swagger in a virtual environment. I can run your software without errors but nothing interesting shows up in the output file.

Command I used:

$ mitmproxy2swagger -i flows -o specs.yml -p https://api.example.com -f flow
No existing swagger file found. Creating new one.
[▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌] 100.0%Done!

Contents of the output file:

$ cat specs.yml 
openapi: 3.0.0
info:
  title: flows Mitmproxy2Swagger
  version: 1.0.0
servers:
- url: https://api.example.com
  description: The default server
paths: {}
x-path-templates:
# Remove the ignore: prefix to generate an endpoint with its URL
# Lines that are closer to the top take precedence, the matching is greedy
  []

Version info:

$ python --version
Python 3.9.5

$ mitmproxy --version
Mitmproxy: 9.0.1
Python:    3.9.5
OpenSSL:   OpenSSL 3.0.7 1 Nov 2022
Platform:  Linux-5.4.0-144-generic-x86_64-with-glibc2.31

$ pip list | grep mitmproxy2swagger
mitmproxy2swagger        0.8.2
@alufers
Copy link
Owner

alufers commented Apr 9, 2023

Does your flows file actually contain requests to https://api.example.com ?

@tweska
Copy link
Contributor Author

tweska commented Apr 10, 2023

Yes, well I censored the actual URL but the actual URL does show up in the flows file. I double checked this by searching it in the mitmproxy web interface.

@tweska
Copy link
Contributor Author

tweska commented Apr 10, 2023

Oh, I think I figured it out! When I use the argument -p "" some things show up but they are all IP addresses. Not the most convenient but I think it means I can still use your tool so that's great! :^D

@alufers
Copy link
Owner

alufers commented Apr 10, 2023

It would be great If you could provide a proof of concept flow file and the commands that you used to analyze it. Then I could fix this issue

@tweska
Copy link
Contributor Author

tweska commented Apr 11, 2023

Here is a small flows file with a bash script: testcase.zip.

It will setup a python3.9 virtual environment run mitmproxy2swagger.

@alufers
Copy link
Owner

alufers commented Apr 12, 2023

Thank you!

@tweska
Copy link
Contributor Author

tweska commented Apr 17, 2023

Is this fixed in cac017f?

@alufers
Copy link
Owner

alufers commented Apr 17, 2023

Yes!

@tweska
Copy link
Contributor Author

tweska commented Apr 18, 2023

Thanks, that's great! When will the Python package be updated?

@tweska tweska closed this as completed Apr 18, 2023
@alufers
Copy link
Owner

alufers commented Apr 24, 2023

It has been published

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

No branches or pull requests

2 participants