Commit bf98a80
authored
🐛 OAuth2 sign-in flow, profile auto-creation, and E2E tests (#10)
## Summary
- OAuth2ログインフロー(Ory Hydra + Kratos)の修正と安定化
- Account作成時にProfileを自動生成する機能を追加
- axum 0.8 / tower-http 0.6 へのアップグレード
- Keto OPL (Ory Permission Language) への権限モデル移行
- OpenAPIスペック駆動のスモークテスト追加
- OAuth2ログイン→Account作成→Profile自動生成を検証するE2Eテスト追加
(`server/tests/e2e_basic_flow.rs`)
## Changes
### Bug Fixes
- `:bug:` HTTP 302 を OAuth2 login/consent エンドポイントから正しく返すように修正
- `:bug:` OffsetDateTime を ISO 8601 (RFC3339) フォーマットにシリアライズするよう修正
- `:bug:` CommandProcessor で Account ReadModel 作成を同期化し、`find_or_create`
パターンの競合を防止
- `:bug:` Keto v0.12 の HTTP 403 レスポンス処理を修正
### Features
- `:sparkles:` Account 作成時に Profile を自動生成
- `:sparkles:` Hydra id_token に email クレームを含める
### Refactoring
- `:recycle:` Keto 権限モデルを OPL に移行
- `:recycle:` パスパラメータ名を OpenAPI 一貫性のために統一
- `:recycle:` ルートスモークテストを OpenAPI スペック駆動に変更
- `:arrow_up:` axum 0.8, tower-http 0.6 へアップグレード
### Testing
- `:white_check_mark:` E2E テスト追加: OAuth2 login → Account 作成 → Profile
非同期プロジェクション検証
- `justfile` に `just e2e` / `just e2e-down` コマンド追加
- reqwest によるブラックボックス HTTP テスト
- Ory Hydra/Kratos との完全な OAuth2 フロー実行
## Running E2E Tests
```bash
# 必要サービスの起動を含め全自動で実行
just e2e
# サービスの後片付け
just e2e-down
```33 files changed
Lines changed: 1489 additions & 657 deletions
File tree
- .github/workflows
- adapter/src/processor
- application/src
- service
- transfer
- driver/src
- database/postgres
- kernel/src
- migrations
- ory/keto
- server
- src
- route
- schema
- tests
- support
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
9 | 24 | | |
10 | 25 | | |
11 | 26 | | |
| |||
128 | 143 | | |
129 | 144 | | |
130 | 145 | | |
131 | | - | |
| 146 | + | |
132 | 147 | | |
133 | 148 | | |
134 | 149 | | |
| |||
0 commit comments