-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
policy: make schemas conform with the new manifest
- Loading branch information
Showing
6 changed files
with
151 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,44 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "CORS policy configuration", | ||
"$schema": "http://apicast.io/policy-v1/schema#manifest#", | ||
"name": "CORS policy", | ||
"description": "This policy enables CORS (Cross Origin Resource Sharing) request handling.", | ||
"type": "object", | ||
"properties": { | ||
"allow_headers": { | ||
"description": "Allowed headers", | ||
"type": "array", | ||
"items": { | ||
"version": "0.1", | ||
"configuration": { | ||
"type": "object", | ||
"properties": { | ||
"allow_headers": { | ||
"description": "Allowed headers", | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"allow_methods": { | ||
"description": "Allowed methods", | ||
"type": "array", | ||
"items": { | ||
"type": "string", | ||
"enum": [ | ||
"GET", | ||
"HEAD", | ||
"POST", | ||
"PUT", | ||
"DELETE", | ||
"PATCH", | ||
"OPTIONS", | ||
"TRACE", | ||
"CONNECT" | ||
] | ||
} | ||
}, | ||
"allow_origin": { | ||
"description": "Origins for which the response can be shared with", | ||
"type": "string" | ||
}, | ||
"allow_credentials": { | ||
"description": "Whether the request can be made using credentials", | ||
"type": "boolean" | ||
} | ||
}, | ||
"allow_methods": { | ||
"description": "Allowed methods", | ||
"type": "array", | ||
"items": { | ||
"type": "string", | ||
"enum": [ | ||
"GET", | ||
"HEAD", | ||
"POST", | ||
"PUT", | ||
"DELETE", | ||
"PATCH", | ||
"OPTIONS", | ||
"TRACE", | ||
"CONNECT" | ||
] | ||
} | ||
}, | ||
"allow_origin": { | ||
"description": "Origins for which the response can be shared with", | ||
"type": "string" | ||
}, | ||
"allow_credentials": { | ||
"description": "Whether the request can be made using credentials", | ||
"type": "boolean" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "Echo policy configuration", | ||
"$schema": "http://apicast.io/policy-v1/schema#manifest#", | ||
"name": "Echo policy", | ||
"description": | ||
["This policy prints the request back to the client and optionally sets ", | ||
"a status code."], | ||
"type": "object", | ||
"properties": { | ||
"status": { | ||
"description": "HTTP status code to be returned", | ||
"type": "integer" | ||
}, | ||
"exit": { | ||
"description": "Exit mode. 'request' interrupts the processing of the request, 'phase' only skips the rewrite phase.", | ||
"type": "string", | ||
"enum": ["request", "phase"] | ||
"version": "0.1", | ||
"configuration": { | ||
"type": "object", | ||
"properties": { | ||
"status": { | ||
"description": "HTTP status code to be returned", | ||
"type": "integer" | ||
}, | ||
"exit": { | ||
"description": "Exit mode. 'request' interrupts the processing of the request, 'phase' only skips the rewrite phase.", | ||
"type": "string", | ||
"enum": ["request", "phase"] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,42 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "Headers policy configuration", | ||
"$schema": "http://apicast.io/policy-v1/schema#manifest#", | ||
"name": "Headers policy", | ||
"description": | ||
["This policy allows to include custom headers that will be sent to the ", | ||
"upstream as well as modify or delete the ones included in the original ", | ||
"request. Similarly, this policy also allows to add, modify, and delete ", | ||
"the headers included in the response."], | ||
"type": "object", | ||
"definitions": { | ||
"commands": { | ||
"description": "List of operations to apply to the headers", | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"op": { | ||
"description": "Operation to be applied", | ||
"type": "string", | ||
"enum": ["add", "set", "push"] | ||
"version": "0.1", | ||
"configuration": { | ||
"type": "object", | ||
"definitions": { | ||
"commands": { | ||
"description": "List of operations to apply to the headers", | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"op": { | ||
"description": "Operation to be applied", | ||
"type": "string", | ||
"enum": ["add", "set", "push"] | ||
}, | ||
"header": { | ||
"description": "Header to be modified", | ||
"type": "string" | ||
}, | ||
"value": { | ||
"description": "Value that will be added, set or pushed in the header", | ||
"type": "string" | ||
} | ||
}, | ||
"header": { | ||
"description": "Header to be modified", | ||
"type": "string" | ||
}, | ||
"value": { | ||
"description": "Value that will be added, set or pushed in the header", | ||
"type": "string" | ||
} | ||
}, | ||
"required": ["op", "header", "value"] | ||
"required": ["op", "header", "value"] | ||
} | ||
} | ||
}, | ||
"properties": { | ||
"request": { "$ref": "#/definitions/commands" }, | ||
"response": { "$ref": "#/definitions/commands" } | ||
} | ||
}, | ||
"properties": { | ||
"request": { "$ref": "#/definitions/commands" }, | ||
"response": { "$ref": "#/definitions/commands" } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 35 additions & 32 deletions
67
gateway/src/apicast/policy/url_rewriting/apicast-policy.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters