diff --git a/design/design.go b/design/design.go index 61c3c44bd84ef660711cc450524e9eb0b002a66d..16a698890a20ddf0466f2f8c1175e5ddcdcd6d0e 100644 --- a/design/design.go +++ b/design/design.go @@ -23,6 +23,7 @@ var _ = Service("policy", func() { Payload(EvaluateRequest) Result(EvaluateResult) HTTP(func() { + GET("/policy/{group}/{policyName}/{version}/evaluation/did.json") GET("/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() { diff --git a/gen/http/openapi.json b/gen/http/openapi.json index 1ece3bde5aced10eebfd3cc80be169559f9219dd..f5208fb3310f5356b476c007a8dc07dd8b62a932 100644 --- a/gen/http/openapi.json +++ b/gen/http/openapi.json @@ -1 +1 @@ -{"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"]}}}} \ No newline at end of file +{"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 diff --git a/gen/http/openapi.yaml b/gen/http/openapi.yaml index 6bdfe1e0bcd63693b3d374b5299529d5da628647..e0da20157f4606ffd10dbf63fc830758ca351d09 100644 --- a/gen/http/openapi.yaml +++ b/gen/http/openapi.yaml @@ -30,7 +30,7 @@ paths: - policy summary: Evaluate policy description: Evaluate executes a policy with the given 'data' as input. - operationId: policy#Evaluate + operationId: policy#Evaluate#1 parameters: - name: group in: path @@ -77,7 +77,55 @@ paths: - policy summary: Evaluate policy 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: - name: group in: path diff --git a/gen/http/openapi3.json b/gen/http/openapi3.json index 87a090f190b3ffbe4dbf6f512778849e5b146884..07c9d6d21f9932ee2e338b0ad21573b7ca9b258f 100644 --- a/gen/http/openapi3.json +++ b/gen/http/openapi3.json @@ -1 +1 @@ -{"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."}]} \ No newline at end of file +{"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 diff --git a/gen/http/openapi3.yaml b/gen/http/openapi3.yaml index 19b3d6f6ac832251d7eabf7eb4fa10ed05b00c6e..69f0699b893a720db432454e00e94636d6939a70 100644 --- a/gen/http/openapi3.yaml +++ b/gen/http/openapi3.yaml @@ -22,7 +22,7 @@ paths: - policy summary: Evaluate policy description: Evaluate executes a policy with the given 'data' as input. - operationId: policy#Evaluate + operationId: policy#Evaluate#1 parameters: - name: group in: path @@ -70,7 +70,7 @@ paths: description: Input data passed to the policy execution runtime. example: Quis quos qui earum velit illum. format: binary - example: Aut facere veniam repudiandae id. + example: Dolorem cumque laborum quis nesciunt. responses: "200": description: OK response. @@ -83,8 +83,8 @@ paths: 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. + example: Aut voluptas. + example: Sint nam voluptatem ea consequatur similique et. content: application/json: schema: @@ -92,13 +92,13 @@ paths: description: Arbitrary JSON response. example: Aliquam atque voluptatum ut dolorem. format: binary - example: Ab accusantium ut ut aliquid sint animi. + 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#1 + operationId: policy#Evaluate#2 parameters: - name: group in: path @@ -146,7 +146,7 @@ paths: description: Input data passed to the policy execution runtime. example: Quis quos qui earum velit illum. format: binary - example: Dolorem cumque laborum quis nesciunt. + example: Ut commodi perspiciatis corporis. responses: "200": description: OK response. @@ -159,8 +159,8 @@ paths: 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. + example: Accusamus autem sequi. + example: Et nulla. content: application/json: schema: @@ -168,7 +168,84 @@ paths: description: Arbitrary JSON response. example: Aliquam atque voluptatum ut dolorem. 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: delete: tags: @@ -184,8 +261,8 @@ paths: schema: type: string description: Policy group. - example: Qui non quia. - example: Error maxime quasi quia non voluptatibus error. + example: Ut amet. + example: Accusamus enim. - name: policyName in: path description: Policy name. @@ -193,8 +270,8 @@ paths: schema: type: string description: Policy name. - example: Optio quia et laborum. - example: In libero perspiciatis voluptatum ut soluta. + example: Recusandae est rerum corrupti quia. + example: Quam dolores architecto itaque. - name: version in: path description: Policy version. @@ -202,8 +279,8 @@ paths: schema: type: string description: Policy version. - example: Ut amet. - example: Accusamus enim. + example: Voluptas ad corporis adipisci inventore ipsum. + example: Recusandae dolorum nisi distinctio vitae ad. responses: "200": description: OK response. @@ -221,8 +298,8 @@ paths: schema: type: string description: Policy group. - example: Ut commodi perspiciatis corporis. - example: Accusamus autem sequi. + example: Sunt in et quia cum. + example: Commodi nemo fugiat id praesentium accusantium expedita. - name: policyName in: path description: Policy name. @@ -230,8 +307,8 @@ paths: schema: type: string description: Policy name. - example: Et nulla. - example: In quis nesciunt autem et. + example: Qui non quia. + example: Error maxime quasi quia non voluptatibus error. - name: version in: path description: Policy version. @@ -239,8 +316,8 @@ paths: schema: type: string description: Policy version. - example: Sunt in et quia cum. - example: Commodi nemo fugiat id praesentium accusantium expedita. + example: Optio quia et laborum. + example: In libero perspiciatis voluptatum ut soluta. responses: "200": description: OK response. diff --git a/gen/http/policy/client/paths.go b/gen/http/policy/client/paths.go index 93034da05768a8ef6b23ac765245e41bf46973c5..71d011233374c6163e4a8deefbab3b39dd1bb9e5 100644 --- a/gen/http/policy/client/paths.go +++ b/gen/http/policy/client/paths.go @@ -13,7 +13,7 @@ import ( // EvaluatePolicyPath returns the URL path to the policy service Evaluate HTTP endpoint. 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. @@ -21,6 +21,11 @@ func EvaluatePolicyPath2(group string, policyName string, version string) string 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. func LockPolicyPath(group string, policyName string, version string) string { return fmt.Sprintf("/policy/%v/%v/%v/lock", group, policyName, version) diff --git a/gen/http/policy/server/paths.go b/gen/http/policy/server/paths.go index 9d3e84aeda6baad9ceeabf0b929c5c1d1f5556ca..2ca862aeaf8ba61310030b1c5ab8518323cf064b 100644 --- a/gen/http/policy/server/paths.go +++ b/gen/http/policy/server/paths.go @@ -13,7 +13,7 @@ import ( // EvaluatePolicyPath returns the URL path to the policy service Evaluate HTTP endpoint. 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. @@ -21,6 +21,11 @@ func EvaluatePolicyPath2(group string, policyName string, version string) string 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. func LockPolicyPath(group string, policyName string, version string) string { return fmt.Sprintf("/policy/%v/%v/%v/lock", group, policyName, version) diff --git a/gen/http/policy/server/server.go b/gen/http/policy/server/server.go index a9bb7fb2182a67452be4748675371a7ec81a0149..303e6c97b6088df6430cea84d135f4c312545bf6 100644 --- a/gen/http/policy/server/server.go +++ b/gen/http/policy/server/server.go @@ -57,6 +57,7 @@ func New( ) *Server { return &Server{ Mounts: []*MountPoint{ + {"Evaluate", "GET", "/policy/{group}/{policyName}/{version}/evaluation/did.json"}, {"Evaluate", "GET", "/policy/{group}/{policyName}/{version}/evaluation"}, {"Evaluate", "POST", "/policy/{group}/{policyName}/{version}/evaluation"}, {"Lock", "POST", "/policy/{group}/{policyName}/{version}/lock"}, @@ -99,6 +100,7 @@ func MountEvaluateHandler(mux goahttp.Muxer, h http.Handler) { 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("POST", "/policy/{group}/{policyName}/{version}/evaluation", f) }