feat(Production): Complete production deployment infrastructure

- Add comprehensive health check system with multiple endpoints
- Add Prometheus metrics endpoint
- Add production logging configurations (5 strategies)
- Add complete deployment documentation suite:
  * QUICKSTART.md - 30-minute deployment guide
  * DEPLOYMENT_CHECKLIST.md - Printable verification checklist
  * DEPLOYMENT_WORKFLOW.md - Complete deployment lifecycle
  * PRODUCTION_DEPLOYMENT.md - Comprehensive technical reference
  * production-logging.md - Logging configuration guide
  * ANSIBLE_DEPLOYMENT.md - Infrastructure as Code automation
  * README.md - Navigation hub
  * DEPLOYMENT_SUMMARY.md - Executive summary
- Add deployment scripts and automation
- Add DEPLOYMENT_PLAN.md - Concrete plan for immediate deployment
- Update README with production-ready features

All production infrastructure is now complete and ready for deployment.
This commit is contained in:
2025-10-25 19:18:37 +02:00
parent caa85db796
commit fc3d7e6357
83016 changed files with 378904 additions and 20919 deletions

View File

@@ -19,7 +19,8 @@ final readonly class OAuthToken
public ?RefreshToken $refreshToken,
public TokenType $tokenType,
public ?TokenScope $scope,
) {}
) {
}
/**
* Create from provider response
@@ -28,7 +29,7 @@ final readonly class OAuthToken
*/
public static function fromProviderResponse(array $response): self
{
if (!isset($response['access_token'])) {
if (! isset($response['access_token'])) {
throw new \InvalidArgumentException('Provider response missing access_token');
}
@@ -43,7 +44,7 @@ final readonly class OAuthToken
? RefreshToken::create($response['refresh_token'])
: null,
tokenType: TokenType::fromString($response['token_type'] ?? 'Bearer'),
scope: isset($response['scope']) && !empty($response['scope'])
scope: isset($response['scope']) && ! empty($response['scope'])
? TokenScope::fromString($response['scope'])
: null,
);
@@ -137,13 +138,21 @@ final readonly class OAuthToken
*/
public function toArray(): array
{
return [
$array = [
'access_token' => $this->accessToken->toString(),
'refresh_token' => $this->refreshToken?->toString(),
'expires_at' => $this->accessToken->getExpiresAt()->getTimestamp(),
'expires_at' => $this->accessToken->getExpiresAt()->toTimestamp(),
'token_type' => $this->tokenType->value,
'scope' => $this->scope?->toString(),
];
if ($this->refreshToken !== null) {
$array['refresh_token'] = $this->refreshToken->toString();
}
if ($this->scope !== null) {
$array['scope'] = $this->scope->toString();
}
return $array;
}
/**
@@ -172,20 +181,20 @@ final readonly class OAuthToken
*/
public static function fromArray(array $data): self
{
if (!isset($data['access_token'], $data['expires_at'])) {
if (! isset($data['access_token'], $data['expires_at'])) {
throw new \InvalidArgumentException('Stored token data missing required fields');
}
return new self(
accessToken: AccessToken::create(
$data['access_token'],
Timestamp::fromUnix((int) $data['expires_at'])
Timestamp::fromTimestamp((int) $data['expires_at'])
),
refreshToken: isset($data['refresh_token'])
? RefreshToken::create($data['refresh_token'])
: null,
tokenType: TokenType::fromString($data['token_type'] ?? 'Bearer'),
scope: isset($data['scope']) && !empty($data['scope'])
scope: isset($data['scope']) && ! empty($data['scope'])
? TokenScope::fromString($data['scope'])
: null,
);