- Sort Score
- Num 10 results
- Language All
Results 71 - 80 of 1,006 for Security (0.04 seconds)
-
tests/test_security_api_key_cookie_optional.py
from fastapi import Depends, FastAPI, Security from fastapi.security import APIKeyCookie from fastapi.testclient import TestClient from inline_snapshot import snapshot from pydantic import BaseModel app = FastAPI() 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
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) -
tests/test_security_oauth2_authorization_code_bearer.py
from fastapi import FastAPI, Security from fastapi.security import OAuth2AuthorizationCodeBearer from fastapi.testclient import TestClient from inline_snapshot import snapshot app = FastAPI() oauth2_scheme = OAuth2AuthorizationCodeBearer( authorizationUrl="authorize", tokenUrl="token", auto_error=True ) @app.get("/items/") async def read_items(token: str | None = Security(oauth2_scheme)): return {"token": token}
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/zh/docs/advanced/security/index.md
# 高级安全 { #advanced-security } ## 附加特性 { #additional-features } 除 [教程 - 用户指南: 安全性](../../tutorial/security/index.md) 中涵盖的功能之外,还有一些额外的功能来处理安全性。 /// tip | 提示 接下来的章节**并不一定是 "高级的"**。 而且对于你的使用场景来说,解决方案很可能就在其中。 /// ## 先阅读教程 { #read-the-tutorial-first } 接下来的部分假设你已经阅读了主要的 [教程 - 用户指南: 安全性](../../tutorial/security/index.md)。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:06:37 GMT 2026 - 626 bytes - Click Count (0) -
tests/test_security_api_key_header_description.py
from fastapi import Depends, FastAPI, Security from fastapi.security import APIKeyHeader from fastapi.testclient import TestClient from inline_snapshot import snapshot from pydantic import BaseModel app = FastAPI() api_key = APIKeyHeader(name="key", description="An API Key Header") class User(BaseModel): username: str def get_current_user(oauth_header: str = Security(api_key)): user = User(username=oauth_header)
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_openid_connect_optional.py
from fastapi import Depends, FastAPI, Security from fastapi.security.open_id_connect_url import OpenIdConnect from fastapi.testclient import TestClient from inline_snapshot import snapshot from pydantic import BaseModel app = FastAPI() oid = OpenIdConnect(openIdConnectUrl="/openid", auto_error=False) class User(BaseModel): username: str def get_current_user(oauth_header: str | None = Security(oid)): if oauth_header is None:
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 2.6K bytes - Click Count (0) -
tests/test_security_oauth2_authorization_code_bearer_scopes_openapi_simple.py
# Ref: https://github.com/fastapi/fastapi/issues/14454 from typing import Annotated from fastapi import Depends, FastAPI, Security from fastapi.security import OAuth2AuthorizationCodeBearer from fastapi.testclient import TestClient from inline_snapshot import snapshot oauth2_scheme = OAuth2AuthorizationCodeBearer( authorizationUrl="api/oauth/authorize", tokenUrl="/api/oauth/token", scopes={"read": "Read access", "write": "Write access"},
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Dec 17 21:25:59 GMT 2025 - 2.6K bytes - Click Count (0) -
pyproject.toml
"docs_src/security/tutorial004_an_py310.py" = ["B904"] "docs_src/security/tutorial004_an_py39.py" = ["B904"] "docs_src/security/tutorial004_py310.py" = ["B904"] "docs_src/security/tutorial004_py39.py" = ["B904"] "docs_src/security/tutorial005_an_py310.py" = ["B904"] "docs_src/security/tutorial005_an_py39.py" = ["B904"] "docs_src/security/tutorial005_py310.py" = ["B904"]
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Mon Mar 23 12:36:49 GMT 2026 - 10.3K bytes - Click Count (0) -
docs/ko/docs/advanced/security/http-basic-auth.md
* `HTTPBasic`과 `HTTPBasicCredentials`를 임포트합니다. * `HTTPBasic`을 사용해 "`security` scheme"을 생성합니다. * *경로 처리*에서 dependency로 해당 `security`를 사용합니다. * `HTTPBasicCredentials` 타입의 객체를 반환합니다: * 전송된 `username`과 `password`를 포함합니다. {* ../../docs_src/security/tutorial006_an_py310.py hl[4,8,12] *} 처음으로 URL을 열어보면(또는 문서에서 "Execute" 버튼을 클릭하면) 브라우저가 사용자명과 비밀번호를 물어봅니다: <img src="/img/tutorial/security/image12.png"> ## 사용자명 확인하기 { #check-the-username }
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:06:26 GMT 2026 - 5.9K bytes - Click Count (0) -
docs_src/security/tutorial006_an_py310.py
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 361 bytes - Click Count (0) -
internal/config/browser/help.go
Help = config.HelpKVS{ config.HelpKV{ Key: browserCSPPolicy, Description: `set Content-Security-Policy response header value` + defaultHelpPostfix(browserCSPPolicy), Optional: true, Type: "string", }, config.HelpKV{ Key: browserHSTSSeconds, Description: `set Strict-Transport-Security 'max-age' amount of seconds value` + defaultHelpPostfix(browserHSTSSeconds), Optional: true,Created: Sun Apr 05 19:28:12 GMT 2026 - Last Modified: Mon Jan 01 16:36:33 GMT 2024 - 2.1K bytes - Click Count (0)