Create a sample OAuth2 auth config for testing.
()
| 63 | |
| 64 | |
| 65 | def 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 | |
| 87 | class TestToolsetAuthPrefixConstant: |
no test coverage detected