Skip to content
Snippets Groups Projects
Commit 915d6763 authored by Lyuben Penkovski's avatar Lyuben Penkovski
Browse files

Add temporary evaluation path ending with 'did.json' for the demo

parent 619091fc
No related branches found
No related tags found
1 merge request!30Add temporary evaluation path ending with 'did.json' for the demo
Pipeline #52274 passed with stages
in 1 minute and 15 seconds
...@@ -23,6 +23,7 @@ var _ = Service("policy", func() { ...@@ -23,6 +23,7 @@ var _ = Service("policy", func() {
Payload(EvaluateRequest) Payload(EvaluateRequest)
Result(EvaluateResult) Result(EvaluateResult)
HTTP(func() { HTTP(func() {
GET("/policy/{group}/{policyName}/{version}/evaluation/did.json")
GET("/policy/{group}/{policyName}/{version}/evaluation") GET("/policy/{group}/{policyName}/{version}/evaluation")
POST("/policy/{group}/{policyName}/{version}/evaluation") POST("/policy/{group}/{policyName}/{version}/evaluation")
Header("evaluationID:x-evaluation-id", String, "EvaluationID allows overwriting the randomly generated evaluationID", func() { Header("evaluationID:x-evaluation-id", String, "EvaluationID allows overwriting the randomly generated evaluationID", func() {
......
{"swagger":"2.0","info":{"title":"Policy Service","description":"The policy service exposes HTTP API for executing policies.","version":""},"host":"localhost:8081","consumes":["application/json","application/xml","application/gob"],"produces":["application/json","application/xml","application/gob"],"paths":{"/liveness":{"get":{"tags":["health"],"summary":"Liveness health","operationId":"health#Liveness","responses":{"200":{"description":"OK response."}},"schemes":["http"]}},"/policy/{group}/{policyName}/{version}/evaluation":{"get":{"tags":["policy"],"summary":"Evaluate policy","description":"Evaluate executes a policy with the given 'data' as input.","operationId":"policy#Evaluate","parameters":[{"name":"group","in":"path","description":"Policy group.","required":true,"type":"string"},{"name":"policyName","in":"path","description":"Policy name.","required":true,"type":"string"},{"name":"version","in":"path","description":"Policy version.","required":true,"type":"string"},{"name":"x-evaluation-id","in":"header","description":"EvaluationID allows overwriting the randomly generated evaluationID","required":false,"type":"string"},{"name":"any","in":"body","description":"Input data passed to the policy execution runtime.","required":true,"schema":{"type":"string","format":"binary"}}],"responses":{"200":{"description":"OK response.","schema":{"type":"string","format":"binary"},"headers":{"ETag":{"description":"ETag contains unique identifier of the policy evaluation and can be used to later retrieve the results from Cache.","type":"string"}}}},"schemes":["http"]},"post":{"tags":["policy"],"summary":"Evaluate policy","description":"Evaluate executes a policy with the given 'data' as input.","operationId":"policy#Evaluate#1","parameters":[{"name":"group","in":"path","description":"Policy group.","required":true,"type":"string"},{"name":"policyName","in":"path","description":"Policy name.","required":true,"type":"string"},{"name":"version","in":"path","description":"Policy version.","required":true,"type":"string"},{"name":"x-evaluation-id","in":"header","description":"EvaluationID allows overwriting the randomly generated evaluationID","required":false,"type":"string"},{"name":"any","in":"body","description":"Input data passed to the policy execution runtime.","required":true,"schema":{"type":"string","format":"binary"}}],"responses":{"200":{"description":"OK response.","schema":{"type":"string","format":"binary"},"headers":{"ETag":{"description":"ETag contains unique identifier of the policy evaluation and can be used to later retrieve the results from Cache.","type":"string"}}}},"schemes":["http"]}},"/policy/{group}/{policyName}/{version}/lock":{"post":{"tags":["policy"],"summary":"Lock policy","description":"Lock a policy so that it cannot be evaluated.","operationId":"policy#Lock","parameters":[{"name":"group","in":"path","description":"Policy group.","required":true,"type":"string"},{"name":"policyName","in":"path","description":"Policy name.","required":true,"type":"string"},{"name":"version","in":"path","description":"Policy version.","required":true,"type":"string"}],"responses":{"200":{"description":"OK response."}},"schemes":["http"]},"delete":{"tags":["policy"],"summary":"Unlock policy","description":"Unlock a policy so it can be evaluated again.","operationId":"policy#Unlock","parameters":[{"name":"group","in":"path","description":"Policy group.","required":true,"type":"string"},{"name":"policyName","in":"path","description":"Policy name.","required":true,"type":"string"},{"name":"version","in":"path","description":"Policy version.","required":true,"type":"string"}],"responses":{"200":{"description":"OK response."}},"schemes":["http"]}},"/readiness":{"get":{"tags":["health"],"summary":"Readiness health","operationId":"health#Readiness","responses":{"200":{"description":"OK response."}},"schemes":["http"]}}}} {"swagger":"2.0","info":{"title":"Policy Service","description":"The policy service exposes HTTP API for executing policies.","version":""},"host":"localhost:8081","consumes":["application/json","application/xml","application/gob"],"produces":["application/json","application/xml","application/gob"],"paths":{"/liveness":{"get":{"tags":["health"],"summary":"Liveness health","operationId":"health#Liveness","responses":{"200":{"description":"OK response."}},"schemes":["http"]}},"/policy/{group}/{policyName}/{version}/evaluation":{"get":{"tags":["policy"],"summary":"Evaluate policy","description":"Evaluate executes a policy with the given 'data' as input.","operationId":"policy#Evaluate#1","parameters":[{"name":"group","in":"path","description":"Policy group.","required":true,"type":"string"},{"name":"policyName","in":"path","description":"Policy name.","required":true,"type":"string"},{"name":"version","in":"path","description":"Policy version.","required":true,"type":"string"},{"name":"x-evaluation-id","in":"header","description":"EvaluationID allows overwriting the randomly generated evaluationID","required":false,"type":"string"},{"name":"any","in":"body","description":"Input data passed to the policy execution runtime.","required":true,"schema":{"type":"string","format":"binary"}}],"responses":{"200":{"description":"OK response.","schema":{"type":"string","format":"binary"},"headers":{"ETag":{"description":"ETag contains unique identifier of the policy evaluation and can be used to later retrieve the results from Cache.","type":"string"}}}},"schemes":["http"]},"post":{"tags":["policy"],"summary":"Evaluate policy","description":"Evaluate executes a policy with the given 'data' as input.","operationId":"policy#Evaluate#2","parameters":[{"name":"group","in":"path","description":"Policy group.","required":true,"type":"string"},{"name":"policyName","in":"path","description":"Policy name.","required":true,"type":"string"},{"name":"version","in":"path","description":"Policy version.","required":true,"type":"string"},{"name":"x-evaluation-id","in":"header","description":"EvaluationID allows overwriting the randomly generated evaluationID","required":false,"type":"string"},{"name":"any","in":"body","description":"Input data passed to the policy execution runtime.","required":true,"schema":{"type":"string","format":"binary"}}],"responses":{"200":{"description":"OK response.","schema":{"type":"string","format":"binary"},"headers":{"ETag":{"description":"ETag contains unique identifier of the policy evaluation and can be used to later retrieve the results from Cache.","type":"string"}}}},"schemes":["http"]}},"/policy/{group}/{policyName}/{version}/evaluation/did.json":{"get":{"tags":["policy"],"summary":"Evaluate policy","description":"Evaluate executes a policy with the given 'data' as input.","operationId":"policy#Evaluate","parameters":[{"name":"group","in":"path","description":"Policy group.","required":true,"type":"string"},{"name":"policyName","in":"path","description":"Policy name.","required":true,"type":"string"},{"name":"version","in":"path","description":"Policy version.","required":true,"type":"string"},{"name":"x-evaluation-id","in":"header","description":"EvaluationID allows overwriting the randomly generated evaluationID","required":false,"type":"string"},{"name":"any","in":"body","description":"Input data passed to the policy execution runtime.","required":true,"schema":{"type":"string","format":"binary"}}],"responses":{"200":{"description":"OK response.","schema":{"type":"string","format":"binary"},"headers":{"ETag":{"description":"ETag contains unique identifier of the policy evaluation and can be used to later retrieve the results from Cache.","type":"string"}}}},"schemes":["http"]}},"/policy/{group}/{policyName}/{version}/lock":{"post":{"tags":["policy"],"summary":"Lock policy","description":"Lock a policy so that it cannot be evaluated.","operationId":"policy#Lock","parameters":[{"name":"group","in":"path","description":"Policy group.","required":true,"type":"string"},{"name":"policyName","in":"path","description":"Policy name.","required":true,"type":"string"},{"name":"version","in":"path","description":"Policy version.","required":true,"type":"string"}],"responses":{"200":{"description":"OK response."}},"schemes":["http"]},"delete":{"tags":["policy"],"summary":"Unlock policy","description":"Unlock a policy so it can be evaluated again.","operationId":"policy#Unlock","parameters":[{"name":"group","in":"path","description":"Policy group.","required":true,"type":"string"},{"name":"policyName","in":"path","description":"Policy name.","required":true,"type":"string"},{"name":"version","in":"path","description":"Policy version.","required":true,"type":"string"}],"responses":{"200":{"description":"OK response."}},"schemes":["http"]}},"/readiness":{"get":{"tags":["health"],"summary":"Readiness health","operationId":"health#Readiness","responses":{"200":{"description":"OK response."}},"schemes":["http"]}}}}
\ No newline at end of file \ No newline at end of file
...@@ -30,7 +30,7 @@ paths: ...@@ -30,7 +30,7 @@ paths:
- policy - policy
summary: Evaluate policy summary: Evaluate policy
description: Evaluate executes a policy with the given 'data' as input. description: Evaluate executes a policy with the given 'data' as input.
operationId: policy#Evaluate operationId: policy#Evaluate#1
parameters: parameters:
- name: group - name: group
in: path in: path
...@@ -77,7 +77,55 @@ paths: ...@@ -77,7 +77,55 @@ paths:
- policy - policy
summary: Evaluate policy summary: Evaluate policy
description: Evaluate executes a policy with the given 'data' as input. description: Evaluate executes a policy with the given 'data' as input.
operationId: policy#Evaluate#1 operationId: policy#Evaluate#2
parameters:
- name: group
in: path
description: Policy group.
required: true
type: string
- name: policyName
in: path
description: Policy name.
required: true
type: string
- name: version
in: path
description: Policy version.
required: true
type: string
- name: x-evaluation-id
in: header
description: EvaluationID allows overwriting the randomly generated evaluationID
required: false
type: string
- name: any
in: body
description: Input data passed to the policy execution runtime.
required: true
schema:
type: string
format: binary
responses:
"200":
description: OK response.
schema:
type: string
format: binary
headers:
ETag:
description: ETag contains unique identifier of the policy evaluation
and can be used to later retrieve the results from Cache.
type: string
schemes:
- http
/policy/{group}/{policyName}/{version}/evaluation/did.json:
get:
tags:
- policy
summary: Evaluate policy
description: Evaluate executes a policy with the given 'data' as input.
operationId: policy#Evaluate
parameters: parameters:
- name: group - name: group
in: path in: path
......
{"openapi":"3.0.3","info":{"title":"Policy Service","description":"The policy service exposes HTTP API for executing policies.","version":"1.0"},"servers":[{"url":"http://localhost:8081","description":"Policy Server"}],"paths":{"/liveness":{"get":{"tags":["health"],"summary":"Liveness health","operationId":"health#Liveness","responses":{"200":{"description":"OK response."}}}},"/policy/{group}/{policyName}/{version}/evaluation":{"get":{"tags":["policy"],"summary":"Evaluate policy","description":"Evaluate executes a policy with the given 'data' as input.","operationId":"policy#Evaluate","parameters":[{"name":"group","in":"path","description":"Policy group.","required":true,"schema":{"type":"string","description":"Policy group.","example":"example"},"example":"example"},{"name":"policyName","in":"path","description":"Policy name.","required":true,"schema":{"type":"string","description":"Policy name.","example":"example"},"example":"example"},{"name":"version","in":"path","description":"Policy version.","required":true,"schema":{"type":"string","description":"Policy version.","example":"1.0"},"example":"1.0"},{"name":"x-evaluation-id","in":"header","description":"EvaluationID allows overwriting the randomly generated evaluationID","allowEmptyValue":true,"schema":{"type":"string","description":"EvaluationID allows overwriting the randomly generated evaluationID","example":"did:web:example.com"},"example":"did:web:example.com"}],"requestBody":{"description":"Input data passed to the policy execution runtime.","required":true,"content":{"application/json":{"schema":{"type":"string","description":"Input data passed to the policy execution runtime.","example":"Quis quos qui earum velit illum.","format":"binary"},"example":"Aut facere veniam repudiandae id."}}},"responses":{"200":{"description":"OK response.","headers":{"ETag":{"description":"ETag contains unique identifier of the policy evaluation and can be used to later retrieve the results from Cache.","required":true,"schema":{"type":"string","description":"ETag contains unique identifier of the policy evaluation and can be used to later retrieve the results from Cache.","example":"Aut minus alias."},"example":"At eos facilis molestias in voluptas rem."}},"content":{"application/json":{"schema":{"type":"string","description":"Arbitrary JSON response.","example":"Aliquam atque voluptatum ut dolorem.","format":"binary"},"example":"Ab accusantium ut ut aliquid sint animi."}}}}},"post":{"tags":["policy"],"summary":"Evaluate policy","description":"Evaluate executes a policy with the given 'data' as input.","operationId":"policy#Evaluate#1","parameters":[{"name":"group","in":"path","description":"Policy group.","required":true,"schema":{"type":"string","description":"Policy group.","example":"example"},"example":"example"},{"name":"policyName","in":"path","description":"Policy name.","required":true,"schema":{"type":"string","description":"Policy name.","example":"example"},"example":"example"},{"name":"version","in":"path","description":"Policy version.","required":true,"schema":{"type":"string","description":"Policy version.","example":"1.0"},"example":"1.0"},{"name":"x-evaluation-id","in":"header","description":"EvaluationID allows overwriting the randomly generated evaluationID","allowEmptyValue":true,"schema":{"type":"string","description":"EvaluationID allows overwriting the randomly generated evaluationID","example":"did:web:example.com"},"example":"did:web:example.com"}],"requestBody":{"description":"Input data passed to the policy execution runtime.","required":true,"content":{"application/json":{"schema":{"type":"string","description":"Input data passed to the policy execution runtime.","example":"Quis quos qui earum velit illum.","format":"binary"},"example":"Dolorem cumque laborum quis nesciunt."}}},"responses":{"200":{"description":"OK response.","headers":{"ETag":{"description":"ETag contains unique identifier of the policy evaluation and can be used to later retrieve the results from Cache.","required":true,"schema":{"type":"string","description":"ETag contains unique identifier of the policy evaluation and can be used to later retrieve the results from Cache.","example":"Aut voluptas."},"example":"Sint nam voluptatem ea consequatur similique et."}},"content":{"application/json":{"schema":{"type":"string","description":"Arbitrary JSON response.","example":"Aliquam atque voluptatum ut dolorem.","format":"binary"},"example":"Non mollitia nesciunt impedit facere."}}}}}},"/policy/{group}/{policyName}/{version}/lock":{"delete":{"tags":["policy"],"summary":"Unlock policy","description":"Unlock a policy so it can be evaluated again.","operationId":"policy#Unlock","parameters":[{"name":"group","in":"path","description":"Policy group.","required":true,"schema":{"type":"string","description":"Policy group.","example":"Qui non quia."},"example":"Error maxime quasi quia non voluptatibus error."},{"name":"policyName","in":"path","description":"Policy name.","required":true,"schema":{"type":"string","description":"Policy name.","example":"Optio quia et laborum."},"example":"In libero perspiciatis voluptatum ut soluta."},{"name":"version","in":"path","description":"Policy version.","required":true,"schema":{"type":"string","description":"Policy version.","example":"Ut amet."},"example":"Accusamus enim."}],"responses":{"200":{"description":"OK response."}}},"post":{"tags":["policy"],"summary":"Lock policy","description":"Lock a policy so that it cannot be evaluated.","operationId":"policy#Lock","parameters":[{"name":"group","in":"path","description":"Policy group.","required":true,"schema":{"type":"string","description":"Policy group.","example":"Ut commodi perspiciatis corporis."},"example":"Accusamus autem sequi."},{"name":"policyName","in":"path","description":"Policy name.","required":true,"schema":{"type":"string","description":"Policy name.","example":"Et nulla."},"example":"In quis nesciunt autem et."},{"name":"version","in":"path","description":"Policy version.","required":true,"schema":{"type":"string","description":"Policy version.","example":"Sunt in et quia cum."},"example":"Commodi nemo fugiat id praesentium accusantium expedita."}],"responses":{"200":{"description":"OK response."}}}},"/readiness":{"get":{"tags":["health"],"summary":"Readiness health","operationId":"health#Readiness","responses":{"200":{"description":"OK response."}}}}},"components":{},"tags":[{"name":"health","description":"Health service provides health check endpoints."},{"name":"policy","description":"Policy Service provides evaluation of policies through Open Policy Agent."}]} {"openapi":"3.0.3","info":{"title":"Policy Service","description":"The policy service exposes HTTP API for executing policies.","version":"1.0"},"servers":[{"url":"http://localhost:8081","description":"Policy Server"}],"paths":{"/liveness":{"get":{"tags":["health"],"summary":"Liveness health","operationId":"health#Liveness","responses":{"200":{"description":"OK response."}}}},"/policy/{group}/{policyName}/{version}/evaluation":{"get":{"tags":["policy"],"summary":"Evaluate policy","description":"Evaluate executes a policy with the given 'data' as input.","operationId":"policy#Evaluate#1","parameters":[{"name":"group","in":"path","description":"Policy group.","required":true,"schema":{"type":"string","description":"Policy group.","example":"example"},"example":"example"},{"name":"policyName","in":"path","description":"Policy name.","required":true,"schema":{"type":"string","description":"Policy name.","example":"example"},"example":"example"},{"name":"version","in":"path","description":"Policy version.","required":true,"schema":{"type":"string","description":"Policy version.","example":"1.0"},"example":"1.0"},{"name":"x-evaluation-id","in":"header","description":"EvaluationID allows overwriting the randomly generated evaluationID","allowEmptyValue":true,"schema":{"type":"string","description":"EvaluationID allows overwriting the randomly generated evaluationID","example":"did:web:example.com"},"example":"did:web:example.com"}],"requestBody":{"description":"Input data passed to the policy execution runtime.","required":true,"content":{"application/json":{"schema":{"type":"string","description":"Input data passed to the policy execution runtime.","example":"Quis quos qui earum velit illum.","format":"binary"},"example":"Dolorem cumque laborum quis nesciunt."}}},"responses":{"200":{"description":"OK response.","headers":{"ETag":{"description":"ETag contains unique identifier of the policy evaluation and can be used to later retrieve the results from Cache.","required":true,"schema":{"type":"string","description":"ETag contains unique identifier of the policy evaluation and can be used to later retrieve the results from Cache.","example":"Aut voluptas."},"example":"Sint nam voluptatem ea consequatur similique et."}},"content":{"application/json":{"schema":{"type":"string","description":"Arbitrary JSON response.","example":"Aliquam atque voluptatum ut dolorem.","format":"binary"},"example":"Non mollitia nesciunt impedit facere."}}}}},"post":{"tags":["policy"],"summary":"Evaluate policy","description":"Evaluate executes a policy with the given 'data' as input.","operationId":"policy#Evaluate#2","parameters":[{"name":"group","in":"path","description":"Policy group.","required":true,"schema":{"type":"string","description":"Policy group.","example":"example"},"example":"example"},{"name":"policyName","in":"path","description":"Policy name.","required":true,"schema":{"type":"string","description":"Policy name.","example":"example"},"example":"example"},{"name":"version","in":"path","description":"Policy version.","required":true,"schema":{"type":"string","description":"Policy version.","example":"1.0"},"example":"1.0"},{"name":"x-evaluation-id","in":"header","description":"EvaluationID allows overwriting the randomly generated evaluationID","allowEmptyValue":true,"schema":{"type":"string","description":"EvaluationID allows overwriting the randomly generated evaluationID","example":"did:web:example.com"},"example":"did:web:example.com"}],"requestBody":{"description":"Input data passed to the policy execution runtime.","required":true,"content":{"application/json":{"schema":{"type":"string","description":"Input data passed to the policy execution runtime.","example":"Quis quos qui earum velit illum.","format":"binary"},"example":"Ut commodi perspiciatis corporis."}}},"responses":{"200":{"description":"OK response.","headers":{"ETag":{"description":"ETag contains unique identifier of the policy evaluation and can be used to later retrieve the results from Cache.","required":true,"schema":{"type":"string","description":"ETag contains unique identifier of the policy evaluation and can be used to later retrieve the results from Cache.","example":"Accusamus autem sequi."},"example":"Et nulla."}},"content":{"application/json":{"schema":{"type":"string","description":"Arbitrary JSON response.","example":"Aliquam atque voluptatum ut dolorem.","format":"binary"},"example":"In quis nesciunt autem et."}}}}}},"/policy/{group}/{policyName}/{version}/evaluation/did.json":{"get":{"tags":["policy"],"summary":"Evaluate policy","description":"Evaluate executes a policy with the given 'data' as input.","operationId":"policy#Evaluate","parameters":[{"name":"group","in":"path","description":"Policy group.","required":true,"schema":{"type":"string","description":"Policy group.","example":"example"},"example":"example"},{"name":"policyName","in":"path","description":"Policy name.","required":true,"schema":{"type":"string","description":"Policy name.","example":"example"},"example":"example"},{"name":"version","in":"path","description":"Policy version.","required":true,"schema":{"type":"string","description":"Policy version.","example":"1.0"},"example":"1.0"},{"name":"x-evaluation-id","in":"header","description":"EvaluationID allows overwriting the randomly generated evaluationID","allowEmptyValue":true,"schema":{"type":"string","description":"EvaluationID allows overwriting the randomly generated evaluationID","example":"did:web:example.com"},"example":"did:web:example.com"}],"requestBody":{"description":"Input data passed to the policy execution runtime.","required":true,"content":{"application/json":{"schema":{"type":"string","description":"Input data passed to the policy execution runtime.","example":"Quis quos qui earum velit illum.","format":"binary"},"example":"Aut facere veniam repudiandae id."}}},"responses":{"200":{"description":"OK response.","headers":{"ETag":{"description":"ETag contains unique identifier of the policy evaluation and can be used to later retrieve the results from Cache.","required":true,"schema":{"type":"string","description":"ETag contains unique identifier of the policy evaluation and can be used to later retrieve the results from Cache.","example":"Aut minus alias."},"example":"At eos facilis molestias in voluptas rem."}},"content":{"application/json":{"schema":{"type":"string","description":"Arbitrary JSON response.","example":"Aliquam atque voluptatum ut dolorem.","format":"binary"},"example":"Ab accusantium ut ut aliquid sint animi."}}}}}},"/policy/{group}/{policyName}/{version}/lock":{"delete":{"tags":["policy"],"summary":"Unlock policy","description":"Unlock a policy so it can be evaluated again.","operationId":"policy#Unlock","parameters":[{"name":"group","in":"path","description":"Policy group.","required":true,"schema":{"type":"string","description":"Policy group.","example":"Ut amet."},"example":"Accusamus enim."},{"name":"policyName","in":"path","description":"Policy name.","required":true,"schema":{"type":"string","description":"Policy name.","example":"Recusandae est rerum corrupti quia."},"example":"Quam dolores architecto itaque."},{"name":"version","in":"path","description":"Policy version.","required":true,"schema":{"type":"string","description":"Policy version.","example":"Voluptas ad corporis adipisci inventore ipsum."},"example":"Recusandae dolorum nisi distinctio vitae ad."}],"responses":{"200":{"description":"OK response."}}},"post":{"tags":["policy"],"summary":"Lock policy","description":"Lock a policy so that it cannot be evaluated.","operationId":"policy#Lock","parameters":[{"name":"group","in":"path","description":"Policy group.","required":true,"schema":{"type":"string","description":"Policy group.","example":"Sunt in et quia cum."},"example":"Commodi nemo fugiat id praesentium accusantium expedita."},{"name":"policyName","in":"path","description":"Policy name.","required":true,"schema":{"type":"string","description":"Policy name.","example":"Qui non quia."},"example":"Error maxime quasi quia non voluptatibus error."},{"name":"version","in":"path","description":"Policy version.","required":true,"schema":{"type":"string","description":"Policy version.","example":"Optio quia et laborum."},"example":"In libero perspiciatis voluptatum ut soluta."}],"responses":{"200":{"description":"OK response."}}}},"/readiness":{"get":{"tags":["health"],"summary":"Readiness health","operationId":"health#Readiness","responses":{"200":{"description":"OK response."}}}}},"components":{},"tags":[{"name":"health","description":"Health service provides health check endpoints."},{"name":"policy","description":"Policy Service provides evaluation of policies through Open Policy Agent."}]}
\ No newline at end of file \ No newline at end of file
...@@ -22,7 +22,7 @@ paths: ...@@ -22,7 +22,7 @@ paths:
- policy - policy
summary: Evaluate policy summary: Evaluate policy
description: Evaluate executes a policy with the given 'data' as input. description: Evaluate executes a policy with the given 'data' as input.
operationId: policy#Evaluate operationId: policy#Evaluate#1
parameters: parameters:
- name: group - name: group
in: path in: path
...@@ -70,7 +70,7 @@ paths: ...@@ -70,7 +70,7 @@ paths:
description: Input data passed to the policy execution runtime. description: Input data passed to the policy execution runtime.
example: Quis quos qui earum velit illum. example: Quis quos qui earum velit illum.
format: binary format: binary
example: Aut facere veniam repudiandae id. example: Dolorem cumque laborum quis nesciunt.
responses: responses:
"200": "200":
description: OK response. description: OK response.
...@@ -83,8 +83,8 @@ paths: ...@@ -83,8 +83,8 @@ paths:
type: string type: string
description: ETag contains unique identifier of the policy evaluation description: ETag contains unique identifier of the policy evaluation
and can be used to later retrieve the results from Cache. and can be used to later retrieve the results from Cache.
example: Aut minus alias. example: Aut voluptas.
example: At eos facilis molestias in voluptas rem. example: Sint nam voluptatem ea consequatur similique et.
content: content:
application/json: application/json:
schema: schema:
...@@ -92,13 +92,13 @@ paths: ...@@ -92,13 +92,13 @@ paths:
description: Arbitrary JSON response. description: Arbitrary JSON response.
example: Aliquam atque voluptatum ut dolorem. example: Aliquam atque voluptatum ut dolorem.
format: binary format: binary
example: Ab accusantium ut ut aliquid sint animi. example: Non mollitia nesciunt impedit facere.
post: post:
tags: tags:
- policy - policy
summary: Evaluate policy summary: Evaluate policy
description: Evaluate executes a policy with the given 'data' as input. description: Evaluate executes a policy with the given 'data' as input.
operationId: policy#Evaluate#1 operationId: policy#Evaluate#2
parameters: parameters:
- name: group - name: group
in: path in: path
...@@ -146,7 +146,7 @@ paths: ...@@ -146,7 +146,7 @@ paths:
description: Input data passed to the policy execution runtime. description: Input data passed to the policy execution runtime.
example: Quis quos qui earum velit illum. example: Quis quos qui earum velit illum.
format: binary format: binary
example: Dolorem cumque laborum quis nesciunt. example: Ut commodi perspiciatis corporis.
responses: responses:
"200": "200":
description: OK response. description: OK response.
...@@ -159,8 +159,8 @@ paths: ...@@ -159,8 +159,8 @@ paths:
type: string type: string
description: ETag contains unique identifier of the policy evaluation description: ETag contains unique identifier of the policy evaluation
and can be used to later retrieve the results from Cache. and can be used to later retrieve the results from Cache.
example: Aut voluptas. example: Accusamus autem sequi.
example: Sint nam voluptatem ea consequatur similique et. example: Et nulla.
content: content:
application/json: application/json:
schema: schema:
...@@ -168,7 +168,84 @@ paths: ...@@ -168,7 +168,84 @@ paths:
description: Arbitrary JSON response. description: Arbitrary JSON response.
example: Aliquam atque voluptatum ut dolorem. example: Aliquam atque voluptatum ut dolorem.
format: binary format: binary
example: Non mollitia nesciunt impedit facere. example: In quis nesciunt autem et.
/policy/{group}/{policyName}/{version}/evaluation/did.json:
get:
tags:
- policy
summary: Evaluate policy
description: Evaluate executes a policy with the given 'data' as input.
operationId: policy#Evaluate
parameters:
- name: group
in: path
description: Policy group.
required: true
schema:
type: string
description: Policy group.
example: example
example: example
- name: policyName
in: path
description: Policy name.
required: true
schema:
type: string
description: Policy name.
example: example
example: example
- name: version
in: path
description: Policy version.
required: true
schema:
type: string
description: Policy version.
example: "1.0"
example: "1.0"
- name: x-evaluation-id
in: header
description: EvaluationID allows overwriting the randomly generated evaluationID
allowEmptyValue: true
schema:
type: string
description: EvaluationID allows overwriting the randomly generated evaluationID
example: did:web:example.com
example: did:web:example.com
requestBody:
description: Input data passed to the policy execution runtime.
required: true
content:
application/json:
schema:
type: string
description: Input data passed to the policy execution runtime.
example: Quis quos qui earum velit illum.
format: binary
example: Aut facere veniam repudiandae id.
responses:
"200":
description: OK response.
headers:
ETag:
description: ETag contains unique identifier of the policy evaluation
and can be used to later retrieve the results from Cache.
required: true
schema:
type: string
description: ETag contains unique identifier of the policy evaluation
and can be used to later retrieve the results from Cache.
example: Aut minus alias.
example: At eos facilis molestias in voluptas rem.
content:
application/json:
schema:
type: string
description: Arbitrary JSON response.
example: Aliquam atque voluptatum ut dolorem.
format: binary
example: Ab accusantium ut ut aliquid sint animi.
/policy/{group}/{policyName}/{version}/lock: /policy/{group}/{policyName}/{version}/lock:
delete: delete:
tags: tags:
...@@ -184,8 +261,8 @@ paths: ...@@ -184,8 +261,8 @@ paths:
schema: schema:
type: string type: string
description: Policy group. description: Policy group.
example: Qui non quia. example: Ut amet.
example: Error maxime quasi quia non voluptatibus error. example: Accusamus enim.
- name: policyName - name: policyName
in: path in: path
description: Policy name. description: Policy name.
...@@ -193,8 +270,8 @@ paths: ...@@ -193,8 +270,8 @@ paths:
schema: schema:
type: string type: string
description: Policy name. description: Policy name.
example: Optio quia et laborum. example: Recusandae est rerum corrupti quia.
example: In libero perspiciatis voluptatum ut soluta. example: Quam dolores architecto itaque.
- name: version - name: version
in: path in: path
description: Policy version. description: Policy version.
...@@ -202,8 +279,8 @@ paths: ...@@ -202,8 +279,8 @@ paths:
schema: schema:
type: string type: string
description: Policy version. description: Policy version.
example: Ut amet. example: Voluptas ad corporis adipisci inventore ipsum.
example: Accusamus enim. example: Recusandae dolorum nisi distinctio vitae ad.
responses: responses:
"200": "200":
description: OK response. description: OK response.
...@@ -221,8 +298,8 @@ paths: ...@@ -221,8 +298,8 @@ paths:
schema: schema:
type: string type: string
description: Policy group. description: Policy group.
example: Ut commodi perspiciatis corporis. example: Sunt in et quia cum.
example: Accusamus autem sequi. example: Commodi nemo fugiat id praesentium accusantium expedita.
- name: policyName - name: policyName
in: path in: path
description: Policy name. description: Policy name.
...@@ -230,8 +307,8 @@ paths: ...@@ -230,8 +307,8 @@ paths:
schema: schema:
type: string type: string
description: Policy name. description: Policy name.
example: Et nulla. example: Qui non quia.
example: In quis nesciunt autem et. example: Error maxime quasi quia non voluptatibus error.
- name: version - name: version
in: path in: path
description: Policy version. description: Policy version.
...@@ -239,8 +316,8 @@ paths: ...@@ -239,8 +316,8 @@ paths:
schema: schema:
type: string type: string
description: Policy version. description: Policy version.
example: Sunt in et quia cum. example: Optio quia et laborum.
example: Commodi nemo fugiat id praesentium accusantium expedita. example: In libero perspiciatis voluptatum ut soluta.
responses: responses:
"200": "200":
description: OK response. description: OK response.
......
...@@ -13,7 +13,7 @@ import ( ...@@ -13,7 +13,7 @@ import (
// EvaluatePolicyPath returns the URL path to the policy service Evaluate HTTP endpoint. // EvaluatePolicyPath returns the URL path to the policy service Evaluate HTTP endpoint.
func EvaluatePolicyPath(group string, policyName string, version string) string { func EvaluatePolicyPath(group string, policyName string, version string) string {
return fmt.Sprintf("/policy/%v/%v/%v/evaluation", group, policyName, version) return fmt.Sprintf("/policy/%v/%v/%v/evaluation/did.json", group, policyName, version)
} }
// EvaluatePolicyPath2 returns the URL path to the policy service Evaluate HTTP endpoint. // EvaluatePolicyPath2 returns the URL path to the policy service Evaluate HTTP endpoint.
...@@ -21,6 +21,11 @@ func EvaluatePolicyPath2(group string, policyName string, version string) string ...@@ -21,6 +21,11 @@ func EvaluatePolicyPath2(group string, policyName string, version string) string
return fmt.Sprintf("/policy/%v/%v/%v/evaluation", group, policyName, version) return fmt.Sprintf("/policy/%v/%v/%v/evaluation", group, policyName, version)
} }
// EvaluatePolicyPath3 returns the URL path to the policy service Evaluate HTTP endpoint.
func EvaluatePolicyPath3(group string, policyName string, version string) string {
return fmt.Sprintf("/policy/%v/%v/%v/evaluation", group, policyName, version)
}
// LockPolicyPath returns the URL path to the policy service Lock HTTP endpoint. // LockPolicyPath returns the URL path to the policy service Lock HTTP endpoint.
func LockPolicyPath(group string, policyName string, version string) string { func LockPolicyPath(group string, policyName string, version string) string {
return fmt.Sprintf("/policy/%v/%v/%v/lock", group, policyName, version) return fmt.Sprintf("/policy/%v/%v/%v/lock", group, policyName, version)
......
...@@ -13,7 +13,7 @@ import ( ...@@ -13,7 +13,7 @@ import (
// EvaluatePolicyPath returns the URL path to the policy service Evaluate HTTP endpoint. // EvaluatePolicyPath returns the URL path to the policy service Evaluate HTTP endpoint.
func EvaluatePolicyPath(group string, policyName string, version string) string { func EvaluatePolicyPath(group string, policyName string, version string) string {
return fmt.Sprintf("/policy/%v/%v/%v/evaluation", group, policyName, version) return fmt.Sprintf("/policy/%v/%v/%v/evaluation/did.json", group, policyName, version)
} }
// EvaluatePolicyPath2 returns the URL path to the policy service Evaluate HTTP endpoint. // EvaluatePolicyPath2 returns the URL path to the policy service Evaluate HTTP endpoint.
...@@ -21,6 +21,11 @@ func EvaluatePolicyPath2(group string, policyName string, version string) string ...@@ -21,6 +21,11 @@ func EvaluatePolicyPath2(group string, policyName string, version string) string
return fmt.Sprintf("/policy/%v/%v/%v/evaluation", group, policyName, version) return fmt.Sprintf("/policy/%v/%v/%v/evaluation", group, policyName, version)
} }
// EvaluatePolicyPath3 returns the URL path to the policy service Evaluate HTTP endpoint.
func EvaluatePolicyPath3(group string, policyName string, version string) string {
return fmt.Sprintf("/policy/%v/%v/%v/evaluation", group, policyName, version)
}
// LockPolicyPath returns the URL path to the policy service Lock HTTP endpoint. // LockPolicyPath returns the URL path to the policy service Lock HTTP endpoint.
func LockPolicyPath(group string, policyName string, version string) string { func LockPolicyPath(group string, policyName string, version string) string {
return fmt.Sprintf("/policy/%v/%v/%v/lock", group, policyName, version) return fmt.Sprintf("/policy/%v/%v/%v/lock", group, policyName, version)
......
...@@ -57,6 +57,7 @@ func New( ...@@ -57,6 +57,7 @@ func New(
) *Server { ) *Server {
return &Server{ return &Server{
Mounts: []*MountPoint{ Mounts: []*MountPoint{
{"Evaluate", "GET", "/policy/{group}/{policyName}/{version}/evaluation/did.json"},
{"Evaluate", "GET", "/policy/{group}/{policyName}/{version}/evaluation"}, {"Evaluate", "GET", "/policy/{group}/{policyName}/{version}/evaluation"},
{"Evaluate", "POST", "/policy/{group}/{policyName}/{version}/evaluation"}, {"Evaluate", "POST", "/policy/{group}/{policyName}/{version}/evaluation"},
{"Lock", "POST", "/policy/{group}/{policyName}/{version}/lock"}, {"Lock", "POST", "/policy/{group}/{policyName}/{version}/lock"},
...@@ -99,6 +100,7 @@ func MountEvaluateHandler(mux goahttp.Muxer, h http.Handler) { ...@@ -99,6 +100,7 @@ func MountEvaluateHandler(mux goahttp.Muxer, h http.Handler) {
h.ServeHTTP(w, r) h.ServeHTTP(w, r)
} }
} }
mux.Handle("GET", "/policy/{group}/{policyName}/{version}/evaluation/did.json", f)
mux.Handle("GET", "/policy/{group}/{policyName}/{version}/evaluation", f) mux.Handle("GET", "/policy/{group}/{policyName}/{version}/evaluation", f)
mux.Handle("POST", "/policy/{group}/{policyName}/{version}/evaluation", f) mux.Handle("POST", "/policy/{group}/{policyName}/{version}/evaluation", f)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment