| Tests | 7 files
test_harbor_client.pyHarbor client HTTP request and pagination tests
integrations/harbor/tests/harbor/clients/test_harbor_client.py
- Comprehensive test suite for
HarborClient covering client creation, initialization, and request handling - Tests for successful API requests, HTTP error handling, and ignored
error scenarios - Pagination tests validating single/multiple page handling and 404
error behavior - Tests for request parameters, JSON data payloads, and query string
construction
|
+300/-0 |
test_artifact_webhook_processor.pyArtifact webhook processor event handling tests
integrations/harbor/tests/harbor/webhook/webhook_processors/test_artifact_webhook_processor.py
- Tests for artifact webhook processor validating payload structure and
event types - Tests for handling PUSH_ARTIFACT and DELETE_ARTIFACT webhook events
- Verification of artifact data fetching and deletion result handling
|
+124/-0 |
test_repository_webhook_processor.pyRepository webhook processor event handling tests
integrations/harbor/tests/harbor/webhook/webhook_processors/test_repository_webhook_processor.py
- Tests for repository webhook processor validating payload structure
and event types - Tests for handling PUSH_ARTIFACT and DELETE_ARTIFACT webhook events
for repositories - Verification of repository data fetching and deletion result handling
|
+124/-0 |
test_harbor_abstract_webhook_processor.pyHarbor abstract webhook processor authentication tests
integrations/harbor/tests/harbor/webhook/test_harbor_abstract_webhook_processor.py
- Tests for abstract webhook processor authentication using
Authorization header and HMAC comparison - Tests for valid/invalid secret validation and missing header scenarios
- Verification of
should_process_event method always returning True
|
+104/-0 |
conftest.pyHarbor integration test fixtures and configuration
integrations/harbor/tests/conftest.py
- Pytest fixtures for Harbor client testing with mock Ocean context
initialization - Test configuration with Harbor host, credentials, and robot account
settings - Fixtures for basic and robot authenticators, HTTP responses, and event
contexts - Mock Ocean app configuration for integration testing
|
+96/-0 |
test_basic_authenticator.pyHarbor basic and robot authenticator tests
integrations/harbor/tests/harbor/clients/auth/test_basic_authenticator.py
- Tests for basic authentication token generation as base64-encoded
username:password - Tests for header generation with Basic auth scheme and Accept header
- Token and header caching verification
- HTTP client property validation
|
+98/-0 |
test_registry.pyHarbor webhook registry registration tests
integrations/harbor/tests/harbor/webhook/test_registry.py
- Tests for Harbor webhook registry registration
- Verification that both artifact and repository processors are
registered
|
+17/-0 |
|
| Enhancement | 20 files
utils.pyHarbor utility functions for query building and enrichment
integrations/harbor/harbor/helpers/utils.py
- Utility functions for Harbor query string building with support for
exact match, fuzzy match, range, and list patterns - Helper functions to build query parameters for projects, users,
repositories, and artifacts with filtering options - Enrichment functions to add project and repository context to response
objects -
ObjectKind enum and IgnoredError named tuple for resource type and error handling
|
+212/-0 |
main.pyHarbor integration main resync and webhook handlers
integrations/harbor/main.py
- Resync handlers for all Harbor resource kinds (projects, users,
repositories, artifacts) using exporters - Artifact resync implementation that fetches repositories first, then
streams artifacts from each repository - Webhook initialization on startup that creates/updates Harbor webhook
policies for all projects - Integration with Ocean framework for resource synchronization and
event handling
|
+168/-0 |
harbor_client.pyHarbor async HTTP client with pagination and error handling
integrations/harbor/harbor/clients/http/harbor_client.py
- Harbor API v2.0 client with async HTTP request handling and
authentication support - Pagination support with Link header parsing for multi-page API
responses - Error handling with ignored error patterns and token expiration
detection - CSRF cookie clearing for write operations (POST, PUT, PATCH) to
prevent validation errors
|
+153/-0 |
webhook_client.pyHarbor webhook policy management client
integrations/harbor/harbor/webhook/webhook_client.py
- Client for managing Harbor webhook policies with upsert functionality
- Webhook payload building with event types and authentication headers
- Methods to create, update, and retrieve existing webhook policies per
project - Support for webhook secret configuration and HTTPS certificate
verification options
|
+135/-0 |
artifact_webhook_processor.pyArtifact webhook event processor implementation
integrations/harbor/harbor/webhook/webhook_processors/artifact_webhook_processor.py
- Webhook processor for Harbor artifact events (PUSH, PULL, DELETE,
SCANNING events) - Handles artifact deletion by returning artifact metadata with
project/repository context - Fetches latest artifact data for upsert events using the artifact
exporter - Validates event payload structure and event type
|
+103/-0 |
repository_webhook_processor.pyRepository webhook event processor implementation
integrations/harbor/harbor/webhook/webhook_processors/repository_webhook_processor.py
- Webhook processor for Harbor repository events (PUSH, PULL, DELETE
artifact events) - Handles repository deletion by returning repository metadata with
project context - Fetches latest repository data for upsert events using the repository
exporter - Validates event payload structure and event type
|
+96/-0 |
repository_exporter.pyHarbor repository exporter with project enrichment
integrations/harbor/harbor/core/exporters/repository_exporter.py
- Exporter for Harbor repositories with pagination and filtering support
- Fetches single repository by project and repository name
- Enriches repositories with project name mapping from project IDs
- Caches paginated results for performance optimization
|
+64/-0 |
artifact_exporter.pyHarbor artifact exporter with context enrichment
integrations/harbor/harbor/core/exporters/artifact_exporter.py
- Exporter for Harbor artifacts with pagination and filtering support
- Fetches single artifact by project, repository, and reference
(tag/digest) - Enriches artifacts with project and repository context information
- Handles repository name parsing for correct API endpoint construction
|
+61/-0 |
options.pyHarbor resource filtering and option type definitions
integrations/harbor/harbor/core/options.py
- TypedDict definitions for single and list resource options (projects,
users, repositories, artifacts) - Filtering options including query strings, sorting, and
artifact-specific parameters - Support for artifact metadata options (tags, labels, scan overview,
SBOM, signatures)
|
+67/-0 |
initialize_client.pyHarbor client factory and initialization
integrations/harbor/initialize_client.py
- Factory pattern implementation for Harbor client singleton creation
- Client initialization from Ocean integration configuration
- Support for both robot account and basic authentication methods
- Error handling for missing configuration
|
+52/-0 |
harbor_abstract_webhook_processor.pyHarbor abstract webhook processor with authentication
integrations/harbor/harbor/webhook/harbor_abstract_webhook_processor.py
- Abstract base class for Harbor webhook processors with authentication
support - HMAC-based authentication using Authorization header and webhook
secret - Graceful handling of missing secrets with warning logs
-
should_process_event method always returning True
|
+47/-0 |
abstract_authenticator.pyHarbor abstract authenticator with retry configuration
integrations/harbor/harbor/clients/auth/abstract_authenticator.py
- Abstract base class for Harbor authentication methods with token and
header generation -
HarborToken and HarborHeaders Pydantic models for type safety - HTTP client property with retry configuration and timeout settings
- Support for Retry-After and X-RateLimit-Reset headers
|
+52/-0 |
auth_factory.pyHarbor authenticator factory with credential validation
integrations/harbor/harbor/clients/auth/auth_factory.py
- Factory for creating Harbor authenticators based on configuration
priority - Prefers robot account authentication over basic authentication
- Validation of required configuration and credentials
- Detailed error messages for missing credentials
|
+40/-0 |
project_exporter.pyHarbor project exporter with pagination
integrations/harbor/harbor/core/exporters/project_exporter.py
- Exporter for Harbor projects with pagination and filtering support
- Fetches single project by name
- Caches paginated results for performance optimization
|
+37/-0 |
user_exporter.pyHarbor user exporter with filtering
integrations/harbor/harbor/core/exporters/user_exporter.py
- Exporter for Harbor users with pagination and filtering support
- Fetches single user by ID
- Supports query and sort filtering options
|
+35/-0 |
basic_authenticator.pyHarbor basic authentication implementation
integrations/harbor/harbor/clients/auth/basic_authenticator.py
- Basic authentication implementation using base64-encoded
username:password - Token caching for performance optimization
- Header generation with Basic auth scheme
|
+37/-0 |
abstract_exporter.pyHarbor abstract exporter base class
integrations/harbor/harbor/core/exporters/abstract_exporter.py
- Abstract base class for Harbor resource exporters with generic typing
- Defines interface for single resource and paginated resource fetching
|
+20/-0 |
utils.pyHarbor client configuration utility
integrations/harbor/harbor/clients/utils.py
- Utility function to build integration configuration dictionary from
authenticator and Ocean config
|
+14/-0 |
registry.pyHarbor webhook processor registration
integrations/harbor/harbor/webhook/registry.py
- Registry function to register all Harbor webhook processors with Ocean
framework - Registers artifact and repository webhook processors at specified path
|
+15/-0 |
robot_authenticator.pyHarbor robot account authenticator
integrations/harbor/harbor/clients/auth/robot_authenticator.py
- Robot account authentication extending basic authenticator
- Uses robot name and token instead of username and password
|
+8/-0 |
|
| Configuration changes | 11 files
integration.pyHarbor integration configuration and resource selectors
integrations/harbor/integration.py
- Configuration classes for Harbor resource kinds (projects, users,
repositories, artifacts) with selectors - Selector classes defining filtering options for each resource type
(query strings, sorting, artifact-specific options) - Main
HarborPortAppConfig and HarborIntegration classes for Ocean framework integration - JQ entity processor configuration for data transformation
|
+136/-0 |
events.pyHarbor webhook event type constants and definitions
integrations/harbor/harbor/webhook/events.py
- Event type constants for artifact, repository, and project webhook
events - Separation of upsert and delete events for each resource kind
- Comprehensive list of all Harbor webhook events and events for webhook
creation
|
+61/-0 |
launch.jsonVSCode debug configuration updates and formatting
.vscode/launch.json
- Reformatted JSON indentation for consistency
- Removed jira integration debug configuration
- Added azure-resource-graph and http-server debug configurations
|
+339/-339 |
spec.yamlHarbor integration specification and configuration schema
integrations/harbor/.port/spec.yaml
- Harbor integration specification with exporter features for projects,
repositories, users, and artifacts - Configuration schema for Harbor host URL, authentication credentials
(username/password or robot account) - Webhook secret configuration for incoming webhook authentication
|
+36/-0 |
blueprints.jsonHarbor resource blueprints for Port catalog integration
integrations/harbor/.port/resources/blueprints.json
- Defines four Port blueprints for Harbor resources:
harborProjects,
harborUsers, harborRepositories, and harborArtifacts - Each blueprint includes schema properties with appropriate types
(string, number, boolean, date-time, array) - Establishes relations between blueprints: repositories link to
projects, artifacts link to repositories - Supports filtering and visualization of Harbor container registry
metadata in Port's catalog
|
+179/-0 |
pyproject.tomlHarbor integration project configuration and dependencies
integrations/harbor/pyproject.toml
- Defines project metadata for Harbor integration with version
0.1.0-beta and Python ^3.12 requirement - Specifies
port_ocean dependency with CLI extras for core integration functionality - Includes development dependencies for testing (pytest, pytest-asyncio,
pytest-httpx), code quality (black, mypy, pylint, ruff), and changelog management (towncrier) - Configures tool settings for mypy strict type checking, ruff linting,
black formatting, and pytest async testing
|
+113/-0 |
port-app-config.ymlPort application configuration for Harbor resource mapping
integrations/harbor/.port/resources/port-app-config.yml
- Defines resource mappings for four Harbor entity kinds: projects,
users, repositories, and artifacts - Maps Harbor API responses to Port blueprint properties using jq
expressions for data transformation - Establishes entity relations: repositories link to projects, artifacts
link to repositories - Configures identifier generation, title mapping, and property
extraction for each resource type
|
+75/-0 |
.env.exampleHarbor integration environment configuration template
integrations/harbor/.env.example
- Provides environment variable template for Harbor integration
configuration - Includes Port API credentials (
CLIENT_ID, CLIENT_SECRET), Harbor connection details (HARBOR_HOST, USERNAME, PASSWORD) - Specifies webhook configuration (
WEBHOOK_SECRET) and event listener type (POLLING) - Documents required configuration keys for integration initialization
and resource synchronization
|
+11/-0 |
MakefileHarbor integration Makefile symlink
integrations/harbor/Makefile
- Creates symbolic link to shared Makefile from port-ocean
infrastructure directory - Enables consistent build and development tooling across integrations
|
+1/-0 |
sonar-project.propertiesSonarQube configuration for Harbor integration
integrations/harbor/sonar-project.properties
- Configures SonarQube project settings for code quality analysis
- Sets project key to
port-labs_ocean_harbor and organization to
port-labs
|
+2/-0 |
poetry.tomlPoetry virtual environment configuration
integrations/harbor/poetry.toml
- Configures Poetry virtual environment settings for Harbor integration
- Enables automatic virtual environment creation within the project
directory
|
+3/-0 |
|
| Miscellaneous | 10 files
__init__.pyHarbor exporters package initialization
integrations/harbor/harbor/core/exporters/init.py
- Package initialization exporting all Harbor exporter classes
|
+13/-0 |
__init__.pyHarbor authentication package initialization
integrations/harbor/harbor/clients/auth/init.py
- Package initialization exporting authenticator classes and models
|
+15/-0 |
debug.pyHarbor integration debug entry point
integrations/harbor/debug.py
- Debug entry point for running Harbor integration locally
|
+4/-0 |
__init__.pyHarbor webhook processors package initialization
integrations/harbor/harbor/webhook/webhook_processors/init.py
- Package initialization for webhook processors module
|
+1/-0 |
__init__.pyHarbor webhook package initialization
integrations/harbor/harbor/webhook/init.py
- Package initialization for webhook module
|
+1/-0 |
__init__.pyWebhook processor tests package initialization
integrations/harbor/tests/harbor/webhook/webhook_processors/init.py
- Package initialization for webhook processor tests
|
+1/-0 |
__init__.pyHarbor authentication tests package initialization
integrations/harbor/tests/harbor/clients/auth/init.py
- Package initialization for authentication tests
|
+1/-0 |
__init__.pyHarbor client tests package initialization
integrations/harbor/tests/harbor/clients/init.py
- Package initialization for client tests
|
+1/-0 |
__init__.pyHarbor tests package initialization
integrations/harbor/tests/harbor/init.py
- Package initialization for Harbor tests
|
+1/-0 |
__init__.pyTests module package initialization
integrations/harbor/tests/init.py
- Package initialization for tests module
|
+1/-0 |
|
| Error handling | 1 files
exceptions.pyHarbor integration custom exceptions
integrations/harbor/harbor/helpers/exceptions.py
- Custom exception classes for Harbor integration error handling
-
AuthenticationException, MissingConfiguration, MissingCredentials,
InvalidTokenException
|
+17/-0 |
|
| Documentation | 3 files
README.mdHarbor integration documentation and setup guide
integrations/harbor/README.md
- Comprehensive documentation for Harbor integration including features,
supported resources, and quick start guide - Covers authentication setup for both robot accounts and local users
with token expiration handling - Provides configuration examples, webhook setup instructions for
development and production environments - Documents resource filtering capabilities and supported webhook events
(PUSH_ARTIFACT, DELETE_ARTIFACT, SCANNING_COMPLETED, SCANNING_FAILED)
|
+136/-0 |
CHANGELOG.mdInitial Harbor integration changelog and release notes
integrations/harbor/CHANGELOG.md
- Documents initial release
0.1.0 dated 2024-10-16 with complete Harbor integration implementation - Lists added features including robot account authentication, webhook
support, filtering, and async HTTP client - Details technical implementation aspects: singleton pattern,
async/await patterns, type safety, and comprehensive test coverage - Highlights production-ready error handling, logging, and webhook
authentication with signature validation
|
+43/-0 |
CONTRIBUTING.mdHarbor integration contribution guidelines
integrations/harbor/CONTRIBUTING.md
- Provides basic contribution guidelines for Harbor integration
development - Includes placeholder section for local setup instructions with note
about Harbor-specific gotchas - References rate limiting, credential setup, and other local
development considerations
|
+7/-0 |
|
| Additional files | 5 files |