- Sort Score
- Result 10 results
- Languages All
Results 71 - 80 of 119 for me (0.13 sec)
-
docs_src/bigger_applications/app_an/routers/users.py
from fastapi import APIRouter router = APIRouter() @router.get("/users/", tags=["users"]) async def read_users(): return [{"username": "Rick"}, {"username": "Morty"}] @router.get("/users/me", tags=["users"]) async def read_user_me(): return {"username": "fakecurrentuser"} @router.get("/users/{username}", tags=["users"]) async def read_user(username: str):
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 407 bytes - Viewed (0) -
docs/en/docs/advanced/security/oauth2-scopes.md
If you don't select any scope, you will be "authenticated", but when you try to access `/users/me/` or `/users/me/items/` you will get an error saying that you don't have enough permissions. You will still be able to access `/status/`. And if you select the scope `me` but not the scope `items`, you will be able to access `/users/me/` but not `/users/me/items/`.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Jan 11 21:21:35 GMT 2024 - 20.5K bytes - Viewed (0) -
tests/test_tutorial/test_security/test_tutorial005_an_py310.py
}, } }, "summary": "Read Users Me", "operationId": "read_users_me_users_me__get", "security": [{"OAuth2PasswordBearer": ["me"]}], } }, "/users/me/items/": { "get": { "responses": { "200": {
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) -
docs_src/security/tutorial006.py
from fastapi import Depends, FastAPI from fastapi.security import HTTPBasic, HTTPBasicCredentials app = FastAPI() security = HTTPBasic() @app.get("/users/me") def read_current_user(credentials: HTTPBasicCredentials = Depends(security)):
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 321 bytes - Viewed (0) -
docs/em/docs/tutorial/security/simple-oauth2.md
๐: `secret` <img src="/img/tutorial/security/image04.png"> โฎ๏ธ ๐ โ๏ธ, ๐ ๐ ๐ โซ๏ธ ๐: <img src="/img/tutorial/security/image05.png"> ### ๐ค ๐ ๐ ๐ฉโ๐ป ๐ฝ ๐ โ๏ธ ๐ ๏ธ `GET` โฎ๏ธ โก `/users/me`. ๐ ๐ ๐ค ๐ ๐ฉโ๐ป ๐, ๐: ```JSON { "username": "johndoe", "email": "******@****.***", "full_name": "John Doe", "disabled": false, "hashed_password": "fakehashedsecret" }
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) -
docs_src/security/tutorial004_py310.py
) return Token(access_token=access_token, token_type="bearer") @app.get("/users/me/", response_model=User) async def read_users_me(current_user: User = Depends(get_current_active_user)): return current_user @app.get("/users/me/items/") async def read_own_items(current_user: User = Depends(get_current_active_user)):
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Mar 26 16:56:53 GMT 2024 - 4K bytes - Viewed (0) -
docs/es/docs/tutorial/path-params.md
Digamos algo como `/users/me` que sea para obtener datos del usuario actual. ... y luego puedes tener el path `/users/{user_id}` para obtener los datos sobre un usuario especรญfico asociados a un ID de usuario. Porque las *operaciones de path* son evaluadas en orden, tienes que asegurarte de que el path para `/users/me` sea declarado antes que el path para `/users/{user_id}`:
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 9.4K bytes - Viewed (0) -
tests/test_security_http_digest_optional.py
client = TestClient(app) def test_security_http_digest(): response = client.get("/users/me", headers={"Authorization": "Digest foobar"}) assert response.status_code == 200, response.text assert response.json() == {"scheme": "Digest", "credentials": "foobar"} def test_security_http_digest_no_credentials(): response = client.get("/users/me") assert response.status_code == 200, response.text
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 2.2K bytes - Viewed (0) -
tests/test_tutorial/test_security/test_tutorial006_an_py39.py
@needs_py39 def test_security_http_basic(client: TestClient): response = client.get("/users/me", auth=("john", "secret")) assert response.status_code == 200, response.text assert response.json() == {"username": "john", "password": "secret"} @needs_py39 def test_security_http_basic_no_credentials(client: TestClient): response = client.get("/users/me") assert response.json() == {"detail": "Not authenticated"}
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 2.5K bytes - Viewed (0) -
tests/test_tutorial/test_security/test_tutorial003.py
def test_no_token(): response = client.get("/users/me") assert response.status_code == 401, response.text assert response.json() == {"detail": "Not authenticated"} assert response.headers["WWW-Authenticate"] == "Bearer" def test_token(): response = client.get("/users/me", headers={"Authorization": "Bearer johndoe"}) assert response.status_code == 200, response.text
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 8K bytes - Viewed (0)