Ctrl + K
DocumentationLog inGet started

tessl/pypi-google-auth-oauthlib

tessl install tessl/pypi-google-auth-oauthlib@1.2.0

Google Authentication Library - oauthlib integration for OAuth 2.0 flows.

Agent Success

Agent success rate when using this tile

83%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.05x

Baseline

Agent success rate without this tile

79%

task.mdevals/scenario-6/

OAuth Session Configuration Manager

A utility that loads OAuth 2.0 client configuration from JSON files and creates properly configured OAuth sessions for accessing protected APIs.

Capabilities

Load Client Configuration

Loads OAuth 2.0 client configuration from a JSON file and extracts the necessary OAuth parameters.

  • Given a valid client secrets file with "installed" client type, extracts and returns the client configuration @test
  • Given a valid client secrets file with "web" client type, extracts and returns the client configuration @test
  • Given a file path that does not exist, raises an appropriate error @test

Validate Configuration

Validates that OAuth client configuration contains all required fields before creating a session.

  • Given a configuration with all required fields (auth_uri, token_uri, client_id), validation passes @test
  • Given a configuration missing auth_uri, raises a validation error @test
  • Given a configuration missing client_id, raises a validation error @test

Create OAuth Session

Creates a configured OAuth 2.0 session instance that can be used for authorization flows.

  • Given valid client configuration and scopes, creates an OAuth session with the correct parameters @test
  • Given client configuration and multiple scopes, creates a session configured with all specified scopes @test

Implementation

@generates

API

def load_client_config(file_path: str) -> dict:
    """
    Load OAuth 2.0 client configuration from a JSON file.

    Args:
        file_path: Path to the client secrets JSON file

    Returns:
        Dictionary containing the OAuth client configuration

    Raises:
        FileNotFoundError: If the file does not exist
        ValueError: If the file format is invalid
    """
    pass


def validate_config(config: dict) -> bool:
    """
    Validate that OAuth client configuration contains required fields.

    Args:
        config: OAuth client configuration dictionary

    Returns:
        True if configuration is valid

    Raises:
        ValueError: If required fields are missing
    """
    pass


def create_oauth_session(config: dict, scopes: list) -> object:
    """
    Create an OAuth 2.0 session from client configuration.

    Args:
        config: OAuth client configuration dictionary
        scopes: List of OAuth 2.0 scopes to request

    Returns:
        Configured OAuth2Session instance

    Raises:
        ValueError: If configuration is invalid
    """
    pass

Dependencies { .dependencies }

google-auth-oauthlib { .dependency }

Provides OAuth 2.0 integration with Google's authentication library, including utilities for creating OAuth sessions from client configuration.

@satisfied-by

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/google-auth-oauthlib@1.2.x
tile.json