-
Notifications
You must be signed in to change notification settings - Fork 1
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
トークン発行API #12
トークン発行API #12
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@furutahidehiko
パスワード認証しかない気がします
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@furutahidehiko
ざっくりみてコメントしておきました。
81624e6
to
9115af5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@furutahidehiko
コメントを消し忘れの部分と変数名の部分の対応をお願いします
05ba600
to
3480947
Compare
@takuron1996 3480947 |
メモ:
今回の対応には直接影響ないかつため一旦別で対応しようと思ってます 対応方法 2024/03/23 追記 |
@furutahidehiko |
以下でpasslib でなくbcryptを使ってハッシュ化するように修正しました |
@@ -13,7 +13,6 @@ asyncpg = "^0.28.0" | |||
alembic = "^1.12.0" | |||
ulid-py = "^1.1.0" | |||
bcrypt = "^4.0.1" | |||
passlib = { version = "^1.7.4", extras = ["bcrypt"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[memo]
passlib使わなくなったので不要かなと思い削除しました
"""設定したパスワードと一致するかどうかを検証.""" | ||
input_password_hash = password.encode("utf-8") | ||
hashed_password = self._password.encode("utf-8") | ||
return bcrypt.checkpw(input_password_hash, hashed_password) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[memo]
設定したパスワード(userテーブルに保存されたデータ)と入力されたパスワードが一致しているか確認するためにエンコードする。
bcrypt.checkpwでinput_password_hash(入力されたパスワード)とhashed_password (設定したパスワード)の突き合わせを実施
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
やったこと
- swagger-uiの導入
- APIキーの生成
- エンドポイントへの認証の適用
動作確認
ID/パスワード
リフレッシュトークン