def METHOD_NAME(params):
    if params.common_name:
        os.environ['common_name'] = params.common_name
    if params.auth_control_file:
        os.environ['auth_control_file'] = params.auth_control_file
    if params.server:
        os.environ["auth_server"] = params.server
    # script action
    cmd_path = "%s/" % os.path.dirname(__file__)
    if params.script_type == 'user-pass-verify':
        os.environ["auth_method"] = params.auth_method
        if params.auth_method == 'via-file' and len(params.args) > 0:
            # user/password file to read (via-file), arg1
            os.environ["auth_file"] = params.args[0]
        if params.defer:
            os.environ["auth_defer"] = 'true'
            if os.fork() != 0:
                # When deferred, openvpn expects exit code 2 (see help --auth-user-pass-verify)
                sys.exit(2)
        # dispatch user_pass_verify
        sys.exit(subprocess.run("%s/user_pass_verify.php" % cmd_path).returncode)
    elif  params.script_type == 'tls-verify':
        if len(params.args) > 0:
            os.environ["certificate_depth"] = params.args[0]
        sys.exit(subprocess.run("%s/tls_verify.php" % cmd_path).returncode)
    elif params.script_type == 'client-connect':
        # Temporary file used for the profile specified by client-connect
        if len(params.args) > 0:
            os.environ["config_file"] = params.args[0]
        sys.exit(subprocess.run("%s/client_connect.php" % cmd_path).returncode)
    elif params.script_type == 'client-disconnect':
        sys.exit(subprocess.run("%s/client_disconnect.sh" % cmd_path).returncode)
    elif params.script_type == 'learn-address':
        if os.fork() == 0:
            sys.exit(subprocess.run(
                ['/usr/local/opnsense/scripts/filter/update_tables.py', '--types', 'authgroup']
            ).returncode)