@mcp-z/oauth-google
    Preparing search index...

    Function parseDcrConfig

    • Parse DCR configuration from CLI arguments and environment variables.

      CLI Arguments:

      • --dcr-mode: DCR mode ('self-hosted' | 'external')
        • Default: 'self-hosted' (if flag is omitted)
      • --dcr-verify-url: External verification endpoint URL (required for external mode)
      • --dcr-store-uri: DCR client storage URI (required for self-hosted mode)

      Required environment variables:

      • GOOGLE_CLIENT_ID: OAuth 2.0 client ID from Google Cloud Console

      Optional environment variables:

      • GOOGLE_CLIENT_SECRET: OAuth 2.0 client secret (optional for public clients)
      • DCR_MODE: DCR mode (same format as --dcr-mode flag)
      • DCR_VERIFY_URL: External verification URL (same as --dcr-verify-url flag)
      • DCR_STORE_URI: DCR storage URI (same as --dcr-store-uri flag)

      Parameters

      • args: string[]

        CLI arguments array (typically process.argv)

      • env: Record<string, string | undefined>

        Environment variables object (typically process.env)

      • scope: string

        OAuth scopes to request (space-separated)

      Returns DcrConfig

      Parsed DCR configuration

      Error if required environment variables are missing or validation fails

      const config = parseDcrConfig(
      ['--dcr-mode=self-hosted', '--dcr-store-uri=file:///path/to/store.json'],
      process.env,
      'https://www.googleapis.com/auth/drive.readonly'
      );
      const config = parseDcrConfig(
      ['--dcr-mode=external', '--dcr-verify-url=https://auth0.example.com/verify'],
      process.env,
      'https://www.googleapis.com/auth/drive.readonly'
      );