def METHOD_NAME(self) -> Union[db.Key, str]:
    """
    :warning:
        It's invalid to call _getEndpointKey if method is set to user and there's no user logged in!
    :return: the key associated with the current endpoint (it's IP or the key of the current user)
    """
    if self.useUser:
        user = current.user.get()
        assert user, "Cannot decrement usage from guest!"
        return user["key"]
    else:
        remoteAddr = current.request.get().request.remote_addr
        if "::" in remoteAddr:  # IPv6 in shorted form
            remoteAddr = remoteAddr.split(":")
            blankIndex = remoteAddr.index("")
            missigParts = ["0000"] * (8 - len(remoteAddr))
            remoteAddr = remoteAddr[:blankIndex] + missigParts + remoteAddr[blankIndex + 1:]
            return ":".join(remoteAddr[:4])
        elif ":" in remoteAddr:  # It's IPv6, so we remove the last 64 bits (interface id)
            # as it is easily controlled by the user
            return ":".join(remoteAddr.split(":")[:4])
        else:  # It's IPv4, simply return that address
            return remoteAddr