Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# NextMCP OAuth Integration Testing Environment Variables
#
# This file is a template for setting up OAuth credentials for integration testing.
# Copy this file to .env and fill in your actual values.
#
# Setup Instructions:
# 1. Copy this file: cp .env.example .env
# 2. Follow docs/OAUTH_TESTING_SETUP.md to get your credentials
# 3. Use examples/auth/oauth_token_helper.py to obtain tokens
# 4. Fill in the values below
# 5. Load with: export $(cat .env | xargs)
# 6. Run tests: pytest tests/test_oauth_integration.py -v -m integration
#
# IMPORTANT: Never commit .env files! They contain secrets.
# The .env file is already in .gitignore.

# =============================================================================
# GITHUB OAUTH CREDENTIALS
# =============================================================================
# Get these from: https://github.com/settings/developers
# Create a new OAuth App with callback URL: http://localhost:8080/oauth/callback

GITHUB_CLIENT_ID=your_github_client_id_here
GITHUB_CLIENT_SECRET=your_github_client_secret_here

# Get this token by running:
# python examples/auth/oauth_token_helper.py --provider github
# Or follow manual instructions in docs/OAUTH_TESTING_SETUP.md
GITHUB_ACCESS_TOKEN=gho_your_github_access_token_here

# =============================================================================
# GOOGLE OAUTH CREDENTIALS
# =============================================================================
# Get these from: https://console.cloud.google.com
# Create OAuth 2.0 credentials with callback URL: http://localhost:8080/oauth/callback
# Enable APIs: Google Drive API, Gmail API

GOOGLE_CLIENT_ID=your_google_client_id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your_google_client_secret_here

# Get these tokens by running:
# python examples/auth/oauth_token_helper.py --provider google
# Or follow manual instructions in docs/OAUTH_TESTING_SETUP.md
GOOGLE_ACCESS_TOKEN=ya29.your_google_access_token_here

# Refresh token (optional, for token refresh tests)
# Only issued on first authorization with offline access
GOOGLE_REFRESH_TOKEN=1//your_google_refresh_token_here

# =============================================================================
# LOADING INSTRUCTIONS
# =============================================================================
# Option 1: Load into current shell
# export $(cat .env | xargs)
#
# Option 2: Load with grep to filter comments
# export $(grep -v '^#' .env | xargs)
#
# Option 3: Source in your shell config
# Add to ~/.bashrc or ~/.zshrc:
# if [ -f /path/to/nextmcp/.env ]; then
# export $(cat /path/to/nextmcp/.env | grep -v '^#' | xargs)
# fi
#
# Option 4: Use python-dotenv in tests
# from dotenv import load_dotenv
# load_dotenv()

# =============================================================================
# VERIFICATION
# =============================================================================
# Verify environment variables are set:
# echo $GITHUB_CLIENT_ID
# echo $GITHUB_ACCESS_TOKEN
# echo $GOOGLE_CLIENT_ID
# echo $GOOGLE_ACCESS_TOKEN
#
# Run integration tests:
# pytest tests/test_oauth_integration.py -v -m integration
#
# Run specific provider tests:
# pytest tests/test_oauth_integration.py::TestGitHubOAuthIntegration -v
# pytest tests/test_oauth_integration.py::TestGoogleOAuthIntegration -v
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ ENV/
# Environment variables
.env
.env.local
.env.test
.env.production
*_credentials.json
*_token.json

# But DO track the example file
!.env.example

# Testing
.pytest_cache/
Expand Down
Loading
Loading