- Sort Score
- Num 10 results
- Language All
Results 61 - 70 of 707 for users1 (0.04 seconds)
The search processing time has exceeded the limit. The displayed results may be partial.
-
docs/en/docs/tutorial/bigger-applications.md
### Include the `APIRouter`s for `users` and `items` { #include-the-apirouters-for-users-and-items } Now, let's include the `router`s from the submodules `users` and `items`: {* ../../docs_src/bigger_applications/app_an_py310/main.py hl[10:11] title["app/main.py"] *} /// info `users.router` contains the `APIRouter` inside of the file `app/routers/users.py`.Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Mar 07 09:29:03 GMT 2026 - 19.2K bytes - Click Count (0) -
tests/test_security_api_key_cookie_optional.py
api_key = APIKeyCookie(name="key", auto_error=False) class User(BaseModel): username: str def get_current_user(oauth_header: str | None = Security(api_key)): if oauth_header is None: return None user = User(username=oauth_header) return user @app.get("/users/me") def read_current_user(current_user: User = Depends(get_current_user)): if current_user is None:
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 2.2K bytes - Click Count (0) -
docs/ru/docs/tutorial/bigger-applications.md
### Подключение `APIRouter` для `users` и `items` { #include-the-apirouters-for-users-and-items } Теперь давайте подключим `router` из подмодулей `users` и `items`: {* ../../docs_src/bigger_applications/app_an_py310/main.py hl[10:11] title["app/main.py"] *} /// info | Примечание `users.router` содержит `APIRouter` из файла `app/routers/users.py`.Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 17:56:20 GMT 2026 - 29.7K bytes - Click Count (0) -
tests/test_security_http_basic_optional.py
@app.get("/users/me") def read_current_user(credentials: HTTPBasicCredentials | None = Security(security)): if credentials is None: return {"msg": "Create an account first"} return {"username": credentials.username, "password": credentials.password} client = TestClient(app) def test_security_http_basic(): response = client.get("/users/me", auth=("john", "secret"))
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 2.7K bytes - Click Count (0) -
docs/de/docs/tutorial/bigger-applications.md
### Die `APIRouter` für `users` und `items` inkludieren { #include-the-apirouters-for-users-and-items } Inkludieren wir nun die `router` aus diesen Submodulen `users` und `items`: {* ../../docs_src/bigger_applications/app_an_py310/main.py hl[10:11] title["app/main.py"] *} /// info | Info `users.router` enthält den `APIRouter` in der Datei `app/routers/users.py`.Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 17:58:09 GMT 2026 - 21.9K bytes - Click Count (0) -
docs/tr/docs/tutorial/security/get-current-user.md
## Kullanıcıyı alın { #get-the-user } `get_current_user`, oluşturduğumuz (sahte) bir yardımcı (utility) fonksiyonu kullanacak; bu fonksiyon `str` olarak bir token alır ve Pydantic `User` modelimizi döndürür: {* ../../docs_src/security/tutorial002_an_py310.py hl[19:22,26:27] *} ## Mevcut kullanıcıyı enjekte edin { #inject-the-current-user }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Feb 13 12:41:38 GMT 2026 - 4.4K bytes - Click Count (0) -
docs/zh/docs/tutorial/security/get-current-user.md
## 获取用户 { #get-the-user } `get_current_user` 使用创建的(伪)工具函数,该函数接收 `str` 类型的令牌,并返回 Pydantic 的 `User` 模型: {* ../../docs_src/security/tutorial002_an_py310.py hl[19:22,26:27] *} ## 注入当前用户 { #inject-the-current-user } 在*路径操作* 的 `Depends` 中使用 `get_current_user`: {* ../../docs_src/security/tutorial002_an_py310.py hl[31] *} 注意,此处把 `current_user` 的类型声明为 Pydantic 的 `User` 模型。 这有助于在函数内部使用代码补全和类型检查。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Feb 13 13:37:57 GMT 2026 - 3.6K bytes - Click Count (0) -
docs/zh-hant/docs/tutorial/bigger-applications.md
### 將 `users` 與 `items` 的 `APIRouter` 納入 { #include-the-apirouters-for-users-and-items } 現在,把子模組 `users` 與 `items` 的 `router` 納入: {* ../../docs_src/bigger_applications/app_an_py310/main.py hl[10:11] title["app/main.py"] *} /// info | 資訊 `users.router` 是位於 `app/routers/users.py` 檔案內的 `APIRouter`。 而 `items.router` 是位於 `app/routers/items.py` 檔案內的 `APIRouter`。 ///Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 18.7K bytes - Click Count (0) -
tests/test_security_http_base.py
app = FastAPI() security = HTTPBase(scheme="Other") @app.get("/users/me") def read_current_user(credentials: HTTPAuthorizationCredentials = Security(security)): return {"scheme": credentials.scheme, "credentials": credentials.credentials} client = TestClient(app) def test_security_http_base(): response = client.get("/users/me", headers={"Authorization": "Other foobar"})
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Feb 08 10:18:38 GMT 2026 - 2.2K bytes - Click Count (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
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 2.3K bytes - Click Count (0)