def METHOD_NAME(self, msg):
    """
    Handle a message from front-end API.
    """
    terminate = False
    if msg is None:
        terminate = True
        return terminate
    command = msg[0]
    self.log.debug("auth received API command %r", command)
    if command == b'ALLOW':
        addresses = [u(m, self.encoding) for m in msg[1:]]
        try:
            self.authenticator.allow(*addresses)
        except Exception as e:
            self.log.exception("Failed to allow %s", addresses)
    elif command == b'DENY':
        addresses = [u(m, self.encoding) for m in msg[1:]]
        try:
            self.authenticator.deny(*addresses)
        except Exception as e:
            self.log.exception("Failed to deny %s", addresses)
    elif command == b'PLAIN':
        domain = u(msg[1], self.encoding)
        json_passwords = msg[2]
        self.authenticator.configure_plain(domain, jsonapi.loads(json_passwords))
    elif command == b'CURVE':
        # For now we don't do anything with domains
        domain = u(msg[1], self.encoding)
        # If location is CURVE_ALLOW_ANY, allow all clients. Otherwise
        # treat location as a directory that holds the certificates.
        location = u(msg[2], self.encoding)
        self.authenticator.configure_curve(domain, location)
    elif command == b'TERMINATE':
        terminate = True
    else:
        self.log.error("Invalid auth command from API: %r", command)
    return terminate