-
Notifications
You must be signed in to change notification settings - Fork 0
feat(backend): メール認証を行えるように #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
yupix
wants to merge
15
commits into
main
Choose a base branch
from
feat/verify-mail
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
8c4d22e
feat(backend): add email verification functionality with token manage…
yupix 88ec75f
refactor(backend): SeaORMのv2で推奨されているエラーハンドリングに変更
yupix f184165
refactor(backend): トークンの更新をLuaSccriptで原始的に実行するように
yupix 835e83f
feat(backend): add urlencoding dependency and use it for token encodi…
yupix 7c5e840
feat(backend): implement verification email outbox for transactional …
yupix b691478
chore(front): openapi.jsonからapi呼び出し用の関数を生成
yupix 46c9b87
feat(backend): add email_verification_app_url to settings with valida…
yupix 9b59eaf
feat(backend): enhance verification email outbox with processing stat…
yupix 3c68222
refactor(backend): streamline email worker processing logic and impro…
yupix 883f35e
feat(backend): introduce centralized error handling with AppError and…
yupix 1371d4b
feat(backend): タイミング攻撃の対策
yupix 4632626
feat(backend): implement verification email job processing with Apali…
yupix 8c3837c
feat(backend): enhance personal_tokens model with ToSchema and remove…
yupix 2db4f55
feat(backend): implement user registration and email verification flo…
yupix 43e5187
feat(backend): update personal_tokens model to include ScopeList for …
yupix File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| # entities Module | ||
| # entities | ||
|
|
||
| このモジュールは、データベースのエンティティを定義します。各エンティティは、SeaORMのマクロを使用して定義されており、データベースのテーブル構造に対応しています。また、OpenAPIドキュメント生成のために、`utoipa::ToSchema`トレイトも実装しています。これにより、APIエンドポイントで使用されるデータ構造が明確になり、クライアントとのインターフェースが一貫性を持つようになります。 | ||
| API や永続化で使うモデルをまとめるモジュールです。レスポンス用の `@ToSchema` 付きモデルもここに置きます。 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,3 +3,4 @@ pub mod personal_tokens; | |
| pub mod scopes; | ||
| pub mod tenants; | ||
| pub mod users; | ||
| pub mod verification_email_outbox; | ||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| use sea_orm::entity::prelude::*; | ||
|
|
||
| #[derive(Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum)] | ||
| #[sea_orm(rs_type = "String", db_type = "String(StringLen::N(20))")] | ||
| pub enum OutboxStatus { | ||
| #[sea_orm(string_value = "pending")] | ||
| Pending, | ||
| #[sea_orm(string_value = "sent")] | ||
| Sent, | ||
| #[sea_orm(string_value = "failed")] | ||
| Failed, | ||
| } | ||
|
|
||
| #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)] | ||
| #[sea_orm(table_name = "verification_email_outbox")] | ||
| pub struct Model { | ||
| #[sea_orm(primary_key, auto_increment = false)] | ||
| pub id: Uuid, | ||
| #[sea_orm(indexed)] | ||
| pub user_id: Uuid, | ||
| pub email: String, | ||
| /// 送信完了後はクリアする(平文トークンを永続保持しない) | ||
| #[sea_orm(nullable)] | ||
| pub token: Option<String>, | ||
| #[sea_orm(indexed)] | ||
| pub status: OutboxStatus, | ||
| pub attempts: i32, | ||
| #[sea_orm(nullable)] | ||
| pub last_error: Option<String>, | ||
| pub created_at: DateTimeWithTimeZone, | ||
| #[sea_orm(nullable)] | ||
| pub sent_at: Option<DateTimeWithTimeZone>, | ||
| } | ||
|
|
||
| #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] | ||
| pub enum Relation { | ||
| #[sea_orm( | ||
| belongs_to = "super::users::Entity", | ||
| from = "Column::UserId", | ||
| to = "super::users::Column::Id", | ||
| on_update = "NoAction", | ||
| on_delete = "Cascade" | ||
| )] | ||
| Users, | ||
| } | ||
|
|
||
| impl Related<super::users::Entity> for Entity { | ||
| fn to() -> RelationDef { | ||
| Relation::Users.def() | ||
| } | ||
| } | ||
|
|
||
| impl ActiveModelBehavior for ActiveModel {} |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.