Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/policy_tutorial/POLICY_IMPLEMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ And while we are changing the schema, we might as well provide a neat summary an
The new configuration schema looks like this:
```json
{
"$schema": "http://apicast.io/policy-v1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1/schema",
"name": "hello_world",
"summary": "Parameter converter and secret checker",
"description": [
Expand Down
2 changes: 1 addition & 1 deletion doc/policy_tutorial/POLICY_SCAFFOLD.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ The source code of the policy in the directory src/gateway/apicast/policy/hello_
* aplicast-policy.json: The APIcast gateway is configured using a JSON document. Policies requiring configuration also use this JSON document. The apicast-policy.json file is a JSON schema file where configuration properties for the policy can be defined. The next section looks into configuration properties and this file in more detail.
```json
{
"$schema": "http://apicast.io/policy-v1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1/schema",
"name": "hello_world",
"summary": "TODO: write policy summary",
"description": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1/schema",
"name": "hello_world",
"summary": "Parameter converter and secret checker",
"description": [
Expand Down
2 changes: 1 addition & 1 deletion examples/policies/ngx-example/1.0.0/apicast-policy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1/schema",
"name": "Ngx example policy",
"summary": "Sets request headers",
"description":
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1/schema",
"name": "{{ policy.name }}",
"summary": "{{ policy.summary }}",
"description": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "3scale Batcher",
"summary": "Caches auths from 3scale backend and batches reports.",
"description":
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "3scale Referrer",
"summary": "Sends the 'Referer' to 3scale backend so it can be validated.",
"description": "Sends the 'Referer' to 3scale backend for validation.",
Expand Down
2 changes: 1 addition & 1 deletion gateway/src/apicast/policy/apicast/apicast-policy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "3scale APIcast",
"summary": "Main functionality of APIcast to work with the 3scale API manager.",
"description":
Expand Down
2 changes: 1 addition & 1 deletion gateway/src/apicast/policy/caching/apicast-policy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "3scale Auth Caching",
"summary": "Controls how to cache authorizations returned by the 3scale backend.",
"description":
Expand Down
2 changes: 1 addition & 1 deletion gateway/src/apicast/policy/camel/apicast-policy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1/schema",
"name": "Camel Service",
"summary": "Adds an Camel proxy to the service.",
"description": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1/schema",
"name": "Content caching",
"summary": "Option to enable content caching on responses.",
"description": [
Expand Down
2 changes: 1 addition & 1 deletion gateway/src/apicast/policy/cors/apicast-policy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "CORS Request Handling",
"summary": "Enables CORS (Cross Origin Resource Sharing) request handling.",
"description":
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "Custom Metrics",
"summary": "Custom metrics on Nginx post actions ",
"description": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "Anonymous Access",
"summary": "Provides default credentials for unauthenticated requests.",
"description":
Expand Down
2 changes: 1 addition & 1 deletion gateway/src/apicast/policy/echo/apicast-policy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "Echo",
"summary": "Prints the request back to the client and optionally sets a status code.",
"description":
Expand Down
2 changes: 1 addition & 1 deletion gateway/src/apicast/policy/fapi/apicast-policy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1/schema",
"name": "The Financial-grade API (FAPI)",
"summary": "Support FAPI profiles",
"description": ["This policy adding support for Financial-grade API (API) profiles"
Expand Down
2 changes: 1 addition & 1 deletion gateway/src/apicast/policy/grpc/apicast-policy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "HTTP2 Endpoint",
"summary": "Main functionality to enable HTTP2 endpoint reply.",
"description":
Expand Down
2 changes: 1 addition & 1 deletion gateway/src/apicast/policy/headers/apicast-policy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "Header Modification",
"summary": "Allows to include custom headers.",
"description":
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1/schema",
"name": "Proxy Service",
"summary": "Adds an HTTP proxy to the service.",
"description": [
Expand Down
2 changes: 1 addition & 1 deletion gateway/src/apicast/policy/ip_check/apicast-policy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "IP Check",
"summary": "Accepts or denies a request based on the IP.",
"description": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "JWT Claim Check",
"summary": "Allow or deny traffic based on a JWT claim",
"description": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1/schema",
"name": "JWT Parser",
"summary": "Parse JWT",
"description": ["This policy parse JWT token from Authorization header"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "RH-SSO/Keycloak Role Check",
"summary": "Adds role check with Keycloak.",
"description": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "Liquid Context Debug",
"summary": "Inspects the available liquid context.",
"description": [
Expand Down
2 changes: 1 addition & 1 deletion gateway/src/apicast/policy/logging/apicast-policy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "Logging",
"summary": "Controls logging.",
"description": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "Maintenance Mode",
"summary": "Rejects incoming requests. Useful for maintenance periods.",
"description": [
Expand Down
4 changes: 2 additions & 2 deletions gateway/src/apicast/policy/manifest-schema.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"$id": "http://apicast.io/policy-v1.1/schema#manifest",
"$id": "http://apicast.io/policy-v1.1/schema",
"type": "object",
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"schema": {
"$id": "#/definitions/schema",
"$ref": "http://json-schema.org/draft-07/schema#",
"$schema": "http://json-schema.org/draft-07/schema#",
"default": {}
},
"version": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "Nginx Filter",
"summary": "Skip nginx filters on certain headers",
"description": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1/schema",
"name": "OAuth 2.0 Mutual TLS Client Authentication",
"summary": "Configure OAuth 2.0 Mutual TLS Client Authentication.",
"description": ["This policy executes OAuth 2.0 Mutual TLS Client Authentication ",
Expand Down
2 changes: 1 addition & 1 deletion gateway/src/apicast/policy/on_failed/apicast-policy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "On fail",
"summary": "Block request if any policy fails",
"description": "When a policy fails, this policy allows to set an error message back to the user and stop processing the request to the upstream API.",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "Response/Request content limits",
"summary": "Limit request or response base on the size of the content",
"description": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "Edge Limiting",
"summary": "Adds rate limit.",
"description": ["This policy adds rate limit."],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "Rate Limits Headers",
"summary": "Set rate limit headers on response",
"description":
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1/schema",
"name": "Request Unbuffered",
"summary": "Disable request buffering",
"description": [
Expand Down
2 changes: 1 addition & 1 deletion gateway/src/apicast/policy/retry/apicast-policy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "Retry",
"summary": "Allows to retry requests to the upstream",
"description": "Allows to retry requests to the upstream",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "URL Rewriting with Captures",
"summary": "Captures arguments in a URL and rewrites the URL using them.",
"description":
Expand Down
2 changes: 1 addition & 1 deletion gateway/src/apicast/policy/routing/apicast-policy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "Routing",
"summary": "Allows to modify the upstream URL of the request.",
"description": [
Expand Down
2 changes: 1 addition & 1 deletion gateway/src/apicast/policy/soap/apicast-policy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "SOAP",
"summary": "Adds support for a small subset of SOAP.",
"description":
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "HTTP Status Code Overwrite",
"summary": "Modify the HTTP status code returned by the upstream",
"description": [
Expand Down
2 changes: 1 addition & 1 deletion gateway/src/apicast/policy/tls/apicast-policy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1/schema",
"name": "TLS Termination",
"summary": "Configure TLS termination certificates",
"description": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "TLS Client Certificate Validation",
"summary": "Validate certificates provided by the client during TLS handshake (HTTPS).",
"description": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/poolicy-v1/schema#manifest#",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes me think that APIcast never cares about the schema

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to #522 and #565 the manifest and schema is mostly used for the UI. And from #646, we only run validation with busted test. So as long as the test passes, I'm happy.

@mayorova with porta changing to json_schemer, do we still validate each policy schema against the manifest?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tkan145 I am not very familiar with the code, but from here it seems to me that APIcast only validates the configuration of the policy definition, not the complete JSON.

As for porta, it's strange, because I think the validation only applies to the policies definitions that are created manually via API. And yes, the whole policy definition is validated against the manifest.
For the policies fetched from APIcast, I don't think we run any validations, just render them in the UI.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mayorova yes you are right, I think they used to validate the schema against the manifest manually with this docker image https://github.com/3scale-archive/docker-ajv

"$schema": "http://apicast.io/policy-v1/schema",
"name": "OAuth 2.0 Token Introspection",
"summary": "Configures OAuth 2.0 Token Introspection.",
"description": ["This policy executes OAuth 2.0 Token Introspection ",
Expand Down
2 changes: 1 addition & 1 deletion gateway/src/apicast/policy/upstream/apicast-policy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "Upstream",
"summary": "Allows to modify the upstream URL of the request based on its path.",
"description":
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "Upstream Connection",
"summary": "Allows to configure several options for the connections to the upstream",
"description": "Allows to configure several options for the connections to the upstream",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "Upstream Mutual TLS",
"summary": "Certificates to be used with the upstream API",
"description": "With this policy a new TLS connection with the upstream API will be used with the certificates set in the config",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "URL Rewriting",
"summary": "Allows to modify the path of a request.",
"description":
Expand Down
2 changes: 1 addition & 1 deletion gateway/src/apicast/policy/websocket/apicast-policy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1.1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1.1/schema",
"name": "Websocket",
"summary": "Allows websocket connection pass through.",
"description": [
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/policies/test/1.0.0-0/apicast-policy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1/schema",
"name": "Example policy",
"summary": "An example policy to be used in unit tests.",
"version": "1.0.0-0",
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/policies/test/2.0.0-0/apicast-policy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1/schema",
"name": "Example policy",
"summary": "An example policy to be used in unit tests.",
"version": "2.0.0-0",
Expand Down
2 changes: 1 addition & 1 deletion t/fixtures/policies/deny/1.0.0/apicast-policy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1/schema",
"name": "Deny policy",
"summary": "A policy that denies requests. To be used in integration tests.",
"version": "1.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1/schema",
"name": "Example policy",
"summary": "An example policy to be used in integration tests. It just raises an error",
"version": "1.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1/schema",
"name": "Example policy",
"summary": "An example policy to be used in integration tests.",
"version": "1.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1/schema",
"name": "Example policy 1",
"summary": "Just an example.",
"version": "1.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "http://apicast.io/policy-v1/schema#manifest#",
"$schema": "http://apicast.io/policy-v1/schema",
"name": "Example policy 2",
"summary": "Just an example with a version mismatch.",
"version": "2.0.0",
Expand Down
Loading