Something went wrong. Try again.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738<?php
declare(strict_types=1);
namespace Wotnak\Atproto\Tests\Support;
use Psr\Http\Message\RequestInterface;use Wotnak\Atproto\Client\AuthenticatedSessionInterface;
final readonly class TestAuthenticatedSession implements AuthenticatedSessionInterface {
public function __construct( private string $did, private string $pdsUrl, #[\SensitiveParameter] private string $accessToken, ) {}
public function getAccessToken(): string { return $this->accessToken; }
public function sign(RequestInterface $request): RequestInterface { return $request ->withHeader('Authorization', 'Bearer ' . $this->accessToken) ->withHeader('X-Subject', $this->did); }
public function getSubjectDid(): string { return $this->did; }
public function getPdsUrl(): string { return $this->pdsUrl; }
}