public function getPrincipal(): Principal
    {
        if ($this->principal === null && !$this->resume()) {
            $this->principal = Principal::getAnonymous();
        }
        return $this->principal;
    }