Results of 1 - 6 of about 6 for johndoe (0.010 sec.)
- Simple OAuth2 with Password and Bearer 11497
- Simple OAuth2 with Password and Bearer Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . Now let's build from the previous chapter and add the missing parts to have
...fastapi.security import OAuth2PasswordBearer , OAuth2PasswordRequestForm from pydantic import BaseModel fake_users_db = { "johndoe" : { "username" : "johndoe" , "full_name" : "John Doe" , "email" : "johndoe@example.com" , "hashed_password" : "fakehashed...fastapi.security import OAuth2PasswordBearer , OAuth2PasswordRequestForm from pydantic import BaseModel fake_users_db = { "johndoe" : { "username" : "johndoe" , "full_name" : "John Doe" , "email" : "johndoe@example.com" , "hashed_password" : "fakehashed...arer , OAuth2PasswordRequestForm from pydantic import BaseModel from typing_extensions import Annotated fake_users_db = { "johndoe" : { "username" : "johndoe" , "full_name" : "John Doe" , "email" : "johndoe@example.com" , "hashed_password" : "fakehashed... - https://man.mtool.work/fastapi/0.115/tutorial/security/simple-oauth2/
- OAuth2 scopes 10803
- OAuth2 scopes Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You can use OAuth2 scopes directly with FastAPI , they are integrated to work seamlessly. This would
...2556c818166b7a9563b93f7099f6f0f4caa6cf63b88e8d3e7" ALGORITHM = "HS256" ACCESS_TOKEN_EXPIRE_MINUTES = 30 fake_users_db = { "johndoe" : { "username" : "johndoe" , "full_name" : "John Doe" , "email" : "johndoe@example.com" , "hashed_password" : "$2b$12$Eix...2556c818166b7a9563b93f7099f6f0f4caa6cf63b88e8d3e7" ALGORITHM = "HS256" ACCESS_TOKEN_EXPIRE_MINUTES = 30 fake_users_db = { "johndoe" : { "username" : "johndoe" , "full_name" : "John Doe" , "email" : "johndoe@example.com" , "hashed_password" : "$2b$12$Eix...2556c818166b7a9563b93f7099f6f0f4caa6cf63b88e8d3e7" ALGORITHM = "HS256" ACCESS_TOKEN_EXPIRE_MINUTES = 30 fake_users_db = { "johndoe" : { "username" : "johndoe" , "full_name" : "John Doe" , "email" : "johndoe@example.com" , "hashed_password" : "$2b$12$Eix... - https://man.mtool.work/fastapi/0.115/advanced/security/oauth2-scopes/
- パスワード(およびハッシュ化)によるOAuth2、JWTトークンによるBearer 10492
- パスワード(およびハッシュ化)によるOAuth2、JWTトークンによるBearer これでセキュリティの流れが全てわかったので、 JWT トークンと安全なパスワードのハッシュ化を使用して、実際にアプリケーションを安全にしてみましょう。 このコードは、アプリケーシ
...2556c818166b7a9563b93f7099f6f0f4caa6cf63b88e8d3e7" ALGORITHM = "HS256" ACCESS_TOKEN_EXPIRE_MINUTES = 30 fake_users_db = { "johndoe" : { "username" : "johndoe" , "full_name" : "John Doe" , "email" : "johndoe@example.com" , "hashed_password" : "$2b$12$Eix...2556c818166b7a9563b93f7099f6f0f4caa6cf63b88e8d3e7" ALGORITHM = "HS256" ACCESS_TOKEN_EXPIRE_MINUTES = 30 fake_users_db = { "johndoe" : { "username" : "johndoe" , "full_name" : "John Doe" , "email" : "johndoe@example.com" , "hashed_password" : "$2b$12$Eix...2556c818166b7a9563b93f7099f6f0f4caa6cf63b88e8d3e7" ALGORITHM = "HS256" ACCESS_TOKEN_EXPIRE_MINUTES = 30 fake_users_db = { "johndoe" : { "username" : "johndoe" , "full_name" : "John Doe" , "email" : "johndoe@example.com" , "hashed_password" : "$2b$12$Eix... - https://man.mtool.work/fastapi/0.115/tutorial/security/oauth2-jwt/
- HTTP Basic Auth 7512
- HTTP Basic Auth Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . For the simplest cases, you can use HTTP Basic Auth. In HTTP Basic Auth, the application expects a
...tack"? Let's imagine some attackers are trying to guess the username and password. And they send a request with a username johndoe and a password love123 . Then the Python code in your application would be equivalent to something like: if "johndoe" == "...stanleyjobson" and "love123" == "swordfish" : ... But right at the moment Python compares the first j in johndoe to the first s in stanleyjobson , it will return False , because it already knows that those two strings are not the same,...letters were right. And then they can try again knowing that it's probably something more similar to stanleyjobsox than to johndoe . A "professional" attack Of course, the attackers would not try all this by hand, they would write a program to do it, po... - https://man.mtool.work/fastapi/0.115/advanced/security/http-basic-auth/
- Path Operationの設定 7256
- Path Operationの設定 path operationデコレータ を設定するためのパラメータがいくつかあります。 注意 これらのパラメータは path operation関数 ではなく、 path operationデコレータ に直接渡されることに注意してください。 レスポンスステータスコード
...e" : "Foo" , "price" : 42 }] @app . get ( "/users/" , tags = [ "users" ]) async def read_users (): return [{ "username" : "johndoe" }] ? Other versions and variants Python 3.10+ Python 3.9+ from fastapi import FastAPI from pydantic import BaseModel app...e" : "Foo" , "price" : 42 }] @app . get ( "/users/" , tags = [ "users" ]) async def read_users (): return [{ "username" : "johndoe" }] from typing import Union from fastapi import FastAPI from pydantic import BaseModel app = FastAPI () class Item ( Base...e" : "Foo" , "price" : 42 }] @app . get ( "/users/" , tags = [ "users" ]) async def read_users (): return [{ "username" : "johndoe" }] これらはOpenAPIスキーマに追加され、自動ドキュメントのインターフェースで使用されます: 概要と説明 summary と description... - https://man.mtool.work/fastapi/0.115/tutorial/path-operation-configuration/
- パスパラメータ 7220
- パスパラメータ Pythonのformat文字列と同様のシンタックスで「パスパラメータ」や「パス変数」を宣言できます: Python 3.8+ from fastapi import FastAPI app = FastAPI () @app . get ( "/items/ {item_id} " ) async def read_item ( item_id ): return {
...FTW!" } パスを含んだパスパラメータ パス /files/{file_path} となる path operation を持っているとしましょう。 ただし、 home/johndoe/myfile.txt のような パス を含んだ file_path が必要です。 したがって、URLは /files/home/johndoe/myfile.txt の様になります。...sync def read_file ( file_path : str ): return { "file_path" : file_path } 豆知識 最初のスラッシュ ( / )が付いている /home/johndoe/myfile.txt をパラメータが含んでいる必要があります。 この場合、URLは files と home の間にダブルスラッシュ ( // ) のある、 /...files//home/johndoe/myfile.txt になります。 まとめ 簡潔で、本質的で、標準的なPythonの型宣言を使用することで、 FastAPI は以下を行います: エディ... - https://man.mtool.work/fastapi/0.115/tutorial/path-params/
PREV
1
NEXT