From 32bbaa5e48e13be1475d748be6ef3e271d92b6e5 Mon Sep 17 00:00:00 2001 From: Nandan Sridhar Date: Fri, 19 Mar 2021 17:45:00 -0400 Subject: [PATCH] add perf benchmark policy --- perf-proxies/README.md | 28 + perf-proxies/proxy/apiproxy/hybrid_perf.xml | 69 ++ .../apiproxy/policies/AM-JwtAuthorization.xml | 26 + .../proxy/apiproxy/policies/AM-PrivateKey.xml | 39 ++ .../proxy/apiproxy/policies/AM-Response.xml | 14 + .../policies/AccessEntity_ApiProduct.xml | 5 + .../apiproxy/policies/AccessEntity_AppID.xml | 4 + .../policies/AccessEntity_AppName.xml | 4 + .../policies/AccessEntity_Developer.xml | 5 + .../apiproxy/policies/AssignSCResponse.xml | 12 + .../proxy/apiproxy/policies/EncodeURI.xml | 7 + .../apiproxy/policies/ExtractSCResponse.xml | 11 + .../proxy/apiproxy/policies/FlowCallout.xml | 7 + .../apiproxy/policies/GenerateAccessToken.xml | 18 + .../proxy/apiproxy/policies/GenerateJWT.xml | 18 + .../policies/GenerateRandomNumber.xml | 7 + .../proxy/apiproxy/policies/JSHeader.xml | 7 + .../proxy/apiproxy/policies/LimitByIP.xml | 8 + .../proxy/apiproxy/policies/LimitByQuota.xml | 13 + .../apiproxy/policies/LimitBySlowQuota.xml | 13 + .../proxy/apiproxy/policies/PYHeader.xml | 7 + .../proxy/apiproxy/policies/PYParse.xml | 7 + .../apiproxy/policies/RF-MissingParam.xml | 12 + .../proxy/apiproxy/policies/Raise-Fault.xml | 16 + .../proxy/apiproxy/policies/RejectURI.xml | 16 + .../apiproxy/policies/RemoveQueryParams.xml | 27 + .../proxy/apiproxy/policies/ResponseCache.xml | 13 + .../apiproxy/policies/ResponsePayload.xml | 14 + .../apiproxy/policies/SC-BuildRequest.xml | 13 + .../proxy/apiproxy/policies/ScJSON.xml | 8 + .../apiproxy/policies/ServiceCallout.xml | 11 + .../apiproxy/policies/SetCacheHeader.xml | 12 + .../SetPayload_AccessEntity_ApiProduct.xml | 6 + .../SetPayload_AccessEntity_AppID.xml | 6 + .../SetPayload_AccessEntity_AppName.xml | 6 + .../SetPayload_AccessEntity_Developer.xml | 6 + .../proxy/apiproxy/policies/ValidMessage.xml | 7 + .../proxy/apiproxy/policies/ValidateKey.xml | 7 + .../proxy/apiproxy/policies/ValidateOAuth.xml | 10 + .../proxy/apiproxy/policies/VerifyJWT.xml | 10 + .../proxy/apiproxy/policies/XMLThreat.xml | 25 + .../proxy/apiproxy/policies/XMLToJSON.xml | 7 + perf-proxies/proxy/apiproxy/policies/XSLT.xml | 7 + .../proxy/apiproxy/policies/add-cors.xml | 16 + .../proxy/apiproxy/policies/assign-header.xml | 12 + .../proxy/apiproxy/policies/getURL.xml | 8 + .../proxy/apiproxy/policies/putURL.xml | 11 + perf-proxies/proxy/apiproxy/proxies/proxy.xml | 596 ++++++++++++++++++ .../proxy/apiproxy/resources/js/jsheader.js | 2 + .../apiproxy/resources/jsc/RandomNumber.js | 4 + .../proxy/apiproxy/resources/py/encodeuri.py | 5 + .../proxy/apiproxy/resources/py/pyheader.py | 2 + .../proxy/apiproxy/resources/py/pyparse.py | 12 + .../proxy/apiproxy/resources/xsl/weatherxsl | 11 + .../proxy/apiproxy/targets/static.xml | 17 + .../hybridperf-sfassignmessage.xml | 14 + .../policies/AssignMessage.xml | 12 + .../sharedflowbundle/sharedflows/default.xml | 6 + 58 files changed, 1296 insertions(+) create mode 100644 perf-proxies/README.md create mode 100644 perf-proxies/proxy/apiproxy/hybrid_perf.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/AM-JwtAuthorization.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/AM-PrivateKey.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/AM-Response.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/AccessEntity_ApiProduct.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/AccessEntity_AppID.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/AccessEntity_AppName.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/AccessEntity_Developer.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/AssignSCResponse.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/EncodeURI.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/ExtractSCResponse.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/FlowCallout.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/GenerateAccessToken.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/GenerateJWT.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/GenerateRandomNumber.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/JSHeader.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/LimitByIP.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/LimitByQuota.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/LimitBySlowQuota.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/PYHeader.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/PYParse.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/RF-MissingParam.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/Raise-Fault.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/RejectURI.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/RemoveQueryParams.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/ResponseCache.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/ResponsePayload.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/SC-BuildRequest.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/ScJSON.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/ServiceCallout.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/SetCacheHeader.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/SetPayload_AccessEntity_ApiProduct.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/SetPayload_AccessEntity_AppID.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/SetPayload_AccessEntity_AppName.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/SetPayload_AccessEntity_Developer.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/ValidMessage.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/ValidateKey.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/ValidateOAuth.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/VerifyJWT.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/XMLThreat.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/XMLToJSON.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/XSLT.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/add-cors.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/assign-header.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/getURL.xml create mode 100644 perf-proxies/proxy/apiproxy/policies/putURL.xml create mode 100644 perf-proxies/proxy/apiproxy/proxies/proxy.xml create mode 100644 perf-proxies/proxy/apiproxy/resources/js/jsheader.js create mode 100644 perf-proxies/proxy/apiproxy/resources/jsc/RandomNumber.js create mode 100644 perf-proxies/proxy/apiproxy/resources/py/encodeuri.py create mode 100644 perf-proxies/proxy/apiproxy/resources/py/pyheader.py create mode 100644 perf-proxies/proxy/apiproxy/resources/py/pyparse.py create mode 100644 perf-proxies/proxy/apiproxy/resources/xsl/weatherxsl create mode 100644 perf-proxies/proxy/apiproxy/targets/static.xml create mode 100644 perf-proxies/sharedflows/hybridperf-sfassignmessage/sharedflowbundle/hybridperf-sfassignmessage.xml create mode 100644 perf-proxies/sharedflows/hybridperf-sfassignmessage/sharedflowbundle/policies/AssignMessage.xml create mode 100644 perf-proxies/sharedflows/hybridperf-sfassignmessage/sharedflowbundle/sharedflows/default.xml diff --git a/perf-proxies/README.md b/perf-proxies/README.md new file mode 100644 index 00000000..4285265e --- /dev/null +++ b/perf-proxies/README.md @@ -0,0 +1,28 @@ +# API proxy for Performance Benchmark + +This directory contains the API proxy and Sharedflow used to performance test +Apigee X and Apigee hybrid instances. + +## About this sample proxy + +This API proxy uses the following policies + +* Access Control +* Access Entity +* Validate OAuth +* Validate API Key +* JavaScript +* Assign Message +* Quota +* XMLThreat Protection +* GenerateAccessToken +* Python Callout +* XSLT +* XMLToJSON +* Raise-Fault +* FlowCallout +* ServiceCallout +* GenerateJWT +* VerifyJWT + +The API Proxy is available on the basePath `/hybridperf` diff --git a/perf-proxies/proxy/apiproxy/hybrid_perf.xml b/perf-proxies/proxy/apiproxy/hybrid_perf.xml new file mode 100644 index 00000000..17c3ad25 --- /dev/null +++ b/perf-proxies/proxy/apiproxy/hybrid_perf.xml @@ -0,0 +1,69 @@ + + hybrid_perf + Performance Test App + 1596042552317 + 1596042660545 + /hybridperf + + ValidMessage + LimitBySlowQuota + RejectURI + LimitByIP + SetPayload_AccessEntity_ApiProduct + ValidateOAuth + ValidateKey + getURL + AccessEntity_AppName + SetPayload_AccessEntity_AppID + SetPayload_AccessEntity_AppName + JSHeader + putURL + RemoveQueryParams + LimitByQuota + AccessEntity_Developer + SetCacheHeader + ResponseCache + XMLThreat + GenerateAccessToken + EncodeURI + PYHeader + GenerateRandomNumber + PYParse + AccessEntity_AppID + SetPayload_AccessEntity_Developer + XSLT + AccessEntity_ApiProduct + XMLToJSON + assign-header + Raise-Fault + FlowCallout + ServiceCallout + SC-BuildRequest + ExtractSCResponse + AssignSCResponse + ScJSON + GenerateJWT + VerifyJWT + RF-MissingParam + AM-PrivateKey + AM-Response + AM-JwtAuthorization + add-cors + ResponsePayload + + + proxy + + + py://pyparse.py + py://encodeuri.py + py://pyheader.py + jsc://RandomNumber.js + xsl://weatherxsl + js://jsheader.js + + + + static + + \ No newline at end of file diff --git a/perf-proxies/proxy/apiproxy/policies/AM-JwtAuthorization.xml b/perf-proxies/proxy/apiproxy/policies/AM-JwtAuthorization.xml new file mode 100644 index 00000000..6f13be5c --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/AM-JwtAuthorization.xml @@ -0,0 +1,26 @@ + + + AM-JwtAuthorization + + + +
Bearer {output-jwt}
+
+ + public.publickey + + + -----BEGIN PUBLIC KEY----- + MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwQNvdXmQMHaCj+cKOhaB + SVGMsgElLuAoU4yiHv/NFepQOKt5m3gcyK3t1sE2nMWebTQH1QLC9fANROeXVpJn + 05E57LffR3RFp7bFT8dI6OG7xlpypUcw1KEx6D2uTRQ29GStq2/nM+HNu6RtHJi4 + C+Z3dIUsW7nV0FjVZIsCxA1z/fPFVy8rGERaRR+tWHTm5U2jKXEw3ileUv7LGgWM + UMmxuqW2qyrkbVNC+gyI2AKmUV9bo/qLa0BrFxUrK2nRJlxmGnSA09s5CGKix2hP + GxBCvO4wHQ1Wt1PZzDO/fKlkxYiCdALLn8VwKS3JqgInnPUDl1tRi6fDEhL3lKFP + JwIDAQAB + -----END PUBLIC KEY----- + + + true + +
\ No newline at end of file diff --git a/perf-proxies/proxy/apiproxy/policies/AM-PrivateKey.xml b/perf-proxies/proxy/apiproxy/policies/AM-PrivateKey.xml new file mode 100644 index 00000000..ca26a0c4 --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/AM-PrivateKey.xml @@ -0,0 +1,39 @@ + + + AM-PrivateKey + + + private.privatekey + + +-----BEGIN PRIVATE KEY----- +MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDBA291eZAwdoKP +5wo6FoFJUYyyASUu4ChTjKIe/80V6lA4q3mbeBzIre3WwTacxZ5tNAfVAsL18A1E +55dWkmfTkTnst99HdEWntsVPx0jo4bvGWnKlRzDUoTHoPa5NFDb0ZK2rb+cz4c27 +pG0cmLgL5nd0hSxbudXQWNVkiwLEDXP988VXLysYRFpFH61YdOblTaMpcTDeKV5S +/ssaBYxQybG6pbarKuRtU0L6DIjYAqZRX1uj+otrQGsXFSsradEmXGYadIDT2zkI +YqLHaE8bEEK87jAdDVa3U9nMM798qWTFiIJ0AsufxXApLcmqAiec9QOXW1GLp8MS +EveUoU8nAgMBAAECggEAPOhhnteaqcBsGQ8WihgZ+lISrQVxf2ZbM2pYqqGcTUMg +x5FNEcOIicdhG3jjS/uMr/dQVWbGsSdseIcAmeAfhYL5nXq0qe7GIFOr1i4UEvFQ ++RoHvaJGhYLMpfX47/fmE59Fsqjgc93Yt1L+35xNz+uNXKa9xcBR+apexJidadIs +pcXTrmyANwjaKKM6t/HIHK7tiOnX/HSrYinSsDTsLQkxkToQrWxFv8U6DS3sQQGU +Yjc0gqpgbj0JnlC6ekMYCTk3Loit9MmqkdYidPHCKi3z1sH0+Yo5xQwGbF+CumZk +m2RDDGGC3/F44kM8QnHT8XJ9O8w16BgHqMVBcUnLGQKBgQDkPLKcupPoS1j9/Hqd +XFJGmGB+pUBaRRD9+Uz/dR3uN9rfhDY47I+9rjOo0pqiI3ATYFYFGbf4OfrF97+m +TT1vkg7WxnnfzU7z9MP3aAylINjABpRTqVEWsgRfHy/sT7wSO0l+dZTwSUwM0taq +OuWKdM9hfKZiOGrTWW4u9Vir7QKBgQDYfd9WiG1g1iP6NxMqNns7GbQctR5L581T +00xnqZ0IRLYLuvoOtAkSBkAsF3oaT+/z4VVO8PdJpOTYyTM4gUP7uZinwQK7Ge/2 +QaWSsFLABjj4lYaWiDgkjKje+Vd3GvCHQ0T21wV6XwxV4pZe2mUvLsbLAwJBNIpE +nZXXFgDM4wKBgDHiYleHIBTBgy3gJRyHtSPg4hZMIAia19/qwT2EZ4pNgvUffIps +ie43SOs5PLr7a9+QSrzKpj8GzRy/zY+Xijn8fmnK75BO21bOxJYqk7jzuOwfhAPV +GfgP6Iyx0FOiCcUiWCnfoTHzkz+qRWjnfowIg9sW13bYReDzxvVUgpDxAoGAX0nX ++dCGxC69Gy8Oom/kgbjojBI0SZi3yYOhh6ciVTdZIYSk97/KlkJmEIIs3lP8+81c +rShmz+ViTQESKHbNI4knZf8QYqYh9rQiWpR9d8PFY7T8zlkazQuUcMAy/VvALuku ++67c3GXlmg/nu8xI6SGfok+quGSVz2nFQCyRIZ0CgYBLt/uYBJokcuC5uNsy84uZ +WqEjrJem/JjPsmlJFOxSfMWPPeXFwno8o4qoFpPyxUN9rPPTC4wIusWDvfXX1eHB +yc4C9HX8qjg2nn1oVLO7CVEIxmrwUNcoS+wiyYJIhygViege6lshS5DjpQc4UQh+ +SXJJ2CgUNZdFEN8y0L3JXA== +-----END PRIVATE KEY----- + + + \ No newline at end of file diff --git a/perf-proxies/proxy/apiproxy/policies/AM-Response.xml b/perf-proxies/proxy/apiproxy/policies/AM-Response.xml new file mode 100644 index 00000000..67260ec0 --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/AM-Response.xml @@ -0,0 +1,14 @@ + + + AM-Response + + + true + + { + "status" : "ok", + "jwt" : "{output-jwt}" +} + 200 + + \ No newline at end of file diff --git a/perf-proxies/proxy/apiproxy/policies/AccessEntity_ApiProduct.xml b/perf-proxies/proxy/apiproxy/policies/AccessEntity_ApiProduct.xml new file mode 100644 index 00000000..6a653cf5 --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/AccessEntity_ApiProduct.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/perf-proxies/proxy/apiproxy/policies/AccessEntity_AppID.xml b/perf-proxies/proxy/apiproxy/policies/AccessEntity_AppID.xml new file mode 100644 index 00000000..29608b90 --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/AccessEntity_AppID.xml @@ -0,0 +1,4 @@ + + + + diff --git a/perf-proxies/proxy/apiproxy/policies/AccessEntity_AppName.xml b/perf-proxies/proxy/apiproxy/policies/AccessEntity_AppName.xml new file mode 100644 index 00000000..756a1c33 --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/AccessEntity_AppName.xml @@ -0,0 +1,4 @@ + + + + diff --git a/perf-proxies/proxy/apiproxy/policies/AccessEntity_Developer.xml b/perf-proxies/proxy/apiproxy/policies/AccessEntity_Developer.xml new file mode 100644 index 00000000..80c88d84 --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/AccessEntity_Developer.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/perf-proxies/proxy/apiproxy/policies/AssignSCResponse.xml b/perf-proxies/proxy/apiproxy/policies/AssignSCResponse.xml new file mode 100644 index 00000000..6c53dc20 --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/AssignSCResponse.xml @@ -0,0 +1,12 @@ + + + AssignSCResponse + + + + @scjsonres# + + + true + + \ No newline at end of file diff --git a/perf-proxies/proxy/apiproxy/policies/EncodeURI.xml b/perf-proxies/proxy/apiproxy/policies/EncodeURI.xml new file mode 100644 index 00000000..3c8b9250 --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/EncodeURI.xml @@ -0,0 +1,7 @@ + + diff --git a/perf-proxies/proxy/apiproxy/policies/ExtractSCResponse.xml b/perf-proxies/proxy/apiproxy/policies/ExtractSCResponse.xml new file mode 100644 index 00000000..1f55693d --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/ExtractSCResponse.xml @@ -0,0 +1,11 @@ + + + ExtractSCResponse + + SCResponse + + + $. + + + \ No newline at end of file diff --git a/perf-proxies/proxy/apiproxy/policies/FlowCallout.xml b/perf-proxies/proxy/apiproxy/policies/FlowCallout.xml new file mode 100644 index 00000000..334fbdc2 --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/FlowCallout.xml @@ -0,0 +1,7 @@ + + + FlowCallout + + + hybridperf-sfassignmessage + diff --git a/perf-proxies/proxy/apiproxy/policies/GenerateAccessToken.xml b/perf-proxies/proxy/apiproxy/policies/GenerateAccessToken.xml new file mode 100644 index 00000000..884a475e --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/GenerateAccessToken.xml @@ -0,0 +1,18 @@ + + + GenerateAccessToken + + + + 86400000 + false + request.queryparam.grant_type + GenerateAccessToken + + FORM_PARAM + + + client_credentials + + + diff --git a/perf-proxies/proxy/apiproxy/policies/GenerateJWT.xml b/perf-proxies/proxy/apiproxy/policies/GenerateJWT.xml new file mode 100644 index 00000000..a627461b --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/GenerateJWT.xml @@ -0,0 +1,18 @@ + + + GenerateJWT + RS256 + + + optional-unique-identifier-for-privatekey-here + + + + + + urn://apigee-edge-JWT-policy-demonstration + urn://Apigee + + 60m + output-jwt + \ No newline at end of file diff --git a/perf-proxies/proxy/apiproxy/policies/GenerateRandomNumber.xml b/perf-proxies/proxy/apiproxy/policies/GenerateRandomNumber.xml new file mode 100644 index 00000000..e205d7a1 --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/GenerateRandomNumber.xml @@ -0,0 +1,7 @@ + + + GenerateRandomNumber + + + jsc://RandomNumber.js + diff --git a/perf-proxies/proxy/apiproxy/policies/JSHeader.xml b/perf-proxies/proxy/apiproxy/policies/JSHeader.xml new file mode 100644 index 00000000..a7704f41 --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/JSHeader.xml @@ -0,0 +1,7 @@ + + diff --git a/perf-proxies/proxy/apiproxy/policies/LimitByIP.xml b/perf-proxies/proxy/apiproxy/policies/LimitByIP.xml new file mode 100644 index 00000000..ff73a3ff --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/LimitByIP.xml @@ -0,0 +1,8 @@ + + + LimitByIP + + + + 50000ps + diff --git a/perf-proxies/proxy/apiproxy/policies/LimitByQuota.xml b/perf-proxies/proxy/apiproxy/policies/LimitByQuota.xml new file mode 100644 index 00000000..fa5bfc2d --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/LimitByQuota.xml @@ -0,0 +1,13 @@ + + + LimitByQuota + + + + + 1 + true + false + false + minute + diff --git a/perf-proxies/proxy/apiproxy/policies/LimitBySlowQuota.xml b/perf-proxies/proxy/apiproxy/policies/LimitBySlowQuota.xml new file mode 100644 index 00000000..5f0710dc --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/LimitBySlowQuota.xml @@ -0,0 +1,13 @@ + + + LimitBySlowQuota + + + + + 1 + true + false + true + minute + diff --git a/perf-proxies/proxy/apiproxy/policies/PYHeader.xml b/perf-proxies/proxy/apiproxy/policies/PYHeader.xml new file mode 100644 index 00000000..50d2309c --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/PYHeader.xml @@ -0,0 +1,7 @@ + + diff --git a/perf-proxies/proxy/apiproxy/policies/PYParse.xml b/perf-proxies/proxy/apiproxy/policies/PYParse.xml new file mode 100644 index 00000000..28a444ad --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/PYParse.xml @@ -0,0 +1,7 @@ + + diff --git a/perf-proxies/proxy/apiproxy/policies/RF-MissingParam.xml b/perf-proxies/proxy/apiproxy/policies/RF-MissingParam.xml new file mode 100644 index 00000000..bacf0aa9 --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/RF-MissingParam.xml @@ -0,0 +1,12 @@ + + + + + + Missing form Parameter + 400 + Bad Request + + + true + \ No newline at end of file diff --git a/perf-proxies/proxy/apiproxy/policies/Raise-Fault.xml b/perf-proxies/proxy/apiproxy/policies/Raise-Fault.xml new file mode 100644 index 00000000..f78bb36c --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/Raise-Fault.xml @@ -0,0 +1,16 @@ + + + Raise-Fault + + + + + + Good job Google + + 200 + Ok + + + true + \ No newline at end of file diff --git a/perf-proxies/proxy/apiproxy/policies/RejectURI.xml b/perf-proxies/proxy/apiproxy/policies/RejectURI.xml new file mode 100644 index 00000000..088da339 --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/RejectURI.xml @@ -0,0 +1,16 @@ + + + RejectURI + + + + + + Invalid performance test request + + 403 + Bad Request + + + false + diff --git a/perf-proxies/proxy/apiproxy/policies/RemoveQueryParams.xml b/perf-proxies/proxy/apiproxy/policies/RemoveQueryParams.xml new file mode 100644 index 00000000..1ca6040b --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/RemoveQueryParams.xml @@ -0,0 +1,27 @@ + + + RemoveQueryParams + + + + + + + + + + + + + + GET + + + + name + + + + true + + diff --git a/perf-proxies/proxy/apiproxy/policies/ResponseCache.xml b/perf-proxies/proxy/apiproxy/policies/ResponseCache.xml new file mode 100644 index 00000000..fb5553f4 --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/ResponseCache.xml @@ -0,0 +1,13 @@ + + + ResponseCache + + + + + + Exclusive + + 60 + + diff --git a/perf-proxies/proxy/apiproxy/policies/ResponsePayload.xml b/perf-proxies/proxy/apiproxy/policies/ResponsePayload.xml new file mode 100644 index 00000000..818a32a2 --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/ResponsePayload.xml @@ -0,0 +1,14 @@ + + + ResponsePayload + + +
{request.header.user-agent}
+
+ Hello world + + 200 +
+ true + +
\ No newline at end of file diff --git a/perf-proxies/proxy/apiproxy/policies/SC-BuildRequest.xml b/perf-proxies/proxy/apiproxy/policies/SC-BuildRequest.xml new file mode 100644 index 00000000..bb754e2b --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/SC-BuildRequest.xml @@ -0,0 +1,13 @@ + + + SC-BuildRequest + screquest + false + + /perf/weather-5k.xml + + + target.copy.pathsuffix + false + + \ No newline at end of file diff --git a/perf-proxies/proxy/apiproxy/policies/ScJSON.xml b/perf-proxies/proxy/apiproxy/policies/ScJSON.xml new file mode 100644 index 00000000..8a7df6de --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/ScJSON.xml @@ -0,0 +1,8 @@ + + + ScJSON + + yahoo + SCResponse + SCResponse + \ No newline at end of file diff --git a/perf-proxies/proxy/apiproxy/policies/ServiceCallout.xml b/perf-proxies/proxy/apiproxy/policies/ServiceCallout.xml new file mode 100644 index 00000000..a95795ee --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/ServiceCallout.xml @@ -0,0 +1,11 @@ + + + ServiceCallout + + + SCResponse + + + http://104.197.43.2 + + \ No newline at end of file diff --git a/perf-proxies/proxy/apiproxy/policies/SetCacheHeader.xml b/perf-proxies/proxy/apiproxy/policies/SetCacheHeader.xml new file mode 100644 index 00000000..3d1e9e12 --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/SetCacheHeader.xml @@ -0,0 +1,12 @@ + + + SetCacheHeader + + + + +
{responsecache.ResponseCache.cachehit}
+
+
+ false +
\ No newline at end of file diff --git a/perf-proxies/proxy/apiproxy/policies/SetPayload_AccessEntity_ApiProduct.xml b/perf-proxies/proxy/apiproxy/policies/SetPayload_AccessEntity_ApiProduct.xml new file mode 100644 index 00000000..9dc0392c --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/SetPayload_AccessEntity_ApiProduct.xml @@ -0,0 +1,6 @@ + + Set Payload + + %AccessEntity.AccessEntity_ApiProduct# + + diff --git a/perf-proxies/proxy/apiproxy/policies/SetPayload_AccessEntity_AppID.xml b/perf-proxies/proxy/apiproxy/policies/SetPayload_AccessEntity_AppID.xml new file mode 100644 index 00000000..3938f399 --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/SetPayload_AccessEntity_AppID.xml @@ -0,0 +1,6 @@ + + Set Payload + + %AccessEntity.AccessEntity_AppID# + + diff --git a/perf-proxies/proxy/apiproxy/policies/SetPayload_AccessEntity_AppName.xml b/perf-proxies/proxy/apiproxy/policies/SetPayload_AccessEntity_AppName.xml new file mode 100644 index 00000000..14db196d --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/SetPayload_AccessEntity_AppName.xml @@ -0,0 +1,6 @@ + + Set Payload + + %AccessEntity.AccessEntity_AppName# + + diff --git a/perf-proxies/proxy/apiproxy/policies/SetPayload_AccessEntity_Developer.xml b/perf-proxies/proxy/apiproxy/policies/SetPayload_AccessEntity_Developer.xml new file mode 100644 index 00000000..1b87a139 --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/SetPayload_AccessEntity_Developer.xml @@ -0,0 +1,6 @@ + + Set Payload + + %AccessEntity.AccessEntity_Developer# + + diff --git a/perf-proxies/proxy/apiproxy/policies/ValidMessage.xml b/perf-proxies/proxy/apiproxy/policies/ValidMessage.xml new file mode 100644 index 00000000..d3e8f44c --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/ValidMessage.xml @@ -0,0 +1,7 @@ + + + ValidMessage + + + message + diff --git a/perf-proxies/proxy/apiproxy/policies/ValidateKey.xml b/perf-proxies/proxy/apiproxy/policies/ValidateKey.xml new file mode 100644 index 00000000..4edc5453 --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/ValidateKey.xml @@ -0,0 +1,7 @@ + + + ValidateKey + + + + diff --git a/perf-proxies/proxy/apiproxy/policies/ValidateOAuth.xml b/perf-proxies/proxy/apiproxy/policies/ValidateOAuth.xml new file mode 100644 index 00000000..597b9640 --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/ValidateOAuth.xml @@ -0,0 +1,10 @@ + + + ValidateOAuth + + + + false + VerifyAccessToken + + diff --git a/perf-proxies/proxy/apiproxy/policies/VerifyJWT.xml b/perf-proxies/proxy/apiproxy/policies/VerifyJWT.xml new file mode 100644 index 00000000..a23945df --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/VerifyJWT.xml @@ -0,0 +1,10 @@ + + + VerifyJWT + RS256 + output-jwt + + + + urn://Apigee + \ No newline at end of file diff --git a/perf-proxies/proxy/apiproxy/policies/XMLThreat.xml b/perf-proxies/proxy/apiproxy/policies/XMLThreat.xml new file mode 100644 index 00000000..150b622f --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/XMLThreat.xml @@ -0,0 +1,25 @@ + + + XMLThreat + + + + 100 + 100 + -1 + 10000 + + request + + 50 + 10 + 25 + + + 10000 + 100 + -1 + 100000 + 100000 + + diff --git a/perf-proxies/proxy/apiproxy/policies/XMLToJSON.xml b/perf-proxies/proxy/apiproxy/policies/XMLToJSON.xml new file mode 100644 index 00000000..d1365fdd --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/XMLToJSON.xml @@ -0,0 +1,7 @@ + + + XMLToJSON + + + yahoo + diff --git a/perf-proxies/proxy/apiproxy/policies/XSLT.xml b/perf-proxies/proxy/apiproxy/policies/XSLT.xml new file mode 100644 index 00000000..cf7d2c64 --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/XSLT.xml @@ -0,0 +1,7 @@ + + + XSLT + + + xsl://weatherxsl + diff --git a/perf-proxies/proxy/apiproxy/policies/add-cors.xml b/perf-proxies/proxy/apiproxy/policies/add-cors.xml new file mode 100644 index 00000000..f60556d0 --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/add-cors.xml @@ -0,0 +1,16 @@ + + + Add-CORS + + + + +
*
+
origin, x-requested-with, accept
+
3628800
+
GET, PUT, POST, DELETE
+
+
+ true + +
\ No newline at end of file diff --git a/perf-proxies/proxy/apiproxy/policies/assign-header.xml b/perf-proxies/proxy/apiproxy/policies/assign-header.xml new file mode 100644 index 00000000..11fb0abc --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/assign-header.xml @@ -0,0 +1,12 @@ + + + assign-header + + + +
Test
+
+
+ true + +
\ No newline at end of file diff --git a/perf-proxies/proxy/apiproxy/policies/getURL.xml b/perf-proxies/proxy/apiproxy/policies/getURL.xml new file mode 100644 index 00000000..278170e9 --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/getURL.xml @@ -0,0 +1,8 @@ + + apiproxy + + + + + + \ No newline at end of file diff --git a/perf-proxies/proxy/apiproxy/policies/putURL.xml b/perf-proxies/proxy/apiproxy/policies/putURL.xml new file mode 100644 index 00000000..0f7f005f --- /dev/null +++ b/perf-proxies/proxy/apiproxy/policies/putURL.xml @@ -0,0 +1,11 @@ + + + apiproxy + + + + + + + + \ No newline at end of file diff --git a/perf-proxies/proxy/apiproxy/proxies/proxy.xml b/perf-proxies/proxy/apiproxy/proxies/proxy.xml new file mode 100644 index 00000000..6e6c9a6a --- /dev/null +++ b/perf-proxies/proxy/apiproxy/proxies/proxy.xml @@ -0,0 +1,596 @@ + + + + + + + + + + GenerateAccessToken + + + + proxy.pathsuffix MatchesPath "/accesstoken" + + + + + request.queryparam.test = "passthrough" + + + + + + + assign-header + + + request.queryparam.test = "assignmessage" + + + + + + + XMLToJSON + + + request.queryparam.test = "xmltojson" + + + + + + + XSLT + + + request.queryparam.test = "xslt" + + + + + + + PYParse + + + request.queryparam.test = "pyparse" + + + + + + + JSHeader + + + request.queryparam.test = "jsheader" + + + + + + + PYHeader + + + request.queryparam.test = "pyheader" + + + + + + + XMLThreat + + + request.queryparam.test = "xmlthreat" + + + + + + + ValidMessage + + + request.queryparam.test = "validmsg" + + + + + + + LimitByIP + + + request.queryparam.test = "spikearrest" + + + + + + + ValidateKey + + + request.queryparam.test = "validkey" + + + + + + + ValidateOAuth + + + request.queryparam.test = "oauth" + + + + + + LimitByQuota + + + + request.queryparam.test = "distributed-quota" + + + + + + LimitBySlowQuota + + + + request.queryparam.test = "synchronous-distributed-quota" + + + + + + ResponseCache + + + + + + ResponseCache + + + + SetCacheHeader + + + request.queryparam.test = "cache" + + + + + + AccessEntity_ApiProduct + + + request.queryparam.overrideresponse = "true" + SetPayload_AccessEntity_ApiProduct + + + request.queryparam.test = "accessentity_apiproduct" + + + + + + AccessEntity_Developer + + + request.queryparam.overrideresponse = "true" + SetPayload_AccessEntity_Developer + + + request.queryparam.test = "accessentity_developer" + + + + + + AccessEntity_AppName + + + request.queryparam._overrideresponse = "true" + SetPayload_AccessEntity_AppName + + + request.queryparam.test = "accessentity_appname" + + + + + + AccessEntity_AppID + + + request.queryparam.overrideresponse = "true" + SetPayload_AccessEntity_AppID + + + request.queryparam.test = "accessentity_appid" + + + + + + LimitByIP + + + + ValidateKey + + + + + + PYHeader + + + request.queryparam.test = "standard-low" + + + + + + LimitByIP + + + + + + PYHeader + + + request.queryparam.test = "standard-low-no-oauth" + + + + + + LimitByIP + + + + EncodeURI + + + + ValidateOAuth + + + + + + PYHeader + + + + XMLToJSON + + + + ValidMessage + + + request.queryparam.test = "standard-medium" + + + + + + LimitByIP + + + + EncodeURI + + + + + + PYHeader + + + + XMLToJSON + + + + ValidMessage + + + request.queryparam.test = "standard-medium-no-oauth" + + + + + + LimitByIP + + + + EncodeURI + + + + ValidateOAuth + + + + + + PYHeader + + + + XSLT + + + + XMLToJSON + + + + ValidMessage + + + + XMLThreat + + + request.queryparam.test = "standard-high" + + + + + + LimitByIP + + + + EncodeURI + + + + + + PYHeader + + + + XSLT + + + + XMLToJSON + + + + ValidMessage + + + + XMLThreat + + + request.queryparam.test = "standard-high-no-oauth" + + + + + + getURL + + + + request.queryparam.test = "get-kvm" + + + + + + putURL + + + + request.queryparam.test = "put-kvm" + + + + + + putURL + + + getURL + + + + request.queryparam.test = "get-put-kvm" + + + + + + + LimitByIP + + + + LimitByQuota + + + + EncodeURI + + + + ValidateKey + + + + ValidateOAuth + + + putURL + + + getURL + + + + + + PYHeader + + + + XSLT + + + + XMLToJSON + + + + ValidMessage + + + + XMLThreat + + + request.queryparam.test = "super-high" + + + raisefault + + + + Raise-Fault + + + + request.queryparam.test = "raisefault" + + + nulltarget + + + + + add-cors + + + ResponsePayload + + + request.queryparam.test = "nulltarget" + + + flowcallout + + + + FlowCallout + + + + request.queryparam.test = "flowcallout" + + + + + + + SC-BuildRequest + + + + ServiceCallout + + + + + ScJSON + + + ExtractSCResponse + + + AssignSCResponse + + + request.queryparam.test = "sc" + + + + + + request.queryparam.subject = null + RF-MissingParam + + + AM-PrivateKey + + + GenerateJWT + + + AM-JwtAuthorization + + + VerifyJWT + + + + + AM-Response + + + request.queryparam.test = "gvjwt" + + + + + + RejectURI + + + + + + + + + + + + + + + /v1/perf + + default + secure + + true + + + + request.queryparam.test = "kvm1" OR request.queryparam.test = "kvm2" OR request.queryparam.test = "kvm3" OR request.queryparam.test = "sc" OR request.queryparam.test = "gvjwt" OR request.queryparam.test = "nulltarget" + + + static + + \ No newline at end of file diff --git a/perf-proxies/proxy/apiproxy/resources/js/jsheader.js b/perf-proxies/proxy/apiproxy/resources/js/jsheader.js new file mode 100644 index 00000000..e40ace81 --- /dev/null +++ b/perf-proxies/proxy/apiproxy/resources/js/jsheader.js @@ -0,0 +1,2 @@ +message.setHeader("X-Test-Name", "Processed by Apigee") + diff --git a/perf-proxies/proxy/apiproxy/resources/jsc/RandomNumber.js b/perf-proxies/proxy/apiproxy/resources/jsc/RandomNumber.js new file mode 100644 index 00000000..b7b95da9 --- /dev/null +++ b/perf-proxies/proxy/apiproxy/resources/jsc/RandomNumber.js @@ -0,0 +1,4 @@ +var randomnumber = Math.floor(Math.random()*10000000) +//var randomnumber = context.getVariable("request.queryparam.provider") +context.setVariable("urlencoding.requesturl.hashed",randomnumber) +context.setVariable("urlencoding.longurl.encoded", "http://tiny.url." + randomnumber) \ No newline at end of file diff --git a/perf-proxies/proxy/apiproxy/resources/py/encodeuri.py b/perf-proxies/proxy/apiproxy/resources/py/encodeuri.py new file mode 100644 index 00000000..511d4908 --- /dev/null +++ b/perf-proxies/proxy/apiproxy/resources/py/encodeuri.py @@ -0,0 +1,5 @@ +import base64 + +uri = request.getVariable('uri') +encoded = base64.encodestring(uri) +request.setVariable('EncodedURI', encoded) diff --git a/perf-proxies/proxy/apiproxy/resources/py/pyheader.py b/perf-proxies/proxy/apiproxy/resources/py/pyheader.py new file mode 100644 index 00000000..e40ace81 --- /dev/null +++ b/perf-proxies/proxy/apiproxy/resources/py/pyheader.py @@ -0,0 +1,2 @@ +message.setHeader("X-Test-Name", "Processed by Apigee") + diff --git a/perf-proxies/proxy/apiproxy/resources/py/pyparse.py b/perf-proxies/proxy/apiproxy/resources/py/pyparse.py new file mode 100644 index 00000000..4f8bfb06 --- /dev/null +++ b/perf-proxies/proxy/apiproxy/resources/py/pyparse.py @@ -0,0 +1,12 @@ +import json + +msg=request.getvariable('message') + +obj = json.loads(msg) +obj['Apigized'] = True + +out = json.dumps(obj) + +request.setvariable('message', out) + + diff --git a/perf-proxies/proxy/apiproxy/resources/xsl/weatherxsl b/perf-proxies/proxy/apiproxy/resources/xsl/weatherxsl new file mode 100644 index 00000000..e882a0ac --- /dev/null +++ b/perf-proxies/proxy/apiproxy/resources/xsl/weatherxsl @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/perf-proxies/proxy/apiproxy/targets/static.xml b/perf-proxies/proxy/apiproxy/targets/static.xml new file mode 100644 index 00000000..07e4251a --- /dev/null +++ b/perf-proxies/proxy/apiproxy/targets/static.xml @@ -0,0 +1,17 @@ + + + + + + + + + + 5000 + + http://104.197.43.2 + + + true + + \ No newline at end of file diff --git a/perf-proxies/sharedflows/hybridperf-sfassignmessage/sharedflowbundle/hybridperf-sfassignmessage.xml b/perf-proxies/sharedflows/hybridperf-sfassignmessage/sharedflowbundle/hybridperf-sfassignmessage.xml new file mode 100644 index 00000000..a9807253 --- /dev/null +++ b/perf-proxies/sharedflows/hybridperf-sfassignmessage/sharedflowbundle/hybridperf-sfassignmessage.xml @@ -0,0 +1,14 @@ + + hybridperf-sfassignmessage + hybridperf-sfassignmessage + 1595354743584 + 1595354931425 + + AssignMessage + + + + default + + SharedFlow + diff --git a/perf-proxies/sharedflows/hybridperf-sfassignmessage/sharedflowbundle/policies/AssignMessage.xml b/perf-proxies/sharedflows/hybridperf-sfassignmessage/sharedflowbundle/policies/AssignMessage.xml new file mode 100644 index 00000000..d6abeac1 --- /dev/null +++ b/perf-proxies/sharedflows/hybridperf-sfassignmessage/sharedflowbundle/policies/AssignMessage.xml @@ -0,0 +1,12 @@ + + + AssignMessage + + + +
perf-sharedflow
+
+
+ true + +
\ No newline at end of file diff --git a/perf-proxies/sharedflows/hybridperf-sfassignmessage/sharedflowbundle/sharedflows/default.xml b/perf-proxies/sharedflows/hybridperf-sfassignmessage/sharedflowbundle/sharedflows/default.xml new file mode 100644 index 00000000..d45086a3 --- /dev/null +++ b/perf-proxies/sharedflows/hybridperf-sfassignmessage/sharedflowbundle/sharedflows/default.xml @@ -0,0 +1,6 @@ + + + + AssignMessage + + \ No newline at end of file