Distributed Library System — Authentication Service
分散型図書館システム — 認証サービス
The Authentication Service is the security foundation of the distributed library platform.
It is responsible for user registration, user authentication, JWT token generation, identity verification, and account lifecycle management.
The service provides a centralized authentication mechanism used by all protected services within the platform and publishes identity-related events through Kafka for downstream consumers.
Authentication Service は分散型図書館システムにおける認証基盤サービスです。
ユーザー登録、認証、JWT 発行、本人確認、およびアカウントライフサイクル管理を担当します。
本サービスはシステム全体の認証基盤として機能し、Kafka を通じて認証関連イベントを配信します。
- User registration
- User authentication
- JWT token generation
- Identity verification
- User profile retrieval
- Account deletion
- Authentication event publication
- Access control enforcement
- Book catalog metadata management
- Borrow transaction processing
- Inventory management
- Recommendation generation
- Notification delivery
- Analytical aggregation
- Search indexing
- Register new users
- Authenticate users
- Generate JWT tokens
- Validate user identities
- Retrieve authenticated profiles
- Manage account lifecycle
- Publish authentication events
- Enforce access control policies
- ユーザー登録
- ユーザー認証
- JWT 発行
- 本人確認
- ユーザープロファイル取得
- アカウントライフサイクル管理
- 認証イベント配信
- アクセス制御管理
| Category | Technology |
|---|---|
| Runtime | PHP 8.2 |
| Framework | Laravel 12 |
| Messaging | Kafka |
| Persistence | Laravel Eloquent |
| Database | MongoDB |
| Cache | Redis |
| API Documentation | OpenAPI |
| Validation | Laravel Validation |
| Security | JWT Authentication |
| Testing | PHPUnit / Mockery |
| Monitoring | OpenTelemetry / Prometheus |
| Containerization | Docker |
| CI/CD | GitHub Actions |
POST /auth/registerCreates a new user account.
新しいユーザーアカウントを登録します。
POST /auth/loginAuthenticates a user using Basic Authentication credentials and generates a JWT token.
Basic 認証情報を利用してユーザー認証を行い、JWT を発行します。
GET /auth/profileReturns information about the authenticated user.
認証済みユーザー情報を返却します。
DELETE /auth/userDeletes the authenticated user's account.
認証済みユーザーアカウントを削除します。
| Topic | Description |
|---|---|
| library.user.created.v1 | User registration events |
| library.user.deleted.v1 | User deletion events |
Registration Request
↓
Validation Layer
↓
MongoDB Persistence
↓
Kafka Event Publication
↓
Downstream Service Consumption
Client Request
↓
Credential Validation
↓
Identity Verification
↓
JWT Generation
↓
Protected Resource Access
↓
Profile Retrieval
/swagger-ui/
- PHP 8.2
- Composer
- Docker
- MongoDB
- Redis
- Kafka
docker compose up --buildcomposer test- Unit tests
- Integration tests
- Controller tests
- JWT validation tests
- Kafka event validation
- Coverage verification
- Complexity verification
含まれるテスト:
- ユニットテスト
- 統合テスト
- コントローラテスト
- JWT 検証テスト
- Kafka イベント検証
- カバレッジ検証
- 複雑度検証
The CI pipeline enforces:
- Automated test execution
- Coverage thresholds
- Pull request validation
- Docker image publication
- Branch protection workflows
CI パイプラインでは以下を保証します:
- 自動テスト実行
- カバレッジ閾値管理
- Pull Request 検証
- Docker イメージ配布
- ブランチ保護ワークフロー
Environment-driven configuration.
環境変数ベースで構成されています。
/health
/metrics
The Authentication Service represents the security foundation of the distributed library system.
All protected services rely on the identity verification and JWT tokens issued by this service to enforce access control and secure communication across the platform.
Authentication Service は分散型図書館システム全体の認証基盤サービスです。
各サービスは本サービスが発行する JWT を利用して認可処理を行い、システム全体の安全性を維持します。
MIT