MCPcopy Create free account
hub / github.com/google/adk-python / create_oauth2_auth_config

Function create_oauth2_auth_config

tests/unittests/auth/test_toolset_auth.py:65–84  ·  view source on GitHub ↗

Create a sample OAuth2 auth config for testing.

()

Source from the content-addressed store, hash-verified

63
64
65def create_oauth2_auth_config() -> AuthConfig:
66 """Create a sample OAuth2 auth config for testing."""
67 return AuthConfig(
68 auth_scheme=OAuth2(
69 flows=OAuthFlows(
70 authorizationCode=OAuthFlowAuthorizationCode(
71 authorizationUrl="https://example.com/auth",
72 tokenUrl="https://example.com/token",
73 scopes={"read": "Read access"},
74 )
75 )
76 ),
77 raw_auth_credential=AuthCredential(
78 auth_type=AuthCredentialTypes.OAUTH2,
79 oauth2=OAuth2Auth(
80 client_id="test_client_id",
81 client_secret="test_client_secret",
82 ),
83 ),
84 )
85
86
87class TestToolsetAuthPrefixConstant:

Calls 3

AuthConfigClass · 0.90
AuthCredentialClass · 0.90
OAuth2AuthClass · 0.90

Tested by

no test coverage detected