Thank you for your interest in contributing to APort Integrations! This guide will help you get started with contributing to our community-driven repository.
- Code of Conduct
- Getting Started
- Development Workflow
- Integration Requirements
- Coding Standards
- Testing Guidelines
- Documentation Standards
- Hacktoberfest Guidelines
- Review Process
- Release Process
We are committed to providing a welcoming and inclusive environment for all contributors. Please read and follow our Code of Conduct.
- Node.js 18+ (for JavaScript/TypeScript integrations)
- Python 3.9+ (for Python integrations)
- Go 1.19+ (for Go integrations)
- PHP 8.0+ (for PHP integrations)
- Git (for version control)
- APort Account (Sign up here)
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/aport-integrations.git cd aport-integrations - Add upstream remote:
git remote add upstream https://github.com/aporthq/aport-integrations.git
-
Install dependencies (if any):
# For Node.js projects npm install # For Python projects pip install -r requirements.txt
-
Set up environment variables:
cp .env.example .env # Edit .env with your APort API credentials -
Run tests to ensure everything works:
npm test # or pytest, go test, etc.
- Browse open issues
- Look for issues labeled
hacktoberfest,good first issue, orhelp wanted - Comment "I'd like to work on this" to claim an issue
git checkout -b feature/your-integration-name
# or
git checkout -b fix/issue-descriptionWe provide scaffolding templates to help you get started quickly:
# For JavaScript/Node.js integrations
cp -r templates/javascript-middleware examples/your-integration-name
cd examples/your-integration-name
# For Python integrations
cp -r templates/python-middleware examples/your-integration-name
cd examples/your-integration-nameTemplate Benefits:
- β Consistent structure across all integrations
- β Pre-configured dependencies and build tools
- β Example code and tests already set up
- β Documentation templates ready to customize
- β Best practices embedded in the template
Template Customization:
- Update package.json/pyproject.toml with your integration details
- Modify the source code to implement your specific functionality
- Update tests to cover your integration's behavior
- Customize README.md with your integration's documentation
- Add examples showing real-world usage
Available Templates:
templates/javascript-middleware/- Express.js middleware templatetemplates/python-middleware/- FastAPI middleware template
Template Structure:
templates/[language]-[framework]/
βββ README.md # Template documentation
βββ package.json # Dependencies and scripts
βββ src/ # Source code template
βββ tests/ # Test template
βββ examples/ # Usage examples
βββ .env.example # Environment variables template
- Follow our coding standards
- Write tests for your changes
- Update documentation as needed
# Run all tests
npm test
# Run specific tests
npm test -- --grep "your test"
# Lint your code
npm run lintgit add .
git commit -m "feat: add LangChain Tool Guard integration
- Implement APortToolGuard class
- Add verification before tool execution
- Include comprehensive tests
- Add documentation and examples
Closes #123"Commit Message Format:
feat:New featurefix:Bug fixdocs:Documentation changesstyle:Code style changesrefactor:Code refactoringtest:Adding or updating testschore:Maintenance tasks
git push origin feature/your-integration-nameThen create a pull request on GitHub with:
- Clear title and description
- Reference the issue being closed
- Include screenshots or demos if applicable
- Working Example: Complete, runnable integration
- Documentation: Clear README with setup instructions
- Tests: Unit tests with minimum 80% coverage
- Error Handling: Graceful failure modes
- Security: No hardcoded secrets or credentials
- Environment Variables: Use
.envfiles for configuration
examples/[category]/[integration-name]/
βββ README.md # Integration documentation
βββ package.json # Dependencies (if applicable)
βββ requirements.txt # Python dependencies (if applicable)
βββ src/ # Source code
β βββ index.js # Main integration file
β βββ utils.js # Helper functions
βββ tests/ # Test files
β βββ integration.test.js
β βββ utils.test.js
βββ examples/ # Usage examples
β βββ basic-usage.js
β βββ advanced-usage.js
βββ .env.example # Environment variables template
# [Integration Name]
Brief description of what this integration does.
## π Quick Start
### Prerequisites
- Node.js 18+
- APort account
### Installation
```bash
npm installcp .env.example .env
# Edit .env with your credentials// Basic usage example
const { APortIntegration } = require('./src');
const integration = new APortIntegration({
apiKey: process.env.APORT_API_KEY
});Verifies an agent against a policy.
Parameters:
policy(string): Policy pack identifieragentId(string): Agent identifier
Returns: Promise
npm testMIT
## π¨ Coding Standards
### JavaScript/TypeScript
```javascript
// Use modern ES6+ features
const { APortClient } = require('@aporthq/sdk');
class APortIntegration {
constructor(options = {}) {
this.client = new APortClient(options);
}
async verify(policy, agentId) {
try {
const result = await this.client.verify(policy, agentId);
return result;
} catch (error) {
console.error('Verification failed:', error.message);
throw error;
}
}
}
module.exports = { APortIntegration };
Standards:
- Use
const/letinstead ofvar - Use arrow functions for callbacks
- Use async/await instead of Promises
- Use template literals for strings
- Use destructuring for object properties
- Use meaningful variable and function names
- Add JSDoc comments for public methods
"""APort Integration for Python frameworks."""
import os
from typing import Dict, Any, Optional
from aport_sdk import APortClient
class APortIntegration:
"""APort integration for Python frameworks."""
def __init__(self, api_key: Optional[str] = None):
"""Initialize the integration.
Args:
api_key: APort API key. If not provided, will use APORT_API_KEY env var.
"""
self.client = APortClient(api_key or os.getenv('APORT_API_KEY'))
async def verify(self, policy: str, agent_id: str) -> Dict[str, Any]:
"""Verify an agent against a policy.
Args:
policy: Policy pack identifier
agent_id: Agent identifier
Returns:
Verification result
Raises:
APortError: If verification fails
"""
try:
result = await self.client.verify(policy, agent_id)
return result
except Exception as e:
print(f"Verification failed: {e}")
raiseStandards:
- Use type hints
- Use f-strings for string formatting
- Use async/await for async operations
- Follow PEP 8 style guide
- Use docstrings for classes and methods
- Use meaningful variable and function names
package aport
import (
"context"
"fmt"
"os"
"github.com/aporthq/sdk-go"
)
// Integration represents an APort integration
type Integration struct {
client *sdk.Client
}
// NewIntegration creates a new APort integration
func NewIntegration(apiKey string) *Integration {
if apiKey == "" {
apiKey = os.Getenv("APORT_API_KEY")
}
return &Integration{
client: sdk.NewClient(apiKey),
}
}
// Verify verifies an agent against a policy
func (i *Integration) Verify(ctx context.Context, policy, agentID string) (*sdk.VerificationResult, error) {
result, err := i.client.Verify(ctx, policy, agentID)
if err != nil {
return nil, fmt.Errorf("verification failed: %w", err)
}
return result, nil
}Standards:
- Use meaningful package names
- Use context for cancellation
- Use proper error handling with wrapped errors
- Follow Go naming conventions
- Use meaningful variable and function names
- Add godoc comments
// tests/integration.test.js
const { APortIntegration } = require('../src');
const { mockAPortAPI } = require('./mocks');
describe('APortIntegration', () => {
let integration;
beforeEach(() => {
integration = new APortIntegration({
apiKey: 'test-key'
});
});
describe('verify', () => {
it('should verify agent successfully', async () => {
// Arrange
mockAPortAPI.verify.mockResolvedValue({
verified: true,
passport: { /* mock passport */ }
});
// Act
const result = await integration.verify('finance.payment.refund.v1', 'agt_123');
// Assert
expect(result.verified).toBe(true);
expect(mockAPortAPI.verify).toHaveBeenCalledWith('finance.payment.refund.v1', 'agt_123');
});
it('should handle verification failure', async () => {
// Arrange
mockAPortAPI.verify.mockRejectedValue(new Error('Verification failed'));
// Act & Assert
await expect(integration.verify('finance.payment.refund.v1', 'agt_123'))
.rejects.toThrow('Verification failed');
});
});
});- Unit Tests: Test individual functions and methods
- Integration Tests: Test the full integration flow
- Error Cases: Test error handling and edge cases
- Mocking: Mock external API calls
- Coverage: Minimum 80% code coverage
- Performance: Test with realistic data sizes
/**
* Verifies an agent against a policy pack
* @param {string} policy - Policy pack identifier (e.g., 'finance.payment.refund.v1')
* @param {string} agentId - Agent identifier (e.g., 'agt_inst_xyz789')
* @param {Object} context - Additional context for verification
* @param {string} context.userId - User ID for user-specific policies
* @param {Object} context.metadata - Additional metadata
* @returns {Promise<VerificationResult>} Verification result
* @throws {APortError} If verification fails
* @example
* const result = await integration.verify('finance.payment.refund.v1', 'agt_123', {
* userId: 'user_456',
* metadata: { amount: 100 }
* });
*/
async verify(policy, agentId, context = {}) {
// Implementation
}- Clear title and description
- Installation instructions
- Configuration guide
- Usage examples
- API reference
- Troubleshooting section
- Contributing guidelines
- Fork the repository
- Claim an issue by commenting "I'd like to work on this"
- Build your integration following our guidelines
- Submit a pull request with proper documentation
- Get paid via Chimoney when your PR is merged!
- Beginner: $15-25 (Simple integrations, documentation)
- Intermediate: $30-40 (Framework integrations, middleware)
- Advanced: $45-50 (Complex integrations, protocol bridges)
- β Working integration with examples
- β Comprehensive documentation
- β Unit tests with good coverage
- β Error handling and edge cases
- β Security best practices
- β Follows coding standards
- Functionality: Does it work as expected?
- Code Quality: Is it well-written and maintainable?
- Documentation: Is it clear and comprehensive?
- Tests: Are there adequate tests?
- Security: Are there any security issues?
- Performance: Is it efficient?
- Initial Review: 2-3 business days
- Feedback: We'll provide constructive feedback
- Revisions: Address feedback and resubmit
- Final Review: 1-2 business days
- Merge: Once approved, we'll merge your PR
- Missing Tests: Add comprehensive tests
- Poor Documentation: Improve README and code comments
- Security Issues: Remove hardcoded secrets
- Code Style: Follow our coding standards
- Missing Examples: Add usage examples
We use Semantic Versioning:
- MAJOR: Breaking changes
- MINOR: New features (backward compatible)
- PATCH: Bug fixes (backward compatible)
- Update version in package.json/pyproject.toml
- Update CHANGELOG.md with new features/fixes
- Create release PR with version bump
- Merge and tag the release
- Publish to npm/PyPI/etc.
- Discord: Join our Discord
- GitHub Discussions: Ask questions
- Email: Contact us
- Documentation: Read our docs
Contributors are recognized in:
- README: Listed as maintainers
- Website: Featured on our contributors page
- Social Media: Shoutouts on Twitter/LinkedIn
- Swag: APort Champion T-shirts for significant contributions
Thank you for contributing to APort Integrations! Together, we're building the future of AI agent security. π‘οΈ