Skip to content

docs: clarify workflow YAML locations and custom additions#1

Open
LighTend3r wants to merge 4 commits intofreelabz:mainfrom
LighTend3r:main
Open

docs: clarify workflow YAML locations and custom additions#1
LighTend3r wants to merge 4 commits intofreelabz:mainfrom
LighTend3r:main

Conversation

@LighTend3r
Copy link
Copy Markdown

Description

I wanted to add my own tools to secator, but I noticed that the documentation was missing details on two essential points:

  1. Availability of external commands: It needed clarification that commands must be available in the PATH to be executed correctly by secator. I added an explanation and a command (which) to help users verify command availability.

  2. Location of workflow YAML files: The documentation didn’t specify where to find existing workflow YAML files. I included their location in the library (python3.11/site-packages/...) and added a command to locate them easily. I also explained how and where to add custom workflows (~/.secator/templates/**).

PS

In my opinion, the default workflows should ideally be placed in ~/.secator/templates instead of remaining in the installed library files. This would make it much easier for users to modify or remove them, as managing them directly within the library is not very practical.


Thank you so much for your work! Adding tools to secator is incredibly cool and straightforward thanks to your approach. 😊

@LighTend3r
Copy link
Copy Markdown
Author

I had a clarify one upper case option, because if an user add :

"L": {
    "short": "L",
    "is_flag": True,
    "default": True,
    "help": "Follow redirects",
},

The mapping whit "L" options can't process, the probleme is inherant to lib click, because the 'L' becom 'l' in kwargs (it's take me few hours to found this)
You can test this with :

import click
from click.testing import CliRunner

@click.command()
@click.option('--L', help="Option majuscule.")
def cli(**kwargs):
    """Command line function to test uppercase option."""
    print(kwargs)

# Test function
def test_cli_with_uppercase_option():
    runner = CliRunner()
    
    # Run the CLI command with the --L option
    result = runner.invoke(cli, ['--L', 'TestValue'])
    
    # Assertions to validate the behavior
    assert result.exit_code == 0, f"Unexpected exit code: {result.exit_code}"
    assert "{'l': 'TestValue'}" in result.output, f"Output mismatch: {result.output}"
    
    print("Test passed:", result.output)

# Main block to execute the test
if __name__ == "__main__":
    test_cli_with_uppercase_option()

So it's important to mention this
And the fix is in the commit

@LighTend3r
Copy link
Copy Markdown
Author

I’ve also added a section to clarify how to define custom meta options for tools that don’t fit into secator's built-in command categories.

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

Successfully merging this pull request may close these issues.

1 participant