MCPcopy Create free account
hub / github.com/authlib/authlib / assert_func

Function assert_func

tests/clients/test_httpx/test_async_oauth1_client.py:36–44  ·  view source on GitHub ↗
(request)

Source from the content-addressed store, hash-verified

34 request_token = {"oauth_token": "1", "oauth_token_secret": "2"}
35
36 async def assert_func(request):
37 auth_header = request.headers.get("authorization")
38 assert 'oauth_consumer_key="id"' in auth_header
39 assert "oauth_signature=" in auth_header
40
41 params = auth_header[len("OAuth ") :].split(", ")
42 keys = [param.split("=")[0] for param in params]
43 assert len(keys) == len(set(keys))
44 await assert_valid_signature(request)
45
46 transport = ASGITransport(AsyncMockDispatch(request_token, assert_func=assert_func))
47 async with AsyncOAuth1Client("id", "secret", transport=transport) as client:

Callers

nothing calls this directly

Calls 4

bodyMethod · 0.80
decodeMethod · 0.80
assert_valid_signatureFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected