Draft
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #7 +/- ##
===========================================
- Coverage 95.08% 66.83% -28.26%
===========================================
Files 58 71 +13
Lines 3888 7095 +3207
===========================================
+ Hits 3697 4742 +1045
- Misses 191 2353 +2162 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Add crypto module with RSA-2048 key generation using rsa crate - Encrypt private keys with Argon2id key derivation + AES-256-GCM - Read master password from /run/secrets or ./master-key-password - Add security measures: - Zeroize sensitive data in memory - Validate password file permissions (Unix 0o600/0o400) - Use generic error messages to prevent timing attacks - Add KernelError::NotFound for proper HTTP 404 responses 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add adapter crate with SigningKeyGenerator composed trait via blanket impl - Move crypto implementations from application to driver layer - Improve password memory management with Zeroizing<Vec<u8>> - Standardize decrypt error messages to prevent information leakage - Add comprehensive documentation for blanket implementations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Account作成をイベントソーシング経由(CommandEnvelope → event_streams → 非同期Applier) から直接INSERT方式に変更し、auth_emumet_accountsリンクも同一フローで作成するように修正。 - AccountModifierトレイトにlink_auth_accountメソッド追加 - CreateAccountServiceをAccount::new() + 直接INSERT方式に書き換え - Account::create()メソッド削除(update/deleteは既存のイベントソーシングを維持) - EventVersion<T>にDefault実装追加 - 関連テストをAccountEvent::Created直接構築に更新
EditAccountServiceトレイトとupdate_account_by_idハンドラを追加し、 イベントソーシングによるアカウントのis_botフィールド更新を実装
非同期プロジェクション適用前に再取得すると古いデータを返す可能性があるため、 DELETEと同様に204 No Contentを返すように変更
cryptoで採用したadapterパターン(低レベルtrait合成)をaccountにも適用。 AccountQuery + AccountModifier → AccountRepository として合成し、 application層からはaccount_repository()経由で統一的にアクセスする。 blanket implによりkernel/driver/serverの変更は不要。
…eparation AccountQuery/AccountModifier/AccountRepositoryを廃止し、CQRS設計に沿った AccountReadModel(projection読み書き)とAccountEventStore(エンティティ別 イベント永続化)に置き換え。 - kernel: AccountReadModel trait, AccountEventStore trait 新設 - driver: PostgresAccountReadModel, PostgresAccountEventStore 実装 - migration: account_events テーブル追加(エンティティ別イベントストア) - application: 全Account操作をイベント経由に統一(Command→Event→Projection) - adapter: AccountRepository 削除(C/Q分離により不要に)
- Account::update/deleteにcurrent_versionパラメータを追加し楽観的排他制御を実装 - Deletedイベントでentityをhard delete (None) に変更 - AccountEventStoreのfind_by_idのSQLバインド順序を修正 - event.rsのfind_by_id_with_versionテストのロジックバグを修正しshouldpanicを除去 - マイグレーションのdata列をJSONBに変更、occurred_at列を追加 - テストでドメインロジック(Account::update/delete)と永続化テストを分離
Query/Modify/EventStore/ReadModel の associated type `Transaction` を `Executor` にリネーム。引数名も `transaction` → `executor` に統一。 実態はコネクションラッパーであり、トランザクションではないため名前を修正。
…r for CQRS - AccountEvent::Created に auth_account_id を追加し Account::create() static メソッドを追加 - adapter層に AccountCommandProcessor (EventStore + Signal をラップ) と AccountQueryProcessor (ReadModel読み取り専用) を配置 - application層のサービスを UseCase トレイトに書き換え (Get/Create/Edit/Delete) signal パラメータと認証関連DI境界を削除 - 認証ロジック (resolve_auth_account_id) を server層に移動 - AppModule に DependOn* トレイトを手動実装し blanket impl 経由で全UseCase を自動実装 - AccountApplier を直接ロジックに置き換え (Created イベントから auth_account_id を 抽出して link_auth_account も処理) - AuthAccountInfo を削除 (server層の KeycloakAuthAccount で代替) - Signal::emit に + Send、Executor に : Send を追加
AuthAccountにAccount同様のCQRSパターンを適用: - AuthAccountEventStore / AuthAccountReadModel を kernel に追加 - AuthAccountCommandProcessor / QueryProcessor を adapter に追加 - CommandProcessor内でprojection書き込みも完結させ、serverからReadModelの直接参照を除去 - 汎用EventModifier/EventQuery/AuthAccountQuery/AuthAccountModifierを削除 - auth_account_eventsテーブルのマイグレーション追加
- AuthAccount::deleteに楽観的排他制御(current_version)を追加 - CommandProcessor::deleteのシグネチャにcurrent_versionを追加 - UpdateAuthAccount applierでDeleted後のprojection削除を処理 - UpdateAuthAccount applierでReadModelに未登録のケース(create)を処理 - EventStoreテストのヘルパー関数重複を解消(親mod testに共通化)
依存グラフの修正、エンティティ分類の明確化、applicationサービスの記述追加
…moteAccount/Image/AuthHost Profile/MetadataにCQRS + Event Sourcingパターンを適用: - kernel: EventStore/ReadModelトレイト定義、ProfileEvent::Deleted追加、楽観的並行制御 - adapter: CommandProcessor/QueryProcessor(blanket impl) - application: CRUD UseCase + EventApplierサービス + DTO - driver: PostgreSQL EventStore/ReadModel実装 - server: REST API、Applier、DI配線 - migration: profile_events/metadata_eventsテーブル Follow/RemoteAccount/Image/AuthHostをRepositoryパターンに移行: - kernel: Repositoryトレイト定義(Query + Modifier統合) - Follow/RemoteAccount: Event enum, EventApplier, CommandEnvelope削除 - driver: Repository impl書き換え(SQL変更なし) - legacy Query/Modifierモジュール完全削除 - impl_database_delegation!マクロ + AppModule DI更新
Phase 1: Keycloak → Ory 移行 - Keycloak 依存を全て削除 (axum-keycloak-auth, KeycloakAuthLayer, KeycloakToken, expect_role!) - JWT 検証ミドルウェア実装 (OIDC Discovery, JWKS キャッシュ, RS256) - OAuth2 Login/Consent Provider エンドポイント (GET/POST /oauth2/login, /oauth2/consent) - Hydra Admin API クライアント + Kratos セッションクライアント - ルートハンドラ書き換え (AuthClaims ベース) - Handler/AppModule に Hydra/Kratos クライアント統合 - compose.yml で開発環境一括起動 (PostgreSQL, Redis, Kratos, Hydra) - E2E 検証完了 (Kratos login → OAuth2 flow → JWT → API access)
wiremockでHydra/Kratosをモックし、OAuth2エンドポイントの統合テスト10件を追加。 - GET /oauth2/login: skip/session有効/cookie無し/session無効の4ケース - GET /oauth2/consent: skip/client skip/通常表示の3ケース - POST /oauth2/consent: accept/scope不正/rejectの3ケース その他の変更: - tower 0.4→0.5にアップグレード(axum 0.7互換) - Handler::init_with_urls()を抽出しコンストラクタの重複を解消
dotenvy::varでDATABASE_URLの存在を確認し、未設定時はテストをスキップするように変更。 CIなどDB未起動環境でテストが失敗しないようにする。
test_withのコンパイル時envチェックにより、DATABASE_URL未設定時は テストがignoredとして正しく表示されるようにした。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
/account/user/metadata