-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/auth password reset with OCI Email SDK #139
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
33d5363
Merge pull request #132 from wafflestudio/develop
mjy926 e150926
버킷 이전 (#135)
mjy926 ab6d4b9
Merge pull request #137 from wafflestudio/develop
mjy926 343cbb0
feat: add password reset flow
snu-BuMinSeong 7961c94
fix auth password reset flow
snu-BuMinSeong daed57b
Use OCI Email Delivery SDK
snu-BuMinSeong 193119f
Address password reset review feedback
snu-BuMinSeong 7d459f4
Fix OCI email message ID format
snu-BuMinSeong c003097
Validate email sender config
snu-BuMinSeong 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| from .views import v3_router as router | ||
|
|
||
| __all__ = ["router"] |
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
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
Empty file.
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,42 @@ | ||
| from pydantic import BaseSettings | ||
|
|
||
| from wacruit.src.secrets import OCISecretManager | ||
| from wacruit.src.settings import settings | ||
|
|
||
| _MAIL_SECRET_KEYS = { | ||
| "smtp_host": "host", | ||
| "smtp_port": "port", | ||
| "smtp_username": "username", | ||
| "smtp_password": "password", | ||
| "smtp_from_email": "from_email", | ||
| } | ||
|
|
||
|
|
||
| class MailConfig(BaseSettings): | ||
| host: str = "" | ||
| port: int = 587 | ||
| username: str = "" | ||
| password: str = "" | ||
| from_email: str = "" | ||
| use_tls: bool = True | ||
|
|
||
| class Config(BaseSettings.Config): | ||
| case_sensitive = False | ||
| env_prefix = "SMTP_" | ||
| env_file = settings.env_files | ||
|
|
||
| def __init__(self): | ||
| super().__init__() | ||
| secret_manager = OCISecretManager() | ||
| if secret_manager.is_available(): | ||
| self._load_from_vault(secret_manager) | ||
|
|
||
| def _load_from_vault(self, secret_manager: OCISecretManager) -> None: | ||
| for secret_key, attr_name in _MAIL_SECRET_KEYS.items(): | ||
| value: str | int = secret_manager.get_secret(secret_key) | ||
| if attr_name == "port": | ||
| value = int(value) | ||
| setattr(self, attr_name, value) | ||
|
|
||
|
|
||
| mail_config = MailConfig() |
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,11 @@ | ||
| from wacruit.src.apps.common.exceptions import WacruitException | ||
|
|
||
|
|
||
| class MailConfigException(WacruitException): | ||
| def __init__(self): | ||
| super().__init__(status_code=500, detail="메일 설정이 올바르지 않습니다.") | ||
|
|
||
|
|
||
| class MailSendFailedException(WacruitException): | ||
| def __init__(self): | ||
| super().__init__(status_code=502, detail="메일 전송에 실패했습니다.") |
Oops, something went wrong.
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.