Add support for endpoint verification configuration
This commit is contained in:
parent
9a2cfbaa57
commit
f09bf930e4
1 changed files with 18 additions and 0 deletions
|
|
@ -161,6 +161,7 @@ if __name__ == '__main__':
|
|||
get_subparsers = get_parser.add_subparsers(title='subcommands', dest='subcommand')
|
||||
|
||||
get_connection_parser = get_subparsers.add_parser('connection')
|
||||
get_endpoint_verification_parser = get_subparsers.add_parser('endpoint_verification')
|
||||
|
||||
set_parser = main_subparsers.add_parser('set')
|
||||
set_subparsers = set_parser.add_subparsers(title='subcommands', dest='subcommand')
|
||||
|
|
@ -168,6 +169,9 @@ if __name__ == '__main__':
|
|||
set_connection_parser = set_subparsers.add_parser('connection')
|
||||
set_connection_parser.add_argument('connection_type', choices=['system', 'tor'])
|
||||
|
||||
set_endpoint_verification_parser = set_subparsers.add_parser('endpoint_verification')
|
||||
set_endpoint_verification_parser.add_argument('endpoint_verification_state', choices=['enabled', 'disabled'])
|
||||
|
||||
sync_parser = main_subparsers.add_parser('sync')
|
||||
|
||||
update_parser = main_subparsers.add_parser('update')
|
||||
|
|
@ -392,6 +396,13 @@ if __name__ == '__main__':
|
|||
elif arguments.subcommand == 'connection':
|
||||
print(ConfigurationController.get_connection())
|
||||
|
||||
elif arguments.subcommand == 'endpoint_verification':
|
||||
|
||||
if ConfigurationController.get_endpoint_verification_enabled():
|
||||
print('enabled')
|
||||
else:
|
||||
print('disabled')
|
||||
|
||||
elif arguments.command == 'set':
|
||||
|
||||
if arguments.subcommand is None:
|
||||
|
|
@ -400,6 +411,13 @@ if __name__ == '__main__':
|
|||
elif arguments.subcommand == 'connection':
|
||||
ConfigurationController.set_connection(arguments.connection_type)
|
||||
|
||||
elif arguments.subcommand == 'endpoint_verification':
|
||||
|
||||
if arguments.endpoint_verification_state == 'enabled':
|
||||
ConfigurationController.set_endpoint_verification_enabled(True)
|
||||
elif arguments.endpoint_verification_state == 'disabled':
|
||||
ConfigurationController.set_endpoint_verification_enabled(False)
|
||||
|
||||
elif arguments.command == 'sync':
|
||||
ClientController.sync(client_observer=client_observer, connection_observer=connection_observer)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue