- Sort Score
- Result 10 results
- Languages All
Results 41 - 50 of 225 for ME (0.12 sec)
-
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"})
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 1.7K bytes - Viewed (0) -
tests/test_security_http_base_optional.py
client = TestClient(app) def test_security_http_base(): response = client.get("/users/me", headers={"Authorization": "Other foobar"}) assert response.status_code == 200, response.text assert response.json() == {"scheme": "Other", "credentials": "foobar"} def test_security_http_base_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 - 1.9K bytes - Viewed (0) -
tests/test_security_api_key_query_optional.py
return user @app.get("/users/me") def read_current_user(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_api_key(): response = client.get("/users/me?key=secret") assert response.status_code == 200, response.text
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 2K 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) -
docs/zh/docs/advanced/security/oauth2-scopes.md
它们会为每个*路径操作*进行单独检查。 ## 查看文档 打开 API 文档,进行身份验证,并指定要授权的作用域。 <img src="/img/tutorial/security/image11.png"> 没有选择任何作用域,也可以进行**身份验证**,但访问 `/uses/me` 或 `/users/me/items` 时,会显示没有足够的权限。但仍可以访问 `/status/`。 如果选择了作用域 `me`,但没有选择作用域 `items`,则可以访问 `/users/me/`,但不能访问 `/users/me/items`。 这就是通过用户提供的令牌使用第三方应用访问这些*路径操作*时会发生的情况,具体怎样取决于用户授予第三方应用的权限。 ## 关于第三方集成 本例使用 OAuth2 **密码**流。 这种方式适用于登录我们自己的应用,最好使用我们自己的前端。
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 30 22:43:35 GMT 2024 - 11.8K 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) -
guava-tests/test/com/google/common/base/VerifyTest.java
fail(); } catch (VerifyException expected) { assertThat(expected).hasMessageThat().isEqualTo("message"); } } public void testVerify_complexMessage_success() { verify(true, "%s", IGNORE_ME); } public void testVerify_complexMessage_failure() { try { verify(false, FORMAT, 5); fail(); } catch (VerifyException expected) { checkMessage(expected); } }
Java - Registered: Fri Apr 19 12:43:09 GMT 2024 - Last Modified: Thu May 04 09:41:29 GMT 2023 - 3.2K bytes - Viewed (0) -
guava-tests/test/com/google/common/collect/ComparisonChainTest.java
.compare("a", "b") .compare(DONT_COMPARE_ME, DONT_COMPARE_ME) .result()) .isLessThan(0); } public void testShortCircuitGreater() { assertThat( ComparisonChain.start() .compare("b", "a") .compare(DONT_COMPARE_ME, DONT_COMPARE_ME) .result()) .isGreaterThan(0); }
Java - Registered: Fri Apr 19 12:43:09 GMT 2024 - Last Modified: Tue Feb 27 13:27:08 GMT 2024 - 7.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) -
tests/test_security_api_key_cookie.py
user = User(username=oauth_header) return user @app.get("/users/me") def read_current_user(current_user: User = Depends(get_current_user)): return current_user def test_security_api_key(): client = TestClient(app, cookies={"key": "secret"}) response = client.get("/users/me") assert response.status_code == 200, response.text assert response.json() == {"username": "secret"}
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 1.9K bytes - Viewed (0)