| 1: | <?php |
| 2: | |
| 3: | declare(strict_types=1); |
| 4: | |
| 5: | |
| 6: | |
| 7: | |
| 8: | |
| 9: | |
| 10: | |
| 11: | |
| 12: | |
| 13: | |
| 14: | namespace Nexus\Mcp\Extension\Auth\ClientCredentials; |
| 15: | |
| 16: | use Nexus\Assert\Assert; |
| 17: | |
| 18: | |
| 19: | |
| 20: | |
| 21: | |
| 22: | |
| 23: | |
| 24: | final readonly class PrivateKeyJwtCredential |
| 25: | { |
| 26: | |
| 27: | |
| 28: | |
| 29: | |
| 30: | |
| 31: | |
| 32: | public function __construct( |
| 33: | public string $clientId, |
| 34: | public string $privateKeyPem, |
| 35: | public string $algorithm, |
| 36: | public ?string $keyId = null, |
| 37: | ) { |
| 38: | Assert::that($clientId)->isNonEmptyString('"clientId" must be a non-empty string.'); |
| 39: | Assert::that($privateKeyPem)->isNonEmptyString('"privateKeyPem" must be a non-empty string.'); |
| 40: | Assert::that($algorithm)->isNonEmptyString('"algorithm" must be a non-empty string.'); |
| 41: | Assert::that($keyId)->nullOr()->isNonEmptyString('"keyId" must be a non-empty string or null.'); |
| 42: | } |
| 43: | } |
| 44: | |