Skip to content
Closed
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
15 changes: 15 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Confluence Cloud API Configuration
# Copy this file to .secrets/test.env and fill in your actual credentials
# The .secrets/ directory is excluded from git for security

# Your Confluence Cloud URL (e.g., https://your-domain.atlassian.net)
CONFLUENCE_URL=https://your-domain.atlassian.net

# Your Atlassian account email
CONFLUENCE_USERNAME=your-email@domain.com

# Your Confluence API token (generate at: https://id.atlassian.com/manage-profile/security/api-tokens)
CONFLUENCE_API_TOKEN=your-api-token-here

# Optional: Space key for testing (will be created if it doesn't exist)
CONFLUENCE_TEST_SPACE=TESTSPACE
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
.idea
.sonarlint
.pytest_cache

# Development test files (not part of main project)
dev-tests/

# Kiro AI assistant files
.kiro/

# Created by .ignore support plugin (hsz.mobi)
### Python template
# Byte-compiled / optimized / DLL files
Expand Down Expand Up @@ -123,3 +130,9 @@ venv_/

Pipfile
Pipfile.lock

# Kiro AI assistant artifacts
.kiro/

# Test configuration and credentials
test_config.py
95 changes: 95 additions & 0 deletions TESTING_SETUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Testing Setup for Confluence v2 API Development

This document explains how to set up secure credentials for testing the Confluence v2 API implementation.

## Quick Setup

1. **Create the secrets directory (if it doesn't exist):**
```bash
mkdir .secrets
```

2. **Copy the example environment file:**
```bash
copy .env.example .secrets\test.env
```

3. **Edit `.secrets\test.env` with your actual credentials:**
```bash

# Your Confluence Cloud URL
CONFLUENCE_URL=https://your-domain.atlassian.net

# Your Atlassian account email
CONFLUENCE_USERNAME=your-email@domain.com

# Your API token (generate at: https://id.atlassian.com/manage-profile/security/api-tokens)
CONFLUENCE_API_TOKEN=ATATT3xFfGF0...your-token-here

# Optional: Test space key
CONFLUENCE_TEST_SPACE=TESTSPACE
```

4. **Test the configuration:**
```bash
python test_config.py
```

## Generating an API Token

1. Go to [Atlassian Account Security](https://id.atlassian.com/manage-profile/security/api-tokens)

2. Click "Create API token"

3. Give it a label like "Confluence v2 API Development"

4. Copy the generated token to your `.env` file

## Security Notes

- ✅ `.secrets/` directory is excluded from git (never committed)

- ✅ `test_config.py` is excluded from git (contains helper functions)

- ✅ API tokens are more secure than passwords

- ✅ Tokens can be revoked at any time from your Atlassian account

## Testing Different Environments

You can create multiple environment files for different test scenarios:

```bash
.secrets\test.env # Main testing environment
.secrets\dev.env # Development Confluence instance
.secrets\staging.env # Staging environment
```

Load specific environments by modifying the `env_path` in `test_config.py`:
```python
env_path = os.path.join('.secrets', 'dev.env') # Load specific environment
```

## Troubleshooting

### "Missing required environment variables" error

- Ensure your `.secrets/test.env` file exists and contains all required variables

- Check that variable names match exactly (case-sensitive)

- Verify there are no extra spaces around the `=` sign

### Authentication failures

- Verify your API token is correct and not expired

- Ensure your username is the email address associated with your Atlassian account

- Check that your Confluence URL is correct (should end with .atlassian.net for Cloud)

### Permission errors

- Ensure your account has appropriate permissions in the Confluence space

- For testing, you may need to create a dedicated test space where you have admin rights
1 change: 0 additions & 1 deletion atlassian/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from .tempo import TempoCloud, TempoServer
from .xray import Xray


__all__ = [
"Confluence",
"ConfluenceCloud",
Expand Down
Loading
Loading