Skip to content

Commit

Permalink
cache product list in gcp legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
srinandan committed Apr 27, 2020
1 parent 694c745 commit 5153544
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 17 deletions.
33 changes: 21 additions & 12 deletions proxies/remote-proxy-legacy/apiproxy/manifests/manifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,49 @@
<VersionInfo resourceName="AuthenticationError" version="SHA-512:9baea620ec25c18e7f2e1beee969265d403d5d32e3389c794486aec8a11f8330d81d4df9a2184a0b61462950107ec611cbcd391fcd6e917cb985b0d7b2e6e156"/>
<VersionInfo resourceName="Create-OAuth-Request" version="SHA-512:44970fe5002a5322c44b6071edd941f99dbabf80b07390ce370adb8c1a6af4b193a94133efb7bf1f9ee9de7876ca8890a7a50872dccba4bf5cabbaef407eb50a"/>
<VersionInfo resourceName="Create-Refresh-Request" version="SHA-512:967bac384fb321121a5e90e6a430f71d6f4f5121701fe6d63e1251ea222c7946f887fc81402c90735b4b7c8a8dde8a1f0be8ba174c9b363ef9734204ab7a87bc"/>
<VersionInfo resourceName="DistributedQuota" version="SHA-512:3b2869ded83130ab7d79e08b4a9beeacc0973c2b39350e0ced0c968f5eae500a9495b2b69bb273ae12ca2ba31bee0c4ed2a31cd3e042791c6bc16b7687e042ef"/>
<VersionInfo resourceName="Eval-Quota-Result" version="SHA-512:7dad7db6f2b0a2d7de562572fd0fe8531c80ba9526027cb8ac97efb5bfa6fbdc5ba396c448cfc2b7735da1d6c09b590f471eb08725a2f018a526d3ca739a5811"/>
<VersionInfo resourceName="Extract-API-Key" version="SHA-512:b366e09cc60ac1a1bad7bcbeb2429adec08287c59f7667921471081b2520990ee0f0cb1a45482a40cfb9ecfa7b7da90b8c145fee730e7c4e01cb06f86e3f78ce"/>
<VersionInfo resourceName="Extract-OAuth-Params" version="SHA-512:1526aae995d23500e0b0b44bdaaeef3042dcfec1f1c2c35db331b3164c1b8be8d6c45fe70bad6822bb22988667d5300f9828825ae519befbfa81fade6bdb16a5"/>
<VersionInfo resourceName="Extract-Refresh-Params" version="SHA-512:aab8ed226b7f2f8b0fea061faeb247eed5d9d1e6479870fd7119f5107a7bf2a24da90fa6223ccd0c412afb8fc9315d92c5b1edb6725555b6c5605d59aaa54ada"/>
<VersionInfo resourceName="Extract-Revoke-Params" version="SHA-512:78776e8e83c78763bc1c8ee345d4a91c477ae20e82ee7c2600ed7070885999b256565aba3f4d73cea56dc79f43ec4397cca67f442b3e2636cebd8921f9dfb63f"/>
<VersionInfo resourceName="Extract-Rotate-Variables" version="SHA-512:3856c3e8649d38cce5e96ad34a75360dac57811286b95c0c7f62b1ddbea15a412bd815acc49a6acd7f94b47fb5fc1ba30de7c7a8d6ab8fa3387dce93e8523e35"/>
<VersionInfo resourceName="Generate-Access-Token" version="SHA-512:7f74ec920735c263f1186ad6fd1393a240293d2fe7457ae980931cc458ede63ab8b79f6b156d98b9f95795dcc7be5c40165934f0ee19bfcb277bdfed14dccb6f"/>
<VersionInfo resourceName="Generate-JWK" version="SHA-512:d47d43441a96d9f7d81e65f81cd1e84202a2b6240b489825ad7ffa16002bf29bd45102c79888e007134757116ed4c713e95d463f521971560eca45f006179cd7"/>
<VersionInfo resourceName="Generate-VerifyKey-Token" version="SHA-512:f203d0db07a40693e48df1fc16f2e35ba5ed585f00d53779d30e371f02aa658c29750915aa6c9dab83ef2d235b577dcf6f270cf79e1efe660c2fa6dc1b675aa3"/>
<VersionInfo resourceName="Get-Private-Key" version="SHA-512:755a52b155b5a8e24d3bcae4b72a84365cd95e25641041a2d6bd843cd73ca90688a63bc61870b097d89f51d131f2e927fcf47d5fdbcd10e456aad74150adfc9f"/>
<VersionInfo resourceName="Get-Public-Keys" version="SHA-512:386f8eda5646bcdb8745985bf640ee2770da84ce1dee7ce41fe63a681df3c98b952f011ba5d843131871dd6ab58f8ed8c331dcbe5934ac30cda4c9edec833b23"/>
<VersionInfo resourceName="JavaCallout" version="SHA-512:0a669efa60b566093197f59e84f93e987d90c9317daf0acf1f0aa5ebb59b60e41753290cf6ce66046bd2c8d7905f9855f0fafff5fd29cc8f242273ec6be8433b"/>
<VersionInfo resourceName="Generate-Access-Token" version="SHA-512:b62e68ba606aa9172918b6b99e8af712c8fb9d3dcff7e486192454cf6cb55cf57b0b38293df164bd41aaed08ca350f52c84933dfe27c210d91be50a47e5000fb"/>
<VersionInfo resourceName="Generate-JWK" version="SHA-512:d7b6dbc4183c111a8819abfe04eae424a42033b6c9b77f7c5fc29ac559133eaac6bf4c53f2272e6ad24a41b9a901f7ed3c0b880828738e659d6b894f676f2158"/>
<VersionInfo resourceName="Generate-VerifyKey-Token" version="SHA-512:1f5ae6c20ac4b83458afd1ed2dae4194b97ed214afb8342c94c50906c96111dddd99c502e30809d88fb33d9ddc70b74c577bf9c7044b88f6831098b0652bc540"/>
<VersionInfo resourceName="Get-Private-Key" version="SHA-512:e0682a07e4e8a6194d35476ade167aae73c9723e3cc316ea9bc321fe5fd748b0f3976a2e5465c5b4b10f794eb854d0b64261a9ea75c959bda41331c00c1c3dcf"/>
<VersionInfo resourceName="Get-Public-Keys" version="SHA-512:fa832c936a3e48b57b16087adf5b3fb15e5a55af4f2d6cd168e0ac11c7e1b6788587063c574529f6ae1a4ee913ce2deec5fbcedaa48fe9b52081c315b0b621d5"/>
<VersionInfo resourceName="JavaCallout" version="SHA-512:725163f5e9cfa73f7639e73b9239462259c449d41ddc9e65e8b3ab8e20adc4015f43552738a2d09194585863970b4476ca51b6a60ebf01c9ebeb50343c164952"/>
<VersionInfo resourceName="Lookup-Products" version="SHA-512:1caf5b1dea585dbf18d9f3fa7a7eec622491a32f4200909a6ddc42f92b81e3bce693d629227bc995e60f9b24f33115575b18de0086aa41089452293b86ca2202"/>
<VersionInfo resourceName="Populate-Product-List" version="SHA-512:5ed3a04f327eaf701c57164c66b1fe78a483ba8d4c279d3dfaab2fc4889337ea388c0b5ed63f2bc1db99e60d7721cb7b174b703a7261bebc1df609d924174448"/>
<VersionInfo resourceName="Products-to-JSON" version="SHA-512:0cd590deb81af11d8d82eed90daf8af73d0be2cd872389a2e7bfac5bd06a46d3da70b614b6228c682c2388ad84d8e813d5ed8705077b6fb7a39ccdc8df1a5ec0"/>
<VersionInfo resourceName="Products-to-JSON-2" version="SHA-512:4b941d272686cef70c9ede9b34a782c9a816132d2074ac8508112abb8b9f4044bdf07e81550fa19684866972521fc2b609d43b93c58326940ac533b5a588a93e"/>
<VersionInfo resourceName="Raise-Fault-Unknown-Request" version="SHA-512:2fb24dbc00c6fbcced7fd3a31144fc459ac1d1ba200e2d25ea30ea96d707a629e5f1c3520a85f6301316eab07d5b96bf5e8594dcc45d80aa14cf548715301144"/>
<VersionInfo resourceName="RefreshAccessToken" version="SHA-512:a910089ac2230b344cf9a9992f2dfc8e4f4b9da2a9154b4ef7ada1b4789e5c2cbea59bdd3390b0fc9e04f109227f10b133e30355e75ac3bb044d464eba922ef4"/>
<VersionInfo resourceName="Retrieve-Cert" version="SHA-512:07fa8906d951a54bf94bdd823c9d15ded6e982d6e8519abb547c4a42bf467c4790273bffb6af2d192c98cddac97ac4b9e95920b6b17ded3fb887190d771ceb15"/>
<VersionInfo resourceName="Retrieve-Cert" version="SHA-512:c6834740d27065f4842b6c0e9995610e329d07a53626e0e5e0a0a234cedb037f96e5ff7e6e83e593fac35c7be214eed1923431f1149c5cf28759f2c8aa1f02c7"/>
<VersionInfo resourceName="RevokeRefreshToken" version="SHA-512:55675f8e017f8afb7430e87bccffabe3ea3f908f3cdc3d3f9deeaadabd237470d61c523fb750296b822a61ed25a789880f00fe386d51b4d9e857adb18a3d96d5"/>
<VersionInfo resourceName="Send-JWK-Message" version="SHA-512:e8c164598f3258ae9ecd7eb4af8e1b1aa8d53a1a967d19c5f2f4a16420ae5eb811e4d02780b24e8c3b8abbd9211914c8a81acf96fb8f4efb4875fa459a1e91f4"/>
<VersionInfo resourceName="Send-Version" version="SHA-512:5c232afab498377e8202ec0dd85050cbdafb084f53cae4c80beb3584f7f04cbd365fc72ce564cf56698af594a494cbd98cd23f28257462de89befe9f12ae9f1d"/>
<VersionInfo resourceName="Send-JWK-Message" version="SHA-512:0e77f8261e5bc2531b72868b2b7909e28fd65e6c3e8d5133adad403ec1f3a2e5d888078e564b2d0f02b807312356f8728e8a0815c392fb46ddf88cd06af562f8"/>
<VersionInfo resourceName="Send-Product-List" version="SHA-512:06cd4a1229178a293fac36ef3abc01dfe5364c8dbe739dd4f7012a842e29febd9fd286b8df6dd87f4004d4eacf157e3335cabcb6107c29bb0199e53ebb4f03e3"/>
<VersionInfo resourceName="Send-Version" version="SHA-512:7aa4d3f896fa7fd430171197aedb414aac4504c0c7d17c4dacfabedadaab63fa2ce1064d6ef78d857db1751e0019b6f9c1087013f2c107712e79be9aa39727c2"/>
<VersionInfo resourceName="Set-JWT-Variables" version="SHA-512:90d33279f3717b985a81ea7dca877fd6694319372a2eee207053b280fdeaea462ba662dd7c6dc3df4429ff7d280237a05feeb58189770289c1d37ac693f39cef"/>
<VersionInfo resourceName="Set-Response" version="SHA-512:638e7320945fd57ea40448bc9997ec9a2297f4ae51e6e1654e8d273dcc2d9e47c131fb344eea870a465282b475886277db194d379c350fa07380b9d08175ba1c"/>
<VersionInfo resourceName="Update-Keys" version="SHA-512:7fbdd4ad59164850604b91dc9736c7a7e38ad42ce5457901cd4ba2497824406458288f25e35db9bbf848fed5dafa6a5fd6040ebe9ad9076fdde192f8e3b65b54"/>
<VersionInfo resourceName="Set-Quota-Response" version="SHA-512:875421076779396ee6e22ea9d62484e5c56cb9e219171ebc647c443396b6d060ebd7a9c1769e9be93a3cd9a34e3aecf7583fb44518117af2707e905a8f04ffbc"/>
<VersionInfo resourceName="Set-Quota-Variables" version="SHA-512:4cf0e7d6a4bababbb7afcb68fd9ad579b22dc20ce48840a42f80671bea83a29caa711d71cadf12d6c6357f0a7ca256d6379dcf6aadd6951d4a29c7b9e52168d8"/>
<VersionInfo resourceName="Set-Response" version="SHA-512:ec329a43c08fccf1f936e023ef09f75b43e48fc9b043660f0ed3992eb828c91e346e455d664a50144beaca3c3f326bd0d79c7f0fc3a00da22f5a159889267a4f"/>
<VersionInfo resourceName="Update-Keys" version="SHA-512:fde3c7e2aa3df04d17398a323145e19a8d933e59c374fca8c841bfd46c6efa9e4ecef300808529f04d0529a54590a15e45c12d17542863b65be84e7930283928"/>
<VersionInfo resourceName="Verify-API-Key" version="SHA-512:7a8771e16079eceb4d22f5b43382d4bf57fb41d63fb6e2dbd77afc6e736f59fc3b77e22d2e7460305d46e478cac67926b27614beeb0fd15871e59ab03ad0eea0"/>
</Policies>
<ProxyEndpoints>
<VersionInfo resourceName="default" version="SHA-512:91af7db269967680edaf77b26c273e0e2a11522d1b8c6ae5cdbc82d4c1cbf6d211df857648f796dcd08903ef5fca5d7f428e9c67515798bc0e48929df6e4af71"/>
<VersionInfo resourceName="default" version="SHA-512:7882a0416494cd74606f01b4ef02ccbafef5d68bc86bdead1163918dfcc8e80bcb3f7c264ef94a8061889b970675ef4ce923a58a951fc18689a128419b0b1b8e"/>
</ProxyEndpoints>
<Resources>
<VersionInfo resourceName="java://products-javacallout-2.0.0.jar" version="SHA-512:2bd60a6c6ae8cfc2bed84f58f0a55a6d471b21cf91b45683498a536379a596d307e5db22ea425c539bff7d9ac00d3453f055cd2641255cfd6243a759218c5aac"/>
<VersionInfo resourceName="jsc://eval-quota-result.js" version="SHA-512:0d6d041e6d3aeb601ddbc215329509b4ac4feedc3f160948568f50576094af05eb81ee7b06e0da7b00b82fe9aab9b9d2c093e6285f28c41a8240e6c3354e301f"/>
<VersionInfo resourceName="jsc://generate-jwk.js" version="SHA-512:8b3b2c6638500750e1b176a8911af5325bb92356641f068ffe674fb59bbf93e79e0e7af64906c7338189d9ddfb997078b4f8eb3baf3d3a98cbfee76b493bb981"/>
<VersionInfo resourceName="jsc://jsrsasign-all-min.js" version="SHA-512:62986d1a086c2ac2c9c20f8ee27919a57430552246098534f10468faa6b85401dbfa4b35ec7bb9404d37d695f5778331e71a1909268240a334151fd167c3f06a"/>
<VersionInfo resourceName="jsc://jwt-initialization.js" version="SHA-512:c9b1af8f846d11cf42d454643c21a937489888c8fcbf1337429672500f0ce6d26397e3697342773616706feee927521ca5eededf1fb0269dd1da253645087656"/>
<VersionInfo resourceName="jsc://send-jwk-response.js" version="SHA-512:81ab460fbf7c400cbb346c3d79cc1bcef116f2c21177c009e226c9a259ff73f9414cf0c838a43bd8febf745a3a1d1f6e049eea45f21bbff1df5422792245cabc"/>
<VersionInfo resourceName="jsc://set-jwt-variables.js" version="SHA-512:bfedb7fa63f97c7d271ccced2e9062b97262b88816f8a8b7ec54131b6804a86e6e9bf79d6b77ddd6f6e9f5225fb18fd0d31c115a77b1c75c3c269fbe538d6cf6"/>
<VersionInfo resourceName="jsc://set-quota-variables.js" version="SHA-512:361e8417c187ca41d24a6077d196fffcc0abd73080e22983f8e9391a4ff9a915b27197ed45932370458b34de5b7491f9e89dda42c64062497029e453c0ec814f"/>
<VersionInfo resourceName="jsc://set-response.js" version="SHA-512:cd9708e2be0ca8747c51d7c8d72695c277231861be78c6f279f90bd7b8deafa2cf7285aa1680650b5c3154163a572662613a3c6a5ee2486e30a2bb63ea862dcd"/>
</Resources>
<SharedFlows/>
Expand Down
Empty file.
10 changes: 10 additions & 0 deletions proxies/remote-proxy-legacy/apiproxy/policies/Lookup-Products.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<LookupCache async="false" continueOnError="false" enabled="true" name="Lookup-Products">
<DisplayName>Lookup Products</DisplayName>
<CacheKey>
<KeyFragment ref="request.uri"/>
</CacheKey>
<Scope>Exclusive</Scope>
<AssignTo>productlist</AssignTo>
<CacheResource>apigee-remote-service</CacheResource>
</LookupCache>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<PopulateCache async="false" continueOnError="false" enabled="true" name="Populate-Product-List">
<DisplayName>Populate Product List</DisplayName>
<Properties/>
<CacheKey>
<Prefix/>
<KeyFragment ref="request.uri"/>
</CacheKey>
<CacheResource>apigee-remote-service</CacheResource>
<Scope>Exclusive</Scope>
<ExpirySettings>
<TimeoutInSec>120</TimeoutInSec>
</ExpirySettings>
<Source>response.content</Source>
</PopulateCache>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage async="false" continueOnError="false" enabled="true" name="Send-Product-List">
<DisplayName>Send Product List</DisplayName>
<Properties/>
<Set>
<Headers>
<Header name="Cache-Control">no-store</Header>
<Header name="Pragma">no-cache</Header>
</Headers>
<Payload contentType="application/json" variablePrefix="@" variableSuffix="#">@productlist#</Payload>
</Set>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<AssignTo createNew="false" transport="http" type="response"/>
</AssignMessage>
12 changes: 12 additions & 0 deletions proxies/remote-proxy-legacy/apiproxy/proxies/default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,22 @@
<Step>
<Name>Authenticate-Call</Name>
</Step>
<Step>
<Name>Lookup-Products</Name>
</Step>
</Request>
<Response>
<Step>
<Name>JavaCallout</Name>
<Condition>lookupcache.Lookup-Products.cachehit = false</Condition>
</Step>
<Step>
<Name>Populate-Product-List</Name>
<Condition>lookupcache.Lookup-Products.cachehit = false</Condition>
</Step>
<Step>
<Name>Send-Product-List</Name>
<Condition>lookupcache.Lookup-Products.cachehit = true</Condition>
</Step>
</Response>
<Condition>(proxy.pathsuffix MatchesPath "/products") and (request.verb = "GET")</Condition>
Expand Down
16 changes: 11 additions & 5 deletions proxies/remote-proxy-legacy/apiproxy/remote-service.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<APIProxy revision="2" name="remote-service">
<APIProxy revision="1" name="remote-service">
<Basepaths>/remote-service</Basepaths>
<ConfigurationVersion majorVersion="4" minorVersion="0"/>
<CreatedAt>1529864810874</CreatedAt>
<CreatedBy>srinandans@google.com</CreatedBy>
<CreatedAt>1588029837478</CreatedAt>
<CreatedBy>defaultUser</CreatedBy>
<Description>remote-service</Description>
<DisplayName>remote-service</DisplayName>
<LastModifiedAt>1544596340972</LastModifiedAt>
<LastModifiedAt>1588030137312</LastModifiedAt>
<LastModifiedBy>defaultUser</LastModifiedBy>
<ManifestVersion>SHA-512:35f8d4ae9a0f1a3ae63cda4936914fb71ede499a50e6f0e7746e11cafd32e4991d804524468928ebd15f1af698f52239bc26ebedaa78f7be4b8271ee0fa97ece</ManifestVersion>
<ManifestVersion>SHA-512:e21a46e8880a3e08b3fee9ca094b204c8c9ebe0d4298f00fee128c12f5bbb35fc5845775bc5efae349a8df5c299f61d60bfeb430dc5fd8e415b2db415b71ea98</ManifestVersion>
<Policies>
<Policy>Access-App-Info-2</Policy>
<Policy>Access-App-Info</Policy>
Expand All @@ -18,6 +18,7 @@
<Policy>Create-OAuth-Request</Policy>
<Policy>Create-Refresh-Request</Policy>
<Policy>DistributedQuota</Policy>
<Policy>Eval-Quota-Result</Policy>
<Policy>Extract-API-Key</Policy>
<Policy>Extract-OAuth-Params</Policy>
<Policy>Extract-Refresh-Params</Policy>
Expand All @@ -29,15 +30,19 @@
<Policy>Get-Private-Key</Policy>
<Policy>Get-Public-Keys</Policy>
<Policy>JavaCallout</Policy>
<Policy>Lookup-Products</Policy>
<Policy>Populate-Product-List</Policy>
<Policy>Products-to-JSON-2</Policy>
<Policy>Products-to-JSON</Policy>
<Policy>Raise-Fault-Unknown-Request</Policy>
<Policy>RefreshAccessToken</Policy>
<Policy>Retrieve-Cert</Policy>
<Policy>RevokeRefreshToken</Policy>
<Policy>Send-JWK-Message</Policy>
<Policy>Send-Product-List</Policy>
<Policy>Send-Version</Policy>
<Policy>Set-JWT-Variables</Policy>
<Policy>Set-Quota-Response</Policy>
<Policy>Set-Quota-Variables</Policy>
<Policy>Set-Response</Policy>
<Policy>Update-Keys</Policy>
Expand All @@ -48,6 +53,7 @@
</ProxyEndpoints>
<Resources>
<Resource>java://products-javacallout-2.0.0.jar</Resource>
<Resource>jsc://eval-quota-result.js</Resource>
<Resource>jsc://generate-jwk.js</Resource>
<Resource>jsc://jsrsasign-all-min.js</Resource>
<Resource>jsc://jwt-initialization.js</Resource>
Expand Down
Empty file.

0 comments on commit 5153544

Please sign in to comment.