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

[Plugin] Custom flags in external plugins not discovered when enabled using kwargs #871

Open
abhinavsingh opened this issue Dec 15, 2021 · 2 comments
Labels
Bug Bug report in proxy server Good First Issue Issues for new contributors to pick-up Plugin Related to plugin code (not core)

Comments

@abhinavsingh
Copy link
Owner

abhinavsingh commented Dec 15, 2021

Describe the bug

DOES NOT WORK

proxy.Proxy(plugins=["...", "...",]) will not result in discovering custom flags defined in the external plugins.

FOLLOWING 2 SCENARIO WORKS

proxy.Plugin(*("--plugin", "...", "--plugin", "..."))

or

proxy --plugin ....

FIX

args.plugins must be resolved prior to calling Flags.parse for custom flag discovery.

@abhinavsingh abhinavsingh added Bug Bug report in proxy server Good First Issue Issues for new contributors to pick-up labels Dec 15, 2021
@abhinavsingh abhinavsingh changed the title [Flags] Custom flags in external plugins not discovered when enabled via kwargs [Flags] Custom flags in external plugins not discovered when enabled using kwargs Dec 15, 2021
@abhinavsingh abhinavsingh pinned this issue Dec 15, 2021
@abhinavsingh abhinavsingh changed the title [Flags] Custom flags in external plugins not discovered when enabled using kwargs [Plugin] Custom flags in external plugins not discovered when enabled using kwargs Dec 15, 2021
@abhinavsingh abhinavsingh added the Plugin Related to plugin code (not core) label Jan 14, 2022
@klmunday
Copy link

Hi,

Is there any update to this or more details regarding implementing the workaround for the skeleton app example? https://github.com/abhinavsingh/proxy.py/tree/develop/skeleton

@klmunday
Copy link

Hi,

Is there any update to this or more details regarding implementing the workaround for the skeleton app example? https://github.com/abhinavsingh/proxy.py/tree/develop/skeleton

Figured it out.

def run_proxy() -> None:
    with proxy.Proxy(
            enable_web_server=True,
            port=9000,
            input_args=["--plugin", "<plugin name>"]
    ) as _:
        proxy.sleep_loop()

This then correctly loads the plugin and resolves the plugins flags and their default values. I would imagine for any utilisation of the flags (outside of default) you'd probably need to add those to the input_args as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug report in proxy server Good First Issue Issues for new contributors to pick-up Plugin Related to plugin code (not core)
Projects
None yet
Development

No branches or pull requests

2 participants