Skip to content
Snippets Groups Projects
Commit b2d757d2 authored by Yordan Kinkov's avatar Yordan Kinkov
Browse files

Merge branch '5-add-repository-to-policy-execution' into 'main'

Add task template documentation for new policy evaluation parameter

Closes #5

See merge request eclipse/xfsc/tsa/task!9
parents 5bd23e58 7e519112
Branches
No related tags found
No related merge requests found
...@@ -14,7 +14,7 @@ linters: ...@@ -14,7 +14,7 @@ linters:
- golangci-lint run - golangci-lint run
unit tests: unit tests:
image: golang:1.21.3 image: golang:1.21.4
stage: test stage: test
script: script:
- go version - go version
...@@ -23,7 +23,7 @@ unit tests: ...@@ -23,7 +23,7 @@ unit tests:
coverage: '/total:\s+\(statements\)\s+(\d+.\d+\%)/' coverage: '/total:\s+\(statements\)\s+(\d+.\d+\%)/'
govulncheck: govulncheck:
image: golang:1.21.3 image: golang:1.21.4
stage: test stage: test
script: script:
- go version - go version
......
FROM golang:1.21.3-alpine3.17 as builder FROM golang:1.21.4-alpine3.17 as builder
RUN apk add git RUN apk add git
......
FROM golang:1.21.3 FROM golang:1.21.4
RUN go install github.com/ysmood/kit/cmd/guard@v0.25.11 RUN go install github.com/ysmood/kit/cmd/guard@v0.25.11
......
...@@ -13,7 +13,7 @@ an example of task template definition: ...@@ -13,7 +13,7 @@ an example of task template definition:
"name":"exampleTask", "name":"exampleTask",
"url":"https://jsonplaceholder.typicode.com/todos/1", "url":"https://jsonplaceholder.typicode.com/todos/1",
"method":"GET", "method":"GET",
"requestPolicy":"example/example/1.0", "requestPolicy":"policies/example/example/1.0",
"responsePolicy":"", "responsePolicy":"",
"finalPolicy":"", "finalPolicy":"",
"cacheNamespace":"login", "cacheNamespace":"login",
......
...@@ -25,8 +25,8 @@ func New(addr string, httpClient *http.Client) *Client { ...@@ -25,8 +25,8 @@ func New(addr string, httpClient *http.Client) *Client {
// Evaluate calls the policy service to execute the given policy. // Evaluate calls the policy service to execute the given policy.
// The policy is expected as a string path uniquely identifying the // The policy is expected as a string path uniquely identifying the
// policy that has to be evaluated. For example, with policy = `xfsc/didResolve/1.0`, // policy that has to be evaluated. For example, with policy = `policies/xfsc/didResolve/1.0`,
// the client will do HTTP request to http://policyhost/policy/xfsc/didResolve/1.0/evaluation. // the client will do HTTP request to http://policyhost/policy/policies/xfsc/didResolve/1.0/evaluation.
func (c *Client) Evaluate(ctx context.Context, policy string, data []byte) ([]byte, error) { func (c *Client) Evaluate(ctx context.Context, policy string, data []byte) ([]byte, error) {
uri := c.addr + "/policy/" + policy + "/evaluation" uri := c.addr + "/policy/" + policy + "/evaluation"
policyURL, err := url.ParseRequestURI(uri) policyURL, err := url.ParseRequestURI(uri)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment