Skip to content

Commit

Permalink
Verify tls (#98)
Browse files Browse the repository at this point in the history
* enhance docs

* remove --verify-tls from usage

* enhance verify-tls

* enhance verify-tls

* enhance verify-tls
  • Loading branch information
swethalohith2 authored Aug 2, 2024
1 parent 2fe3c40 commit 5df0e54
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ After export the variables then command can be run without any options.
# Usage

```
Usage: synctl [--verify-tls] <command> [options]
Usage: synctl <command> [options]
Options:
-h, --help show this help message and exit
Expand Down
16 changes: 12 additions & 4 deletions synctl/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def show_version():


def general_helper() -> None:
m = """Usage: synctl [--verify-tls] <command> [options]
m = """Usage: synctl <command> [options]
Options:
-h, --help show this help message and exit
Expand Down Expand Up @@ -4383,8 +4383,6 @@ def __init__(self) -> None:
def global_options(self):
self.parser.add_argument(
'--version', '-v', action="store_true", default=True, help="show version")
self.parser.add_argument(
"--verify-tls", action="store_true", default=False, help="verify tls certificate")

def config_command_options(self):
self.parser_config.add_argument(
Expand All @@ -4401,6 +4399,8 @@ def config_command_options(self):
'--default', action="store_true", help='set as default')

def create_command_options(self):
self.parser_create.add_argument(
"--verify-tls", action="store_true", default=False, help="verify tls certificate")
self.parser_create.add_argument(
'syn_type', type=str, choices=["test", "cred", "alert"], metavar="test/cred/alert", help="specify test/cred/alert")

Expand Down Expand Up @@ -4525,6 +4525,8 @@ def create_command_options(self):


def get_command_options(self):
self.parser_get.add_argument(
"--verify-tls", action="store_true", default=False, help="verify tls certificate")
self.parser_get.add_argument(
'op_type', choices=['location', 'lo', 'test', 'application', 'app', 'cred', 'alert', 'alert-channel', 'result', 'pop-size', 'size', 'pop-cost', 'cost'],
help="command list")
Expand Down Expand Up @@ -4579,6 +4581,8 @@ def get_command_options(self):
'--token', type=str, metavar="<token>", help='set token')

def patch_command_options(self):
self.parser_patch.add_argument(
"--verify-tls", action="store_true", default=False, help="verify tls certificate")
self.parser_patch.add_argument(
'syn_type', type=str, choices=["test"], help="Synthetic type, only test support")

Expand Down Expand Up @@ -4660,6 +4664,8 @@ def patch_command_options(self):
'--token', type=str, metavar="<token>", help='set token')

def update_command_options(self):
self.parser_update.add_argument(
"--verify-tls", action="store_true", default=False, help="verify tls certificate")
self.parser_update.add_argument(
'syn_type', type=str, choices=["test", "alert", "cred"], help="Synthetic type/ smart alert/ credential")
self.parser_update.add_argument(
Expand Down Expand Up @@ -4769,6 +4775,8 @@ def update_command_options(self):
'--token', type=str, metavar="<token>", help='set token')

def delete_command_options(self):
self.parser_delete.add_argument(
"--verify-tls", action="store_true", default=False, help="verify tls certificate")
self.parser_delete.add_argument(
'delete_type', choices=['location', 'lo', 'test', 'cred', 'alert'], help='specify Synthetic type: location/test/credential/smart alert')
self.parser_delete.add_argument(
Expand Down Expand Up @@ -4930,7 +4938,6 @@ def main():
auth_instance.remove_an_item_from_config(get_args.env)

elif COMMAND_GET == get_args.sub_command:

if get_args.op_type == SYN_TEST:
# synctl_instanace.synctl_get()
# deal test
Expand Down Expand Up @@ -5046,6 +5053,7 @@ def main():
elif get_args.op_type == POP_COST or get_args.op_type == 'cost':
pop_estimate.print_estimated_cost()
elif COMMAND_CREATE == get_args.sub_command:

if get_args.syn_type == SYN_CRED:
cred_payload = CredentialConfiguration()
if get_args.key is not None:
Expand Down

0 comments on commit 5df0e54

Please sign in to comment.