| Enhancement | 10 files
harbor_client.pyHarbor API Client with Full Resource Management         Â
integrations/harbor/harbor/client/harbor_client.py
- Comprehensive Harbor API client implementation with 1492 lines
supporting authentication, pagination, rate limiting, and webhook management - Implements async methods for fetching projects, users, repositories,
and artifacts with proper error handling and retry logic - Includes semaphore-based concurrency control for managing concurrent
requests and batch operations - Provides webhook CRUD operations (create, update, delete) for project
webhook policies
|
+1492/-0 |
orchestrator.pyWebhook Orchestration and Management Layer              Â
integrations/harbor/harbor/webhooks/orchestrator.py
- High-level webhook orchestration layer with 885 lines for managing
Harbor webhooks across projects - Implements setup, cleanup, and update operations for integration
webhooks with permission checking - Provides project-level webhook management with validation and error
handling - Includes comprehensive logging for all webhook operations and
permission checks
|
+885/-0Â |
project_processor.pyProject Webhook Event Processor                         Â
integrations/harbor/harbor/webhooks/processors/project_processor.py
- Webhook processor for handling project-related events (quota events)
- Implements event validation, authentication, and payload processing
- Fetches latest project data when quota events are triggered
- Provides structured webhook event handling with proper error logging
|
+87/-0Â Â |
artifact_processor.pyArtifact webhook event processor for Harbor integration Â
integrations/harbor/harbor/webhooks/processors/artifact_processor.py
- Implemented
ArtifactWebhookProcessor class extending
AbstractWebhookProcessor for handling artifact webhook events - Processes Harbor events including
PUSH_ARTIFACT, DELETE_ARTIFACT,
PULL_ARTIFACT, and scanning-related events - Extracts artifact information from webhook payloads and fetches
updated artifact data from Harbor API - Handles artifact deletion and distinguishes between deleted and
updated artifacts in webhook results
|
+156/-0Â |
repository_processor.pyRepository webhook event processor for Harbor integration
integrations/harbor/harbor/webhooks/processors/repository_processor.py
- Implemented
RepositoryWebhookProcessor class for handling repository-related webhook events - Processes events affecting repositories including
PUSH_ARTIFACT,
DELETE_ARTIFACT, TAG_RETENTION, and REPLICATION - Extracts repository metadata from webhook payloads and fetches updated
repository data - Handles repository deletion detection and empty repository scenarios
|
+134/-0Â |
main.pyIntegration entry point with resync and webhook handlersÂ
integrations/harbor/main.py
- Defined resync handlers for all four resource kinds: projects, users,
repositories, and artifacts - Implemented
on_start() lifecycle hook for Harbor connection validation and webhook setup - Registered three webhook processors (
ArtifactWebhookProcessor,
ProjectWebhookProcessor, RepositoryWebhookProcessor) for real-time event handling - Added comprehensive error handling and logging throughout resync and
startup operations
|
+128/-0Â |
client_initializer.pyHarbor client initialization with singleton pattern     Â
integrations/harbor/harbor/client/client_initializer.py
- Implemented singleton pattern for Harbor client initialization with
caching - Retrieves Harbor configuration from
get_harbor_config() function - Returns cached client instance on subsequent calls to avoid redundant
initialization - Includes error handling for missing configuration
|
+36/-0Â Â |
integration.pyHarbor integration base class and configuration         Â
integrations/harbor/integration.py
- Defined
HarborIntegration class extending BaseIntegration as the main integration entry point - Configured
AppConfigHandlerClass to use APIPortAppConfig with
HarborPortAppConfig as the configuration class - Documented supported resource types: projects, users, repositories,
and artifacts
|
+26/-0Â Â |
helper.pyHelper function for building API request parameters     Â
integrations/harbor/harbor/utils/helper.py
- Implemented
build_params() function to construct API request parameters from event context - Merges default page size with extra parameters and selector query
filters - Extracts query filters from resource configuration selectors when
available
|
+20/-0Â Â |
validators.pyWebhook signature verification utility                  Â
integrations/harbor/harbor/webhooks/validators.py
- Implemented
verify_webhook_signature() function for HMAC-SHA256 signature verification - Compares computed signature with provided signature using
constant-time comparison - Logs warning on signature verification failure
|
+22/-0Â Â |
|
| Tests | 3 files
test_client.pyHarbor Client Unit Tests                                Â
integrations/harbor/tests/test_client.py
- Comprehensive test suite with 653 lines covering Harbor client
authentication and API operations - Tests for projects, repositories, artifacts, and users endpoints with
pagination and filtering - Error handling tests including network timeouts, rate limiting, and
invalid responses - Request building and HTTP interaction tests with mocked responses
|
+653/-0Â |
test_harbor.pyHarbor Integration Tests                                Â
integrations/harbor/tests/test_harbor.py
- Integration test suite with 560 lines covering end-to-end Harbor
integration scenarios - Tests for data transformation from Harbor resources to Port entities
- Webhook handling tests for push artifact and scan completion events
- Resync logic and error handling tests with various failure scenarios
|
+560/-0Â |
conftest.pyPytest configuration and test fixtures for Harbor integration
integrations/harbor/tests/conftest.py
- Created comprehensive pytest configuration with session-scoped event
loop fixture - Implemented mock fixtures for Harbor client, HTTP client, and Port
client with realistic response structures - Added sample data fixtures for projects, repositories, artifacts,
users, vulnerabilities, and webhook payloads - Defined custom pytest markers for unit, integration, slow, webhook,
and client test categorization
|
+318/-0Â |
|
| Configuration changes | 12 files
app_config.pyHarbor Integration Configuration and Resource Mappings  Â
integrations/harbor/harbor/config/app_config.py
- Configuration module defining resource mappings for projects, users,
repositories, and artifacts - Implements
HarborPortAppConfig with entity mappings and blueprint definitions for each resource kind - Provides
get_harbor_config() helper function to extract Harbor credentials from ocean config - Defines selectors and port resource configurations for all Harbor
entity types
|
+187/-0Â |
poetry.tomlPoetry Virtual Environment Configuration                Â
integrations/harbor/poetry.toml
- Poetry configuration for virtual environment management
- Enables in-project virtual environment creation
|
+3/-0Â Â Â |
selectors.pyConfiguration selectors for Harbor resource filtering   Â
integrations/harbor/harbor/config/selectors.py
- Defined
ProjectSelector with query filtering, metadata inclusion, and configurable page size - Defined
UserSelector with username filtering, system user inclusion, and page size options - Defined
RepositorySelector with project name filtering, query support, and pull count options - Defined
ArtifactSelector with comprehensive filtering options including vulnerability and build history inclusion
|
+148/-0Â |
constants.pyConstants and enumerations for Harbor integration       Â
integrations/harbor/harbor/constants.py
- Defined
ObjectKind enum with four resource types: PROJECT, USER,
REPOSITORY, ARTIFACT - Listed supported webhook events including push, delete, pull,
scanning, quota, replication, and retention events - Defined constants for webhook naming, concurrent request limits, page
size defaults, and client timeout
|
+42/-0Â Â |
blueprints.jsonPort blueprints for Harbor resource entities            Â
integrations/harbor/.port/resources/blueprints.json
- Defined four blueprints:
harborProject, harborUser, harborRepository,
harborArtifact - Each blueprint includes comprehensive schema properties with
appropriate data types and descriptions - Configured relations between artifacts and repositories, and between
repositories and projects - Added vulnerability severity enums and artifact-specific properties
for scan status and CVE counts
|
+268/-0Â |
port-app-config.ymlPort application configuration with resource mappings   Â
integrations/harbor/.port/resources/port-app-config.yml
- Defined resource mappings for four kinds: project, user, repository,
artifact - Implemented JQ-based property mappings from Harbor API responses to
Port entity properties - Configured entity identifiers, titles, and blueprint assignments for
each resource type - Added relation mappings between artifacts and repositories, and
repositories and projects
|
+130/-0Â |
pyproject.tomlPoetry project configuration and dependencies           Â
integrations/harbor/pyproject.toml
- Configured Poetry project metadata for Harbor integration version
0.1.0-beta - Specified Python 3.12+ requirement with
port_ocean as main dependency - Added comprehensive dev dependencies including pytest, mypy, pylint,
ruff, and black - Configured towncrier for changelog management with breaking,
deprecation, feature, improvement, bugfix, and doc categories
|
+113/-0Â |
MakeFileMakefile with development and deployment targets        Â
integrations/harbor/MakeFile
- Defined make targets for installation, linting, testing, and cleanup
operations - Implemented
install, install/prod, install/local-core targets for dependency management - Added
lint, lint/fix targets for code quality checks using mypy, ruff, and black - Included
test, run, clean, and seed targets for development workflow
|
+86/-0Â Â |
py.iniPytest configuration file for Harbor integration tests  Â
integrations/harbor/tests/py.ini
- Configured pytest with test discovery patterns and Python 3.11+
minimum version - Enabled verbose output, coverage reporting, parallel execution, and
strict marker enforcement - Defined custom markers for unit, integration, slow, webhook, client,
and asyncio tests - Configured mypy and coverage settings with appropriate exclusions and
reporting options
|
+112/-0Â |
spec.yamlHarbor integration specification and configuration schema
integrations/harbor/.port/spec.yaml
- Defined integration specification with Harbor icon and title
- Listed four exportable resource kinds: projects, users, repositories,
artifacts - Configured required parameters:
harborUrl, harborUsername,
harborPassword - Added optional parameters for page size, webhook secret, app host, and
various filter objects
|
+104/-0Â |
.env.exampleExample environment variables for Harbor integration    Â
integrations/harbor/.env.example
- Provided example environment variables for Harbor integration
configuration - Included Port client credentials, integration identifier, and event
listener settings - Specified Harbor connection parameters: URL, username, password, page
size, webhook secret - Added optional filter configurations for projects, repositories, and
artifacts
|
+17/-0Â Â |
sonar-project.propertiesSonarQube configuration for Harbor integration          Â
integrations/harbor/sonar-project.properties
- Configured SonarQube project key and organization for code quality
analysis - Set project identifier to
port-labs_ocean_harbor-server under
port-labs organization
|
+2/-0Â Â Â |
|