- Sort Score
- Result 10 results
- Languages All
Results 41 - 50 of 63 for current_user (0.16 sec)
-
tests/test_security_oauth2_optional_description.py
@app.post("/login") def login(form_data: OAuth2PasswordRequestFormStrict = Depends()): return form_data @app.get("/users/me") def read_users_me(current_user: Optional[User] = Depends(get_current_user)): if current_user is None: return {"msg": "Create an account first"} return current_user client = TestClient(app) def test_security_oauth2():
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 10.9K bytes - Viewed (0) -
docs/pt/docs/tutorial/dependencies/index.md
```mermaid graph TB current_user(["current_user"]) active_user(["active_user"]) admin_user(["admin_user"]) paying_user(["paying_user"]) public["/items/public/"] private["/items/private/"] activate_user["/users/{user_id}/activate"] pro_items["/items/pro/"] current_user --> active_user active_user --> admin_user active_user --> paying_user
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 12.6K bytes - Viewed (0) -
tests/test_security_oauth2.py
def login(form_data: "OAuth2PasswordRequestFormStrict" = Depends()): return form_data @app.get("/users/me") # Here we use string annotations to test them def read_current_user(current_user: "User" = Depends(get_current_user)): return current_user client = TestClient(app) def test_security_oauth2(): response = client.get("/users/me", headers={"Authorization": "Bearer footokenbar"})
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 10.7K bytes - Viewed (0) -
docs/ko/docs/tutorial/dependencies/index.md
```mermaid graph TB current_user(["current_user"]) active_user(["active_user"]) admin_user(["admin_user"]) paying_user(["paying_user"]) public["/items/public/"] private["/items/private/"] activate_user["/users/{user_id}/activate"] pro_items["/items/pro/"] current_user --> active_user active_user --> admin_user active_user --> paying_user
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 13.5K bytes - Viewed (0) -
docs/em/docs/tutorial/security/get-current-user.md
{!> ../../docs_src/security/tutorial002.py!} ``` //// //// tab | ๐ 3๏ธโฃ.1๏ธโฃ0๏ธโฃ & ๐ ```Python hl_lines="29" {!> ../../docs_src/security/tutorial002_py310.py!} ``` //// ๐ ๐ ๐ฅ ๐ฃ ๐ `current_user` Pydantic ๐ท `User`. ๐ ๐ โน ๐บ๐ฒ ๐ ๐ข โฎ๏ธ ๐ ๐ ๏ธ & ๐ โ . /// tip ๐ 5๏ธโฃ๐ ๐ญ ๐ ๐จ ๐ช ๐ฃ โฎ๏ธ Pydantic ๐ท. ๐ฅ **FastAPI** ๐ ๐ซ ๐ค ๐จ โฉ๏ธ ๐ โ๏ธ `Depends`. /// /// check
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 4.3K bytes - Viewed (0) -
docs/zh/docs/tutorial/security/get-current-user.md
{!../../docs_src/security/tutorial002.py!} ``` ## ๆณจๅ ฅๅฝๅ็จๆท ๅจ*่ทฏๅพๆไฝ* ็ `Depends` ไธญไฝฟ็จ `get_current_user`๏ผ ```Python hl_lines="31" {!../../docs_src/security/tutorial002.py!} ``` ๆณจๆ๏ผๆญคๅคๆ `current_user` ็็ฑปๅๅฃฐๆไธบ Pydantic ็ `User` ๆจกๅใ ่ฟๆๅฉไบๅจๅฝๆฐๅ ้จไฝฟ็จไปฃ็ ่กฅๅ จๅ็ฑปๅๆฃๆฅใ /// tip | "ๆ็คบ" ่ฟ่ฎฐๅพ่ฏทๆฑไฝไนๆฏไฝฟ็จ Pydantic ๆจกๅๅฃฐๆ็ๅงใ ๆพๅฟ๏ผๅ ไธบไฝฟ็จไบ `Depends`๏ผ**FastAPI** ไธไผๆๆททใ /// /// check | "ๆฃๆฅ"
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 3.5K bytes - Viewed (0) -
docs/em/docs/tutorial/security/simple-oauth2.md
๐ ๐ณ ๐ ๐ โ๏ธ ๐ ๐ ๐, & โ ๐ญ ๐ โ๏ธ ๐ ๐ป ๐. โซ๏ธ ๐ ๐ด ๐ ๐ ๐ โ๏ธ ๐ญ โ ๐, ๐ ๏ธ โฎ๏ธ ๐ง. ๐, **FastAPI** ๐ต โซ๏ธ ๐. /// ## โน ๐ ๐ ๐ฅ ๐ โน ๐ ๐. ๐ฅ ๐ ๐ค `current_user` *๐ด* ๐ฅ ๐ ๐ฉโ๐ป ๐ฆ. , ๐ฅ โ ๐ ๐ `get_current_active_user` ๐ ๐ โ๏ธ `get_current_user` ๐. ๐ฏโโ๏ธ ๐ ๐ ๐ ๐จ ๐บ๐ธ๐ โ ๐ฅ ๐ฉโ๐ป ๐ซ ๐, โ๏ธ ๐ฅ ๐. , ๐ ๐, ๐ฅ ๐ ๐ด ๐ค ๐ฉโ๐ป ๐ฅ ๐ฉโ๐ป ๐, โ ๐, & ๐ฆ:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 8.8K bytes - Viewed (0) -
docs/en/docs/tutorial/security/simple-oauth2.md
For the rest, **FastAPI** handles it for you. /// ## Update the dependencies Now we are going to update our dependencies. We want to get the `current_user` *only* if this user is active. So, we create an additional dependency `get_current_active_user` that in turn uses `get_current_user` as a dependency.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 12.3K bytes - Viewed (0) -
docs/de/docs/tutorial/security/simple-oauth2.md
Den Rest erledigt **FastAPI** fรผr Sie. /// ## Die Abhรคngigkeiten aktualisieren Jetzt werden wir unsere Abhรคngigkeiten aktualisieren. Wir mรถchten den `current_user` *nur* erhalten, wenn dieser Benutzer aktiv ist. Daher erstellen wir eine zusรคtzliche Abhรคngigkeit `get_current_active_user`, die wiederum `get_current_user` als Abhรคngigkeit verwendet.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 14.1K bytes - Viewed (0) -
docs/de/docs/tutorial/security/get-current-user.md
Bevorzugen Sie die `Annotated`-Version, falls mรถglich. /// ```Python hl_lines="31" {!> ../../docs_src/security/tutorial002.py!} ``` //// Beachten Sie, dass wir als Typ von `current_user` das Pydantic-Modell `User` deklarieren. Das wird uns innerhalb der Funktion bei Codevervollstรคndigung und Typprรผfungen helfen. /// tip | "Tipp"
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 8.3K bytes - Viewed (0)