From c90f0e971ee7e8935ae8dbef5a07d5e44e05fc35 Mon Sep 17 00:00:00 2001 From: okewoma Date: Wed, 10 Jul 2024 10:25:41 -0700 Subject: [PATCH] Added debugging and baseurl funtionality, Related to #1181 --- .../token_authentication_example.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/samples/authentication/token_authentication_example.py b/samples/authentication/token_authentication_example.py index 1a3c450ec..fcd1eb787 100644 --- a/samples/authentication/token_authentication_example.py +++ b/samples/authentication/token_authentication_example.py @@ -34,9 +34,11 @@ This sample should run using any version of FalconPy and requires the colorama and click libraries. """ +import logging import os import click import colorama +from argparse import ArgumentParser, RawTextHelpFormatter, Namespace from falconpy import ( CloudConnectAWS, Detects, @@ -54,6 +56,20 @@ BOLD = colorama.Style.BRIGHT ENDMARK = colorama.Style.RESET_ALL +def consume_arguments() -> Namespace: + parser = ArgumentParser(description=__doc__, fromatter_class=RawTextHelpFormatter) + parser.add_argument("-d", "--debug", + help="Enable API debugging", + action="store_true", + default=False + ) + parser.add_argument("-b", "--base-url", + dest="base_url", + help="CrowdStrike cloud region. (auto or usgov1, Default: auto)", + required=False, + default="auto" + ) + return parser.parse_args # ### BEGIN token simulation def get_token():