Skip to content

Add a "don't ask me anymore" option to the interactive mode #128

Closed

Description

@KevinHock

this is where we ask for input in vulnerabilities.py

Activity

  1. prithvisingh18 commented on Jun 11, 2018

    @prithvisingh18

    Hi, can I try to solve this issue ?

  2. KevinHock commented on Jun 11, 2018

    @KevinHock
    CollaboratorAuthor

    Hi prithvisingh, definitely 👍🙏

    I'll try to make the issue description etc. better later today, but for understanding the code a bit more see this pr #81 :)

  3. KevinHock commented on Jun 12, 2018

    @KevinHock
    CollaboratorAuthor

    Hi @prithvisingh18
    So in vulnerabilities.py

    We can change it here when the user types stop
    https://github.com/python-security/pyt/blob/master/pyt/vulnerabilities/vulnerabilities.py#L304-L310
    e.g. change it to Is the return value of {} with tainted argument "{}" vulnerable? (Y/n/stop)
    and check for if user_says.startswith('s'):

    This seems like it can be solved in 1 of 3 ways

    • make ui_mode an object, not an int (so that we can change it by reference)
    • use a global variable everywhere we currently use it (so that we can set the global to the variable)
    • raise an exception, catch the exception and then proceed with a different value

    These are all kind of ugly, what do you think is nice? :)
    I kind of think making it an object would be the best way, b/c trying to catch an exception in the loop, and still keeping what the user previously entered via y and n will lead to ugly code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions