handler

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StreamCicdLogs

func StreamCicdLogs(c echo.Context, tracker *kube.StepTracker) error

Types

type CICDGoldenPathHandler

type CICDGoldenPathHandler struct {
	// contains filtered or unexported fields
}

CICDGoldenPathHandler handles HTTP requests for CI/CD Golden Path operations.

func NewCICDGoldenPathHandler

func NewCICDGoldenPathHandler(goldenPathRepo port.CICDGoldenPathRepository) *CICDGoldenPathHandler

NewCICDGoldenPathHandler constructs a CICDGoldenPathHandler.

func (*CICDGoldenPathHandler) CreateGoldenPath

func (h *CICDGoldenPathHandler) CreateGoldenPath(c echo.Context) error

CreateGoldenPath handles POST /api/v1/cicd/golden-paths.

func (*CICDGoldenPathHandler) DeleteGoldenPath

func (h *CICDGoldenPathHandler) DeleteGoldenPath(c echo.Context) error

DeleteGoldenPath handles DELETE /api/v1/cicd/golden-paths/:id.

func (*CICDGoldenPathHandler) GetGoldenPath

func (h *CICDGoldenPathHandler) GetGoldenPath(c echo.Context) error

GetGoldenPath handles GET /api/v1/cicd/golden-paths/:id.

func (*CICDGoldenPathHandler) ListGoldenPaths

func (h *CICDGoldenPathHandler) ListGoldenPaths(c echo.Context) error

ListGoldenPaths handles GET /api/v1/cicd/golden-paths.

func (*CICDGoldenPathHandler) RegisterRoutes

func (h *CICDGoldenPathHandler) RegisterRoutes(g *echo.Group, writeGuards ...echo.MiddlewareFunc)

RegisterRoutes registers CI/CD Golden Path routes on the given Echo group.

writeGuards 는 생성·수정·삭제에만 붙는다. 골든패스는 조직 전체가 고르는 설치 조합이라 읽기는 /cicd 그룹의 세 역할 모두에게 열어 두고, 바꾸는 쪽은 호출하는 쪽이 좁힌다. 미들웨어를 여기서 만들지 않는 것은 cicd 가 auth 모듈을 직접 import 하지 않기 위함이다.

func (*CICDGoldenPathHandler) UpdateGoldenPath

func (h *CICDGoldenPathHandler) UpdateGoldenPath(c echo.Context) error

UpdateGoldenPath handles PUT /api/v1/cicd/golden-paths/:id.

type CICDTemplateHandler

type CICDTemplateHandler struct {
	// contains filtered or unexported fields
}

CICDTemplateHandler handles HTTP requests for CI/CD pipeline template operations.

func NewCICDTemplateHandler

func NewCICDTemplateHandler(templateRepo port.PipelineTemplateRepository) *CICDTemplateHandler

NewCICDTemplateHandler constructs a CICDTemplateHandler.

func (*CICDTemplateHandler) CreateTemplate

func (h *CICDTemplateHandler) CreateTemplate(c echo.Context) error

CreateTemplate handles POST /api/v1/cicd/templates.

func (*CICDTemplateHandler) DeleteTemplate

func (h *CICDTemplateHandler) DeleteTemplate(c echo.Context) error

DeleteTemplate handles DELETE /api/v1/cicd/templates/:id.

func (*CICDTemplateHandler) GetTemplate

func (h *CICDTemplateHandler) GetTemplate(c echo.Context) error

GetTemplate handles GET /api/v1/cicd/templates/:id.

func (*CICDTemplateHandler) ListTemplates

func (h *CICDTemplateHandler) ListTemplates(c echo.Context) error

ListTemplates handles GET /api/v1/cicd/templates.

func (*CICDTemplateHandler) RegisterRoutes

func (h *CICDTemplateHandler) RegisterRoutes(g *echo.Group)

RegisterRoutes registers CI/CD template routes on the given Echo group.

func (*CICDTemplateHandler) UpdateTemplate

func (h *CICDTemplateHandler) UpdateTemplate(c echo.Context) error

UpdateTemplate handles PUT /api/v1/cicd/templates/:id.

경로의 ID 가 대상이다. 저장된 템플릿을 읽어 요청에 있는 필드만 덧씌운다. 만든 사람은 바꾸지 않는다.

func (*CICDTemplateHandler) WithSourceArchive added in v0.6.0

func (h *CICDTemplateHandler) WithSourceArchive(sources port.SourceArchive) *CICDTemplateHandler

WithSourceArchive 는 원본 주소 확인을 배선한다. 배선하지 않으면 도메인 검증만 한다 — 저장은 되는데 파이프라인을 만들 때마다 실패하는 템플릿이 생길 수 있다.

type PipelineHandler

type PipelineHandler struct {
	// contains filtered or unexported fields
}

PipelineHandler handles HTTP requests for pipeline operations.

func NewPipelineHandler

func NewPipelineHandler(
	createPipeline *usecase.CreatePipeline,
	listPipelines *usecase.ListPipelines,
	deployPipeline *usecase.DeployPipeline,
	pipelineRepo port.PipelineRepository,
	deploymentRepo port.DeploymentRepository,
	kubeconfigProvider port.KubeconfigProvider,
	stepTracker *kube.StepTracker,
	pool *pgxpool.Pool,
) *PipelineHandler

NewPipelineHandler constructs a PipelineHandler.

func (*PipelineHandler) CreatePipeline

func (h *PipelineHandler) CreatePipeline(c echo.Context) error

CreatePipeline handles POST /api/v1/pipelines.

func (*PipelineHandler) DeletePipeline

func (h *PipelineHandler) DeletePipeline(c echo.Context) error

DeletePipeline handles DELETE /api/v1/cicd/pipelines/:id.

부수 리소스 삭제는 쿼리 파라미터로 각각 켠다. 기본값은 전부 끔이다 — 종전 동작(레코드만 삭제)을 유지하고, 되돌릴 수 없는 일은 명시적으로 요청받는다.

?cluster_resources=true  Argo CD Application 과 배포된 워크로드
?repository=true         소스 저장소
?images=true             레지스트리의 이미지 저장소

func (*PipelineHandler) DeployApp

func (h *PipelineHandler) DeployApp(c echo.Context) error

func (*PipelineHandler) DeployPipeline

func (h *PipelineHandler) DeployPipeline(c echo.Context) error

DeployPipeline handles POST /api/v1/pipelines/:id/deploy.

func (*PipelineHandler) GetDeployment

func (h *PipelineHandler) GetDeployment(c echo.Context) error

GetDeployment handles GET /api/v1/deployments/:id.

func (*PipelineHandler) GetPipelineResources

func (h *PipelineHandler) GetPipelineResources(c echo.Context) error

func (*PipelineHandler) GetRepositoryLocation added in v0.6.0

func (h *PipelineHandler) GetRepositoryLocation(c echo.Context) error

GetRepositoryLocation handles GET /api/v1/cicd/repository-location?stack_id=.

스택에 묶인 파이프라인의 앱 저장소는 언제나 <그룹>/<앱 이름> 으로 만들어진다. 앱 배포 화면이 그 주소를 미리 보여 주는 데 쓴다 — 전에는 화면이 저장소 경로를 입력받았지만 서버가 그 값을 쓰지 않았다.

func (*PipelineHandler) ListAppTemplates

func (h *PipelineHandler) ListAppTemplates(c echo.Context) error

func (*PipelineHandler) ListDependencyScans added in v0.6.0

func (h *PipelineHandler) ListDependencyScans(c echo.Context) error

ListDependencyScans handles GET /pipelines/:id/dependency-scans.

실행 기록 동기화가 남긴 의존성 스캔(SCA) 결과다. 건수 · 검사 대상 수는 모르면 빠진다 — 0 으로 채우지 않는다.

func (*PipelineHandler) ListDeployments

func (h *PipelineHandler) ListDeployments(c echo.Context) error

func (*PipelineHandler) ListImageScans added in v0.6.0

func (h *PipelineHandler) ListImageScans(c echo.Context) error

ListImageScans handles GET /pipelines/:id/image-scans.

func (*PipelineHandler) ListPipelines

func (h *PipelineHandler) ListPipelines(c echo.Context) error

func (*PipelineHandler) ListPipelinesByStack

func (h *PipelineHandler) ListPipelinesByStack(c echo.Context) error

ListPipelinesByStack handles GET /api/v1/stacks/:stackId/pipelines. Returns all pipelines linked to the given stack.

func (*PipelineHandler) ListSASTResults added in v0.6.0

func (h *PipelineHandler) ListSASTResults(c echo.Context) error

ListSASTResults handles GET /pipelines/:id/sast-results.

실행 기록 동기화가 남긴 분석 결과다. 실행 기록과는 deployment_id 로 잇는다.

func (*PipelineHandler) ListScanVulnerabilities added in v0.6.0

func (h *PipelineHandler) ListScanVulnerabilities(c echo.Context) error

ListScanVulnerabilities handles GET /pipelines/:id/image-scans/:scanId/vulnerabilities.

목록을 보일 수 없으면(리포트 만료·CI 불통) 200 과 함께 이유를 담는다.

func (*PipelineHandler) ListSecretScans added in v0.6.0

func (h *PipelineHandler) ListSecretScans(c echo.Context) error

ListSecretScans handles GET /pipelines/:id/secret-scans.

실행 기록 동기화가 남긴 시크릿 탐지 결과다. 비밀값은 저장하지 않으므로 응답에도 없다 — 탐지 위치뿐이다.

func (*PipelineHandler) RefreshPipelineDefinition added in v0.6.0

func (h *PipelineHandler) RefreshPipelineDefinition(c echo.Context) error

RefreshPipelineDefinition 은 POST /pipelines/:id/refresh-definition 을 처리한다.

SAST 리포트를 남기기 전에 만든 파이프라인은 실행 기록에 결과가 붙지 않았다 — 그 파이프라인의 sast 잡은 리포트를 남기지 않는다. 정의 파일을 플랫폼 기본으로 다시 쓰면 붙는다. 사용자가 손본 정의 파일은 덮어쓰므로 화면이 먼저 묻는다.

func (*PipelineHandler) RegisterRoutes

func (h *PipelineHandler) RegisterRoutes(g *echo.Group)

RegisterRoutes registers pipeline routes on the given Echo group.

func (*PipelineHandler) RegisterStackRoutes

func (h *PipelineHandler) RegisterStackRoutes(g *echo.Group)

RegisterStackRoutes registers pipeline routes under the /stacks group. This allows GET /api/v1/stacks/:stackId/pipelines without the Stack module importing the CI/CD module.

func (*PipelineHandler) StreamDeployLogs

func (h *PipelineHandler) StreamDeployLogs(c echo.Context) error

func (*PipelineHandler) WithDefinitionRefresh added in v0.6.0

func (h *PipelineHandler) WithDefinitionRefresh(uc *usecase.RefreshPipelineDefinition) *PipelineHandler

WithDefinitionRefresh 는 파이프라인 정의 갱신 경로를 배선한다.

func (*PipelineHandler) WithDeletePipeline

func (h *PipelineHandler) WithDeletePipeline(uc *usecase.DeletePipeline) *PipelineHandler

WithDeletePipeline 은 부수 리소스 삭제 경로를 배선한다.

func (*PipelineHandler) WithDependencyScans added in v0.6.0

WithDependencyScans 는 의존성 스캔(SCA) 결과 조회를 배선한다(Security Dashboard 설계 §8 G1).

func (*PipelineHandler) WithImageScans added in v0.6.0

func (*PipelineHandler) WithManifestApplier

func (h *PipelineHandler) WithManifestApplier(a port.ManifestApplier) *PipelineHandler

func (*PipelineHandler) WithRepositoryLocator added in v0.6.0

func (h *PipelineHandler) WithRepositoryLocator(l port.RepositoryLocator) *PipelineHandler

WithManifestApplier 는 직접 배포의 적용 경로를 배선한다. WithRepositoryLocator 는 스택의 앱 저장소 자리 조회를 배선한다.

func (*PipelineHandler) WithRunSync

func (*PipelineHandler) WithSASTResults added in v0.6.0

func (h *PipelineHandler) WithSASTResults(repo port.SASTResultRepository) *PipelineHandler

WithSASTResults 는 소스 정적 분석 결과 조회를 배선한다. 이미지 스캔과 같이 대시보드(#65)가 읽는 공개 경로다.

func (*PipelineHandler) WithScanVulnerabilities added in v0.6.0

func (h *PipelineHandler) WithScanVulnerabilities(uc *usecase.ScanVulnerabilities) *PipelineHandler

WithRunSync 는 CI 서버의 빌드 이력을 들이는 경로를 배선한다.

없으면 GitOps 경로(CI 가 빌드하고 Argo CD 가 배포)의 실행 통계가 비어 있는 채로 남는다 — 플랫폼이 직접 실행한 배포만 기록에 남기 때문이다. WithImageScans 는 이미지 스캔 결과 조회를 배선한다.

대시보드(#65)가 읽는 공개 경로다. 스캔 결과 테이블은 cicd 가 소유하므로 다른 모듈이 직접 조회하지 않는다. WithScanVulnerabilities 는 스캔 결과의 취약점 목록 조회를 배선한다.

func (*PipelineHandler) WithSecretScans added in v0.6.0

WithSecretScans 는 시크릿 탐지 결과 조회를 배선한다(Security Dashboard 설계 §8 G2).

func (*PipelineHandler) WithStackReader

func (h *PipelineHandler) WithStackReader(r port.StackReader) *PipelineHandler

WithStackReader 는 스택 요약 조회를 배선한다.

파이프라인 배포(DeployPipeline)와 직접 배포(DeployApp)가 같은 주소를 넣어야 한다 — 한쪽만 배선하면 배포 경로에 따라 추적이 되기도 하고 안 되기도 한다.

type ScanPolicyHandler added in v0.6.0

type ScanPolicyHandler struct {
	// contains filtered or unexported fields
}

ScanPolicyHandler 는 스택의 이미지 스캔 정책을 조회·저장한다.

스택 라우트(/stacks, admin·devops)에 붙는다. 정책은 그 스택의 모든 스캔 파이프라인의 배포 차단 여부를 바꾸므로 개발자 권한으로 열지 않는다.

func NewScanPolicyHandler added in v0.6.0

func NewScanPolicyHandler(svc *usecase.ScanPolicyService) *ScanPolicyHandler

NewScanPolicyHandler 는 ScanPolicyHandler 를 만든다.

func (*ScanPolicyHandler) GetScanPolicy added in v0.6.0

func (h *ScanPolicyHandler) GetScanPolicy(c echo.Context) error

GetScanPolicy 는 스택의 현재 정책이다. 저장한 적 없으면 기본 정책과 is_default=true 다.

func (*ScanPolicyHandler) RegisterStackRoutes added in v0.6.0

func (h *ScanPolicyHandler) RegisterStackRoutes(g *echo.Group)

RegisterStackRoutes 는 /stacks 그룹 아래에 정책 경로를 붙인다.

func (*ScanPolicyHandler) UpdateScanPolicy added in v0.6.0

func (h *ScanPolicyHandler) UpdateScanPolicy(c echo.Context) error

UpdateScanPolicy 는 정책을 저장하고 그 스택의 스캔 파이프라인에 싣는다.

푸시 일부가 실패해도 200 이다 — 정책은 저장됐고, 파이프라인별 결과(pushes)가 어느 파이프라인이 옛 정책으로 도는지 알려준다.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL