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
1 change: 1 addition & 0 deletions cmd/openctem-admin/cmd/client.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package cmd implements the openctem-admin CLI (cobra commands) for tenant ops + maintenance.
package cmd

import (
Expand Down
34 changes: 19 additions & 15 deletions internal/app/activity/service.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Package activity provides the application service that records, queries,
// and aggregates user-facing activity events (asset created, finding
// reopened, scan triggered, etc). The service is the orchestration layer
// over pkg/domain/activity entities + a repository implementation.
package activity

import (
Expand Down Expand Up @@ -113,9 +117,9 @@ type RecordActivityInput struct {
ActivityType string `validate:"required"`
ActorID *string `validate:"omitempty,uuid"`
ActorType string `validate:"required"`
Changes map[string]interface{} `validate:"required"`
Changes map[string]any `validate:"required"`
Source string
SourceMetadata map[string]interface{}
SourceMetadata map[string]any
}

// MaxChangesSize is the maximum allowed size for the changes JSONB field (15KB).
Expand Down Expand Up @@ -216,7 +220,7 @@ func (s *FindingActivityService) RecordBatchAutoResolved(
vulnerability.ActivityAutoResolved,
nil, // no actor - system action
vulnerability.ActorTypeSystem,
map[string]interface{}{
map[string]any{
"reason": "not_found_in_full_scan",
"scanner": toolName,
"scan_id": scanID,
Expand Down Expand Up @@ -258,7 +262,7 @@ func (s *FindingActivityService) RecordBatchAutoReopened(
vulnerability.ActivityAutoReopened,
nil, // no actor - system action
vulnerability.ActorTypeSystem,
map[string]interface{}{
map[string]any{
"reason": "finding_detected_again",
},
vulnerability.SourceAuto,
Expand Down Expand Up @@ -288,7 +292,7 @@ func (s *FindingActivityService) RecordStatusChange(
reason string,
source string,
) (*vulnerability.FindingActivity, error) {
changes := map[string]interface{}{
changes := map[string]any{
"old_status": oldStatus,
"new_status": newStatus,
}
Expand All @@ -315,7 +319,7 @@ func (s *FindingActivityService) RecordSeverityChange(
oldSeverity, newSeverity string,
source string,
) (*vulnerability.FindingActivity, error) {
changes := map[string]interface{}{
changes := map[string]any{
"old_severity": oldSeverity,
"new_severity": newSeverity,
}
Expand All @@ -339,7 +343,7 @@ func (s *FindingActivityService) RecordAssignment(
assigneeID, assigneeName, assigneeEmail string,
source string,
) (*vulnerability.FindingActivity, error) {
changes := map[string]interface{}{
changes := map[string]any{
"assignee_id": assigneeID,
"assignee_name": assigneeName,
"assignee_email": assigneeEmail,
Expand All @@ -364,7 +368,7 @@ func (s *FindingActivityService) RecordUnassignment(
previousAssigneeName string,
source string,
) (*vulnerability.FindingActivity, error) {
changes := map[string]interface{}{
changes := map[string]any{
"previous_assignee_name": previousAssigneeName,
}

Expand All @@ -388,7 +392,7 @@ func (s *FindingActivityService) RecordCommentAdded(
commentID, content string,
source string,
) (*vulnerability.FindingActivity, error) {
changes := map[string]interface{}{
changes := map[string]any{
"comment_id": commentID,
}
if content != "" {
Expand Down Expand Up @@ -421,7 +425,7 @@ func (s *FindingActivityService) RecordCommentUpdated(
commentID string,
source string,
) (*vulnerability.FindingActivity, error) {
changes := map[string]interface{}{
changes := map[string]any{
"comment_id": commentID,
}

Expand All @@ -444,7 +448,7 @@ func (s *FindingActivityService) RecordCommentDeleted(
commentID string,
source string,
) (*vulnerability.FindingActivity, error) {
changes := map[string]interface{}{
changes := map[string]any{
"comment_id": commentID,
}

Expand Down Expand Up @@ -483,9 +487,9 @@ func (s *FindingActivityService) RecordScanDetected(
ctx context.Context,
tenantID, findingID string,
scanID, scanner, scanType string,
sourceMetadata map[string]interface{},
sourceMetadata map[string]any,
) (*vulnerability.FindingActivity, error) {
changes := map[string]interface{}{
changes := map[string]any{
"scan_id": scanID,
"scanner": scanner,
"scan_type": scanType,
Expand All @@ -508,15 +512,15 @@ func (s *FindingActivityService) RecordCreated(
ctx context.Context,
tenantID, findingID string,
source string,
sourceMetadata map[string]interface{},
sourceMetadata map[string]any,
) (*vulnerability.FindingActivity, error) {
return s.RecordActivity(ctx, RecordActivityInput{
TenantID: tenantID,
FindingID: findingID,
ActivityType: string(vulnerability.ActivityCreated),
ActorID: nil,
ActorType: string(vulnerability.ActorTypeSystem),
Changes: map[string]interface{}{},
Changes: map[string]any{},
Source: source,
SourceMetadata: sourceMetadata,
})
Expand Down
1 change: 1 addition & 0 deletions internal/app/agent/service.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package agent implements the application service for the agent bounded context — orchestrates pkg/domain/agent entities and cross-cutting concerns (audit, notifications, RBAC).
package agent

import (
Expand Down
1 change: 1 addition & 0 deletions internal/app/aitriage/service.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package aitriage implements the application service for the aitriage bounded context — orchestrates pkg/domain/aitriage entities and cross-cutting concerns (audit, notifications, RBAC).
package aitriage

import (
Expand Down
1 change: 1 addition & 0 deletions internal/app/apikey/service.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package apikey implements the application service for the apikey bounded context — orchestrates pkg/domain/apikey entities and cross-cutting concerns (audit, notifications, RBAC).
package apikey

import (
Expand Down
1 change: 1 addition & 0 deletions internal/app/asset/service.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package asset implements the application service for the asset bounded context — orchestrates pkg/domain/asset entities and cross-cutting concerns (audit, notifications, RBAC).
package asset

import (
Expand Down
1 change: 1 addition & 0 deletions internal/app/assignment/engine.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package assignment implements the application service for the assignment bounded context — orchestrates pkg/domain/assignment entities and cross-cutting concerns (audit, notifications, RBAC).
package assignment

import (
Expand Down
1 change: 1 addition & 0 deletions internal/app/attack/path_scoring.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package attack implements the application service for the attack bounded context — orchestrates pkg/domain/attack entities and cross-cutting concerns (audit, notifications, RBAC).
package attack

import (
Expand Down
1 change: 1 addition & 0 deletions internal/app/audit/service.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package audit implements the application service for the audit bounded context — orchestrates pkg/domain/audit entities and cross-cutting concerns (audit, notifications, RBAC).
package audit

import (
Expand Down
1 change: 1 addition & 0 deletions internal/app/auth/service.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package auth implements the application service for the auth bounded context — orchestrates pkg/domain/auth entities and cross-cutting concerns (audit, notifications, RBAC).
package auth

import (
Expand Down
1 change: 1 addition & 0 deletions internal/app/capability/service.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package capability implements the application service for the capability bounded context — orchestrates pkg/domain/capability entities and cross-cutting concerns (audit, notifications, RBAC).
package capability

import (
Expand Down
1 change: 1 addition & 0 deletions internal/app/command/service.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package command implements the application service for the command bounded context — orchestrates pkg/domain/command entities and cross-cutting concerns (audit, notifications, RBAC).
package command

import (
Expand Down
1 change: 1 addition & 0 deletions internal/app/compliance/service.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package compliance implements the application service for the compliance bounded context — orchestrates pkg/domain/compliance entities and cross-cutting concerns (audit, notifications, RBAC).
package compliance

import (
Expand Down
1 change: 1 addition & 0 deletions internal/app/exposure/service.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package exposure implements the application service for the exposure bounded context — orchestrates pkg/domain/exposure entities and cross-cutting concerns (audit, notifications, RBAC).
package exposure

import (
Expand Down
1 change: 1 addition & 0 deletions internal/app/finding/actions.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package finding implements the application service for the finding bounded context — orchestrates pkg/domain/finding entities and cross-cutting concerns (audit, notifications, RBAC).
package finding

import (
Expand Down
4 changes: 0 additions & 4 deletions internal/app/ingest/priority_gate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,6 @@ func TestPriorityGate_FilterProperties_FeatureOffReturnsInputUnchanged(t *testin
incoming := map[string]any{"a": 1, "b": 2}
allowed, skipped := g.FilterProperties(settings, src, incoming, nil)

// Same map reference — zero-allocation happy path.
if &allowed == &incoming { // can't compare maps by pointer directly
// fallthrough; documented invariant is "same map contents"
}
if len(allowed) != 2 {
t.Errorf("expected pass-through of 2 entries, got %d", len(allowed))
}
Expand Down
1 change: 1 addition & 0 deletions internal/app/integration/service.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package integration implements the application service for the integration bounded context — orchestrates pkg/domain/integration entities and cross-cutting concerns (audit, notifications, RBAC).
package integration

import (
Expand Down
1 change: 1 addition & 0 deletions internal/app/jira/rescan_hook.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package jira implements the application service for the jira bounded context — orchestrates pkg/domain/jira entities and cross-cutting concerns (audit, notifications, RBAC).
package jira

import (
Expand Down
1 change: 1 addition & 0 deletions internal/app/module/service.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package module implements the application service for the module bounded context — orchestrates pkg/domain/module entities and cross-cutting concerns (audit, notifications, RBAC).
package module

import (
Expand Down
1 change: 1 addition & 0 deletions internal/app/outbox/service.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package outbox implements the application service for the outbox bounded context — orchestrates pkg/domain/outbox entities and cross-cutting concerns (audit, notifications, RBAC).
package outbox

import (
Expand Down
1 change: 1 addition & 0 deletions internal/app/scan/service.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package scan implements the application service for the scan bounded context — orchestrates pkg/domain/scan entities and cross-cutting concerns (audit, notifications, RBAC).
package scan

import (
Expand Down
1 change: 1 addition & 0 deletions internal/app/scope/service.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package scope implements the application service for the scope bounded context — orchestrates pkg/domain/scope entities and cross-cutting concerns (audit, notifications, RBAC).
package scope

import (
Expand Down
1 change: 1 addition & 0 deletions internal/app/template/scan_adapter.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package template implements the application service for the template bounded context — orchestrates pkg/domain/template entities and cross-cutting concerns (audit, notifications, RBAC).
package template

import (
Expand Down
2 changes: 1 addition & 1 deletion internal/app/template/validator.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package validators provides template validation for different scanner types.
// Package template provides template validation for different scanner types.
package template

import (
Expand Down
1 change: 1 addition & 0 deletions internal/app/tenant/service.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package tenant implements the application service for the tenant bounded context — orchestrates pkg/domain/tenant entities and cross-cutting concerns (audit, notifications, RBAC).
package tenant

import (
Expand Down
1 change: 1 addition & 0 deletions internal/app/threat/actor_service.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package threat implements the application service for the threat bounded context — orchestrates pkg/domain/threat entities and cross-cutting concerns (audit, notifications, RBAC).
package threat

import (
Expand Down
1 change: 1 addition & 0 deletions internal/app/tool/service.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package tool implements the application service for the tool bounded context — orchestrates pkg/domain/tool entities and cross-cutting concerns (audit, notifications, RBAC).
package tool

import (
Expand Down
1 change: 1 addition & 0 deletions internal/app/workflow/service.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package workflow implements the application service for the workflow bounded context — orchestrates pkg/domain/workflow entities and cross-cutting concerns (audit, notifications, RBAC).
package workflow

import (
Expand Down
1 change: 1 addition & 0 deletions internal/infra/http/chi_router.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package http hosts the HTTP server scaffolding (router, options, lifecycle).
package http

import (
Expand Down
1 change: 1 addition & 0 deletions internal/infra/postgres/access_control_repository.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package postgres provides PostgreSQL repository implementations for the domain interfaces in pkg/domain/.
package postgres

import (
Expand Down
1 change: 1 addition & 0 deletions internal/metrics/metrics.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package metrics
package metrics

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/domain/accesscontrol/entity.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package accesscontrol provides public types and helpers reusable across the codebase.
package accesscontrol

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/domain/apikey/entity.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package apikey provides public types and helpers reusable across the codebase.
package apikey

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/domain/asset/category.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package asset provides public types and helpers reusable across the codebase.
package asset

// Category groups asset types for UI organization and filtering.
Expand Down
2 changes: 1 addition & 1 deletion pkg/domain/assetgroup/entity.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package asset_group provides domain models for asset group management.
// Package assetgroup provides domain models for asset group management.
// Asset groups organize assets for CTEM (Continuous Threat Exposure Management) scoping.
package assetgroup

Expand Down
1 change: 1 addition & 0 deletions pkg/domain/assettype/entity.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package assettype provides public types and helpers reusable across the codebase.
package assettype

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/domain/attackerprofile/entity.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package attackerprofile provides public types and helpers reusable across the codebase.
package attackerprofile

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/domain/audit/entity.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package audit provides public types and helpers reusable across the codebase.
package audit

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/domain/branch/branch_type_rules.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package branch provides public types and helpers reusable across the codebase.
package branch

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/domain/compensatingcontrol/entity.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package compensatingcontrol provides public types and helpers reusable across the codebase.
package compensatingcontrol

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/domain/ctemcycle/entity.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package ctemcycle provides public types and helpers reusable across the codebase.
package ctemcycle

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/domain/datasource/asset_source.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package datasource provides public types and helpers reusable across the codebase.
package datasource

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/domain/exposure/entity.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package exposure provides public types and helpers reusable across the codebase.
package exposure

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/domain/findingsource/entity.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package findingsource provides public types and helpers reusable across the codebase.
package findingsource

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/domain/group/entity.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package group provides public types and helpers reusable across the codebase.
package group

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/domain/integration/entity.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package integration provides public types and helpers reusable across the codebase.
package integration

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/domain/module/dependency.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package module provides public types and helpers reusable across the codebase.
package module

import "strings"
Expand Down
1 change: 1 addition & 0 deletions pkg/domain/notification/entity.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package notification provides public types and helpers reusable across the codebase.
package notification

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/domain/permissionset/entity.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package permissionset provides public types and helpers reusable across the codebase.
package permissionset

import (
Expand Down
2 changes: 1 addition & 1 deletion pkg/domain/scannertemplate/entity.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package scanner_template defines the ScannerTemplate domain entity for custom scanner templates.
// Package scannertemplate defines the ScannerTemplate domain entity for custom scanner templates.
package scannertemplate

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/domain/scansession/entity.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package scansession provides public types and helpers reusable across the codebase.
package scansession

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/domain/scope/entity.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package scope provides public types and helpers reusable across the codebase.
package scope

import (
Expand Down
1 change: 1 addition & 0 deletions pkg/domain/secretstore/encryption.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package secretstore provides public types and helpers reusable across the codebase.
package secretstore

import (
Expand Down
Loading
Loading