From 26772442e44361131ab70ca737cd48133bf888ae Mon Sep 17 00:00:00 2001 From: Chris Ainsworth-Patrick Date: Thu, 5 Sep 2024 11:23:12 +0100 Subject: [PATCH] add proxy-client back in --- policy/data/proxy/client.go | 12 ++++++++++++ policy/data/source.go | 2 ++ policy/policy.go | 1 + 3 files changed, 15 insertions(+) create mode 100644 policy/data/proxy/client.go diff --git a/policy/data/proxy/client.go b/policy/data/proxy/client.go new file mode 100644 index 0000000..2854eb8 --- /dev/null +++ b/policy/data/proxy/client.go @@ -0,0 +1,12 @@ +package proxy + +import ( + "context" + + "github.com/atomist-skills/go-skill/policy/goals" + "github.com/atomist-skills/go-skill/policy/types" +) + +type ProxyClient interface { + Evaluate(ctx context.Context, organization, teamId, url string, sbom *types.SBOM, args map[string]interface{}) (goals.EvaluationResult, error) +} diff --git a/policy/data/source.go b/policy/data/source.go index 092be26..306b938 100644 --- a/policy/data/source.go +++ b/policy/data/source.go @@ -3,6 +3,7 @@ package data import ( "context" + "github.com/atomist-skills/go-skill/policy/data/proxy" "github.com/atomist-skills/go-skill/policy/data/query" "github.com/atomist-skills/go-skill/policy/goals" "github.com/atomist-skills/go-skill/policy/types" @@ -10,6 +11,7 @@ import ( type DataSource interface { GetQueryClient() query.QueryClient + GetProxyClient() proxy.ProxyClient GetImageVulnerabilities(ctx context.Context, evalCtx goals.GoalEvaluationContext, imageSbom types.SBOM) (*query.QueryResponse, []types.Package, map[string][]types.Vulnerability, error) } diff --git a/policy/policy.go b/policy/policy.go index ba840da..20b1c43 100644 --- a/policy/policy.go +++ b/policy/policy.go @@ -16,4 +16,5 @@ type Policy struct { WithLocal bool WithAsync bool WithSyncQuery bool + WithProxy bool }