Add support for WireGuard endpoint verification
This commit is contained in:
parent
5080014070
commit
f95c4cf8d2
1 changed files with 16 additions and 8 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
from core.Constants import Constants
|
from core.Constants import Constants
|
||||||
from core.Errors import MissingSubscriptionError, InvalidSubscriptionError, UnknownConnectionTypeError, ConnectionUnprotectedError, ProfileStateConflictError
|
from core.Errors import MissingSubscriptionError, InvalidSubscriptionError, UnknownConnectionTypeError, ConnectionUnprotectedError, EndpointVerificationError, ProfileStateConflictError
|
||||||
from core.controllers.ApplicationController import ApplicationController
|
from core.controllers.ApplicationController import ApplicationController
|
||||||
from core.controllers.ApplicationVersionController import ApplicationVersionController
|
from core.controllers.ApplicationVersionController import ApplicationVersionController
|
||||||
from core.controllers.ClientController import ClientController
|
from core.controllers.ClientController import ClientController
|
||||||
|
|
@ -95,9 +95,14 @@ if __name__ == '__main__':
|
||||||
pristine_parser = argparse.ArgumentParser(add_help=False)
|
pristine_parser = argparse.ArgumentParser(add_help=False)
|
||||||
pristine_parser.add_argument('--pristine', '-p', action='store_true')
|
pristine_parser.add_argument('--pristine', '-p', action='store_true')
|
||||||
|
|
||||||
security_parser = argparse.ArgumentParser(add_help=False)
|
connection_protection_parser = argparse.ArgumentParser(add_help=False)
|
||||||
security_parser.add_argument('--disable-connection-protection', action='store_true')
|
connection_protection_parser.add_argument('--without-connection-protection', action='store_true')
|
||||||
security_parser.add_argument('--disable-profile-state-protection', action='store_true')
|
|
||||||
|
endpoint_verification_parser = argparse.ArgumentParser(add_help=False)
|
||||||
|
endpoint_verification_parser.add_argument('--without-endpoint-verification', action='store_true')
|
||||||
|
|
||||||
|
profile_state_protection_parser = argparse.ArgumentParser(add_help=False)
|
||||||
|
profile_state_protection_parser.add_argument('--without-profile-state-protection', action='store_true')
|
||||||
|
|
||||||
main_parser = argparse.ArgumentParser(prog=__get_name())
|
main_parser = argparse.ArgumentParser(prog=__get_name())
|
||||||
main_parser.add_argument('--version', '-v', action='version', version=f'{__get_name()} v{__get_version()}')
|
main_parser.add_argument('--version', '-v', action='version', version=f'{__get_name()} v{__get_version()}')
|
||||||
|
|
@ -133,8 +138,8 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
profile_subparsers.add_parser('destroy', parents=[profile_base_parser])
|
profile_subparsers.add_parser('destroy', parents=[profile_base_parser])
|
||||||
|
|
||||||
profile_subparsers.add_parser('enable', parents=[profile_base_parser, pristine_parser, security_parser])
|
profile_subparsers.add_parser('enable', parents=[profile_base_parser, pristine_parser, connection_protection_parser, endpoint_verification_parser, profile_state_protection_parser])
|
||||||
profile_subparsers.add_parser('disable', parents=[profile_base_parser, security_parser])
|
profile_subparsers.add_parser('disable', parents=[profile_base_parser, connection_protection_parser])
|
||||||
|
|
||||||
application_parser = main_subparsers.add_parser('application')
|
application_parser = main_subparsers.add_parser('application')
|
||||||
application_subparsers = application_parser.add_subparsers(title='subcommands', dest='subcommand')
|
application_subparsers = application_parser.add_subparsers(title='subcommands', dest='subcommand')
|
||||||
|
|
@ -171,10 +176,13 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
ignore = []
|
ignore = []
|
||||||
|
|
||||||
if getattr(arguments, 'disable_connection_protection', False):
|
if getattr(arguments, 'without_connection_protection', False):
|
||||||
ignore.append(ConnectionUnprotectedError)
|
ignore.append(ConnectionUnprotectedError)
|
||||||
|
|
||||||
if getattr(arguments, 'disable_profile_state_protection', False):
|
if getattr(arguments, 'without_endpoint_verification', False):
|
||||||
|
ignore.append(EndpointVerificationError)
|
||||||
|
|
||||||
|
if getattr(arguments, 'without_profile_state_protection', False):
|
||||||
ignore.append(ProfileStateConflictError)
|
ignore.append(ProfileStateConflictError)
|
||||||
|
|
||||||
ignore = tuple(ignore)
|
ignore = tuple(ignore)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue