-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
100 changed files
with
22,509 additions
and
11 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
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,95 @@ | ||
{ | ||
"description": "Backend object test", | ||
"target": "https://www.krakend.io/schema/v2.9/backend.json", | ||
"tests": [ | ||
{ | ||
"description": "Empty host", | ||
"data": { | ||
"host": [""], | ||
"url_pattern": "/__debug/root" | ||
}, | ||
"valid": false | ||
}, | ||
{ | ||
"description": "Simple backend declaration with no host", | ||
"data": { | ||
"url_pattern": "/__debug/root" | ||
}, | ||
"valid": true | ||
}, | ||
{ | ||
"description": "Simple backend declaration with host", | ||
"data": { | ||
"url_pattern": "/__debug/root", | ||
"host": [ | ||
"amqp://blah" | ||
] | ||
}, | ||
"valid": true | ||
}, | ||
{ | ||
"description": "Simple backend declaration with empty string host", | ||
"data": { | ||
"url_pattern": "/__debug/root", | ||
"host": [ | ||
"" | ||
] | ||
}, | ||
"valid": false | ||
}, | ||
{ | ||
"description": "Simple backend declaration with no pattern", | ||
"data": { | ||
"host": [ | ||
"http://foo" | ||
] | ||
}, | ||
"valid": false | ||
}, | ||
{ | ||
"description": "Backend declaration with a few components", | ||
"data": { | ||
"host": [ | ||
"http://127.0.0.1:8080" | ||
], | ||
"input_headers": [ | ||
"Accept" | ||
], | ||
"url_pattern": "/__debug/", | ||
"extra_config": { | ||
"auth/ntlm": { | ||
"user": "user", | ||
"password": "pass" | ||
}, | ||
"auth/gcp": { | ||
"audience": "https://gcptest-76fewi6rca-uc.a.run.app", | ||
"credentials_file": "/etc/krakend/gcp.json", | ||
"custom_claims": { | ||
"a": 1 | ||
} | ||
}, | ||
"backend/http": { | ||
"return_error_code": true, | ||
"@extra_comment": "here" | ||
}, | ||
"backend/soap": { | ||
"path": "./path/to.xml", | ||
"content_type": "application/xml", | ||
"debug": false | ||
}, | ||
"modifier/body-generator": { | ||
"content_type": "application/json", | ||
"debug": false, | ||
"template": "abcdef" | ||
}, | ||
"modifier/response-body-generator": { | ||
"content_type": "application/json", | ||
"debug": false, | ||
"template": "abcdef" | ||
} | ||
} | ||
}, | ||
"valid": true | ||
} | ||
] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"description": "Postman test", | ||
"target": "https://www.krakend.io/schema/v2.9/documentation/postman.json", | ||
"tests": [ | ||
{ | ||
"description": "Valid Postman collection at the service level", | ||
"data": { | ||
"name": "Postman doc", | ||
"description": "This is a **sample** server. You can find out more about at [http://blah](http://blah.blah.com) webpage", | ||
"version": "0.3.0", | ||
"folder": [ | ||
{ | ||
"name": "/Users", | ||
"description": "User endpoints. **in markdown**" | ||
}, | ||
{ | ||
"name": "/Users/Assets", | ||
"description": "User assets endpoints. **in markdown**" | ||
}, | ||
{ | ||
"name": "/Books", | ||
"description": "Books endpoints. **in markdown**" | ||
} | ||
] | ||
}, | ||
"valid": true | ||
}, | ||
{ | ||
"description": "Semantic versioning test valid", | ||
"data": { "version": "0.3.0" }, | ||
"valid": true | ||
}, | ||
{ | ||
"description": "Semantic versioning test invalid", | ||
"data": { "version": "v0.3.0" }, | ||
"valid": false | ||
} | ||
] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"description": "Postman test", | ||
"target": "https://www.krakend.io/schema/v2.9/documentation/postman_endpoint.json", | ||
"tests": [ | ||
{ | ||
"description": "Valid Postman collection at the endpoint level", | ||
"data": { | ||
|
||
"name": "List users", | ||
"folder": "/Users", | ||
"description": "Some description" | ||
|
||
}, | ||
"valid": true | ||
}, | ||
{ | ||
"description": "Empty namespace is valid", | ||
"data": { }, | ||
"valid": true | ||
} | ||
] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
"description": "E2E test", | ||
"target": "https://www.krakend.io/schema/v2.9/e2e.json", | ||
"tests": [ | ||
{ | ||
"description": "Full test-case", | ||
"data": { | ||
"@comment": "Makes sure that the debug endpoint returns a status ok", | ||
"in": { | ||
"method": "GET", | ||
"url": "http://localhost:8080/__debug/something", | ||
"header": { | ||
"User-Agent": "krakend e2e tool" | ||
} | ||
}, | ||
"out": { | ||
"status_code": 200, | ||
"body": "http://localhost:8080/__debug/something", | ||
"header": { | ||
"content-type": [ | ||
"application/json; charset=utf-8" | ||
], | ||
"Cache-Control": [ | ||
"" | ||
], | ||
"X-Krakend-Completed": [ | ||
"true" | ||
] | ||
}, | ||
"schema": { | ||
"title": "A JSON schema", | ||
"description": "some description", | ||
"type": "object", | ||
"properties": { | ||
"abc": { | ||
"type": "array" | ||
} | ||
} | ||
} | ||
}, | ||
"next": [ | ||
{ | ||
"in": { | ||
"method": "GET", | ||
"url": "http://localhost:8080/test/rate-limit-stateless", | ||
"header": { | ||
"User-Agent": "krakend e2e tool" | ||
} | ||
}, | ||
"out": { | ||
"status_code": 503 | ||
} | ||
} | ||
] | ||
}, | ||
"valid": true | ||
} | ||
] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"description": "Flexible config test", | ||
"target": "https://www.krakend.io/schema/v2.9/flexible_config.json", | ||
"tests": [ | ||
{ | ||
"description": "Full test-case", | ||
"data": { | ||
"@comment": "Makes sure that the debug endpoint returns a status ok", | ||
"settings": { | ||
"paths": [ | ||
"settings" | ||
], | ||
"allow_overwrite": true, | ||
"dir_field_prefix": "", | ||
"allowed_suffixes": [ | ||
".yaml", | ||
".json" | ||
] | ||
}, | ||
"partials": { | ||
"paths": [ | ||
"partials" | ||
] | ||
}, | ||
"templates": { | ||
"paths": [ | ||
"templates" | ||
] | ||
}, | ||
"meta_key": "meta", | ||
"out": "result.json", | ||
"debug": true | ||
}, | ||
"valid": true, | ||
"keys_naming_rules": "strict" | ||
} | ||
] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"description": "JMESPath", | ||
"target": "https://www.krakend.io/schema/v2.9/modifier/jmespath.json", | ||
"tests": [ | ||
{ | ||
"description": "the empty object is invalid", | ||
"data": {}, | ||
"valid": false | ||
}, | ||
{ | ||
"description": "example expression", | ||
"data": { | ||
"expr": "students[?age > `18` ].name" | ||
}, | ||
"valid": true | ||
} | ||
] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ | ||
"description": "martian", | ||
"target": "https://www.krakend.io/schema/v2.9/modifier/martian.json", | ||
"tests": [ | ||
{ | ||
"description": "two modifiers without group are not possible", | ||
"data": { | ||
"header.Blacklist": { | ||
"scope": [ | ||
"response" | ||
], | ||
"names": [ | ||
"Vary", | ||
"Etag", | ||
"Last-Modified", | ||
"Expires" | ||
] | ||
}, | ||
"header.Modifier": { | ||
"scope": [ | ||
"response" | ||
], | ||
"name": "Cache-Control", | ||
"value": "max-age=600, public", | ||
"@comment": "We will change the max-age policy before KrakenD checks the content for caching. Now content is cached 600 seconds." | ||
} | ||
}, | ||
"valid": false | ||
}, | ||
{ | ||
"description": "two modifiers in a group are possible", | ||
"data": { | ||
"fifo.Group": { | ||
"scope": [ | ||
"response" | ||
], | ||
"aggregateErrors": true, | ||
"modifiers": [ | ||
{ | ||
"header.Blacklist": { | ||
"scope": [ | ||
"response" | ||
], | ||
"names": [ | ||
"Vary", | ||
"Etag", | ||
"Last-Modified", | ||
"Expires" | ||
] | ||
} | ||
}, | ||
{ | ||
"header.Modifier": { | ||
"scope": [ | ||
"response" | ||
], | ||
"name": "Cache-Control", | ||
"value": "max-age=600, public", | ||
"@comment": "We will change the max-age policy before KrakenD checks the content for caching. Now content is cached 600 seconds." | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"valid": true | ||
} | ||
] | ||
} |
Oops, something went wrong.