- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 173 for Username (0.29 sec)
-
tests/test_tutorial/test_request_forms/test_tutorial001_an_py39.py
@needs_py39 def test_post_body_form(client: TestClient): response = client.post("/login/", data={"username": "Foo", "password": "secret"}) assert response.status_code == 200 assert response.json() == {"username": "Foo"} @needs_py39 def test_post_body_form_no_password(client: TestClient): response = client.post("/login/", data={"username": "Foo"}) assert response.status_code == 422 assert response.json() == IsDict(
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 7.6K bytes - Viewed (0) -
docs/zh/docs/tutorial/security/simple-oauth2.md
本章添加上一章示例中欠缺的部分,实现完整的安全流。 ## 获取 `username` 和 `password` 首先,使用 **FastAPI** 安全工具获取 `username` 和 `password`。 OAuth2 规范要求使用**密码流**时,客户端或用户必须以表单数据形式发送 `username` 和 `password` 字段。 并且,这两个字段必须命名为 `username` 和 `password` ,不能使用 `user-name` 或 `email` 等其它名称。 不过也不用担心,前端仍可以显示终端用户所需的名称。 数据库模型也可以使用所需的名称。 但对于登录*路径操作*,则要使用兼容规范的 `username` 和 `password`,(例如,实现与 API 文档集成)。 该规范要求必须以表单数据形式发送 `username` 和 `password`,因此,不能使用 JSON 对象。
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 8.8K bytes - Viewed (0) -
docs/zh/docs/tutorial/extra-models.md
```Python UserInDB(**user_dict) ``` 就会生成如下结果: ```Python UserInDB( username="john", password="secret", email="******@****.***", full_name=None, ) ``` 或更精准,直接把可能会用到的内容与 `user_dict` 一起使用: ```Python UserInDB( username = user_dict["username"], password = user_dict["password"], email = user_dict["email"], full_name = user_dict["full_name"],
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Mon Apr 01 01:15:53 GMT 2024 - 6.7K bytes - Viewed (0) -
tests/test_tutorial/test_security/test_tutorial005_an_py310.py
assert response.json() == {"detail": "Incorrect username or password"} @needs_py310 def test_login_incorrect_username(client: TestClient): response = client.post("/token", data={"username": "foo", "password": "secret"}) assert response.status_code == 400, response.text assert response.json() == {"detail": "Incorrect username or password"} @needs_py310 def test_no_token(client: TestClient):
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Wed Mar 13 19:07:10 GMT 2024 - 16.3K bytes - Viewed (0) -
fastapi/security/oauth2.py
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Apr 02 02:48:51 GMT 2024 - 21.1K bytes - Viewed (1) -
docs/de/docs/tutorial/extra-models.md
UserInDB(**user_dict) ``` dann ist das ungefähr äquivalent zu: ```Python UserInDB( username="john", password="secret", email="******@****.***", full_name=None, ) ``` Oder, präziser, `user_dict` wird direkt verwendet, welche Werte es auch immer haben mag: ```Python UserInDB( username = user_dict["username"], password = user_dict["password"], email = user_dict["email"],
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 30 20:26:47 GMT 2024 - 8.7K bytes - Viewed (0) -
docs_src/security/tutorial007_an_py39.py
app = FastAPI() security = HTTPBasic() def get_current_username( credentials: Annotated[HTTPBasicCredentials, Depends(security)], ): current_username_bytes = credentials.username.encode("utf8") correct_username_bytes = b"stanleyjobson" is_correct_username = secrets.compare_digest( current_username_bytes, correct_username_bytes ) current_password_bytes = credentials.password.encode("utf8")
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Mar 26 16:56:53 GMT 2024 - 1.1K bytes - Viewed (0) -
docs_src/security/tutorial005_py310.py
username: str = payload.get("sub") if username is None: raise credentials_exception token_scopes = payload.get("scopes", []) token_data = TokenData(scopes=token_scopes, username=username) except (JWTError, ValidationError): raise credentials_exception user = get_user(fake_users_db, username=token_data.username) if user is None:
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Mar 26 16:56:53 GMT 2024 - 5.1K bytes - Viewed (0) -
docs_src/security/tutorial005_an_py310.py
username: str = payload.get("sub") if username is None: raise credentials_exception token_scopes = payload.get("scopes", []) token_data = TokenData(scopes=token_scopes, username=username) except (JWTError, ValidationError): raise credentials_exception user = get_user(fake_users_db, username=token_data.username) if user is None:
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Mar 26 16:56:53 GMT 2024 - 5.2K bytes - Viewed (0) -
docs/em/docs/tutorial/security/simple-oauth2.md
# 🙅 Oauth2️⃣ ⏮️ 🔐 & 📨 🔜 ➡️ 🏗 ⚪️➡️ ⏮️ 📃 & 🚮 ❌ 🍕 ✔️ 🏁 💂♂ 💧. ## 🤚 `username` & `password` 👥 🔜 ⚙️ **FastAPI** 💂♂ 🚙 🤚 `username` & `password`. Oauth2️⃣ ✔ 👈 🕐❔ ⚙️ "🔐 💧" (👈 👥 ⚙️) 👩💻/👩💻 🔜 📨 `username` & `password` 🏑 📨 💽. & 🔌 💬 👈 🏑 ✔️ 🌟 💖 👈. `user-name` ⚖️ `email` 🚫🔜 👷. ✋️ 🚫 😟, 👆 💪 🎦 ⚫️ 👆 🎋 👆 🏁 👩💻 🕸. & 👆 💽 🏷 💪 ⚙️ 🙆 🎏 📛 👆 💚.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 8.9K bytes - Viewed (0)