├── LICENSE.txt ├── Makefile ├── README.md ├── build.sh ├── circuit-breaker-slm-clustered ├── README.md ├── circuit-breaker-slm-clustered.yaml └── implementation │ ├── export.xml │ └── local │ └── policy │ └── circuit-breaker-slm-clustered │ ├── check.xsl │ └── credential.xsl ├── circuit-breaker-slm ├── README.md ├── circuit-breaker-slm.yaml └── implementation │ ├── export.xml │ └── local │ └── policy │ └── circuit-breaker-slm │ ├── check.xsl │ └── credential.xsl ├── clientIP-filter-policy ├── README.md └── clientIP-filter-policy.zip ├── document-cache ├── README.md └── documentcache-policy.zip ├── gatewayscript ├── README.md └── gatewayscript-policy.zip ├── jwe-decrypt ├── README.md └── jwe-decrypt-policy.zip ├── jwe-encrypt ├── README.md └── jwe-encrypt-policy.zip ├── jws-sign ├── README.md └── jws-sign-policy.zip ├── jws-verify ├── README.md └── jws-verify-policy.zip ├── kerberos-validation ├── README.md └── kerberos-validation-policy.zip ├── saml-validation ├── README.md └── saml-validation-policy.zip ├── validate-auto ├── README.md └── validate-auto-xsd-jsv-policy.zip ├── validate-json ├── README.md └── validate-jsv-policy.zip ├── validate-soap ├── README.md └── validate-wsdl-policy.zip ├── validate-xml ├── README.md └── validate-xsd-policy.zip └── xslt ├── README.md └── xslt-policy.zip /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2015-2018 IBM Corporation 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Copyright 2018 IBM Corporation 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | TARGETS := $(patsubst %.yaml,%.zip, $(wildcard */*.yaml)) 16 | 17 | .PHONY: all 18 | all: $(TARGETS) 19 | 20 | $(TARGETS): 21 | @( ./build.sh $@ ) 22 | 23 | .PHONY: clean 24 | clean: 25 | rm -f $(TARGETS) 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # IBM API Connect v5 Sample Policies 2 | 3 | This folder contains a variety of sample policies that can be used with 4 | IBM API Connect v5. These policies can also be used for the `V5 Compatible` gateway configuration of API Connect 2018 or API Connect v10.x 5 | ## Usage 6 | **Instructions on how to reuse a sample policy** 7 | 8 | You can download any of the policies provided and reuse them to make your own by following these instructions: 9 | 10 | 1. Download policy sample, e.g. gatewayscript-policy, to your system (zip file gatewayscript-policy.zip). *You will have to click on “View Raw” to be prompted with the download option*. 11 | 12 | 2. Once downloaded to your system, unzip the file. There should be a yaml definition (e.g. gatewayscript-policy.yaml) and an implementation folder. The DataPower artifacts can be found in the implementation folder in a zip file. The zip file may have the same name as the one downloaded (in the case of the GatewayScript policy, gatewayscript-policy.zip). 13 | 14 | 3. Login to the DataPower appliance and create a new DataPower domain (e.g. "foo") 15 | 16 | 4. Import the gatewayscript-policy.zip policy implementation into the new domain *foo*. 17 | 18 | 5. From the File Explorer, open the domain configuration file foo.cfg, and do a global find/replace of all “gatewayscript-policy” references with “alice-policy”, assuming here that “alice-policy” will be your new policy name. 19 | 20 | 6. Create a folder structure “local://policy/alice-policy” 21 | 22 | 7. Move all contents from “local://policy/gatewayscript-policy” to “local://policy/alice-policy” 23 | 24 | 8. Restart the *foo* domain (don't save your configuration before this) to get the DataPower appliance to load the the newly renamed objects. 25 | 26 | 9. Verify all of the artifacts from “alice-policy” policy are there. 27 | 28 | 10. Make changes to the processing rules to implement your policy requirements. See: http://www.ibm.com/support/knowledgecenter/SSMNED_5.0.0/com.ibm.apic.policy.doc/capim_custpolicies_overview.html 29 | 30 | 11. Export your “alice-policy-main” rule action, and give it the name “alice-policy” which after download will be “alice-policy.zip”. 31 | 32 | 12. Modify the yaml file so that it matches the new policy implementation. 33 | 34 | 13. Now we have a new yaml file and a new implementation. We just need to create a zip file with all the artifacts: the yaml file, and implementation folder. This will become our new policy to be consumed by APIm. 35 | 36 | 14. Finally, go to your APIm environment and import the zip file. If there were no naming errors, the policy should be imported correctly into the API manager. 37 | 15. Login to the DP appliance and verify the policy was deployed correctly, the rule name will now look like: 38 | *alice-main_apim_e55cce330e4b0b436ff65a06f_v1.0* 39 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2018 IBM Corporation 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | function die { 18 | echo $1, BUILD FAILED. 19 | exit 1 20 | } 21 | 22 | SRC=$(dirname "$1") 23 | BUILD="build" 24 | 25 | rm -rf $SRC/$BUILD 26 | mkdir -p $SRC/$BUILD/implementation \ 27 | || die "Output directory structure could not be created" 28 | 29 | cp $SRC/$SRC.yaml $SRC/$BUILD/ \ 30 | || die "Missing definitions file called \"$SRC.yaml\"" 31 | 32 | ( cd $SRC/implementation \ 33 | && zip -r ../$BUILD/implementation/$SRC-main.zip * \ 34 | || die "Hit an unexpected problem creating the implementation zip file" ) 35 | 36 | ( cd $SRC/$BUILD \ 37 | && zip -r ../$SRC.zip * || die "An error occured during compression" ) 38 | 39 | rm -rf $SRC/$BUILD 40 | echo "Successfully built $SRC.zip" 41 | -------------------------------------------------------------------------------- /circuit-breaker-slm-clustered/README.md: -------------------------------------------------------------------------------- 1 | # Circuit Breaker SLM with Peering/Clustered 2 | 3 | The Circuit Breaker SLM policy can be used in IBM API Connect to reject new connections when the total request concurrency exceeds a configurable threshold. 4 | Supports count partitioning using a unique string identifier (key). This policy is also clustered or peered using SLM Peering allowing the count to be 5 | distributed across a cluster of API Gateways. 6 | 7 | ## Prerequisites 8 | 9 | IBM API Connect 5.x 10 | IBM DataPower 7.2.x 11 | 12 | ## Sample Configuration 13 | 14 | ``` 15 | x-ibm-configuration: 16 | testable: true 17 | enforced: true 18 | cors: 19 | enabled: true 20 | assembly: 21 | execute: 22 | - circuit-breaker-slm-clustered: 23 | version: 1.0.0 24 | key: default 25 | concurrency: 1 26 | - invoke: 27 | target-url: 'https://tonyf-delay.mybluemix.net/delay/20' 28 | verb: GET 29 | catch: 30 | - errors: 31 | - CircuitBreakerSLM 32 | execute: 33 | - set-variable: 34 | title: Set custom response for the circuit break 35 | actions: 36 | - set: message.body 37 | value: "{\"message\":\"I'm sorry Dave, I'm afraid I can't let you do that\"}" 38 | - set: message.status.code 39 | value: '429' 40 | - set: message.headers.content-type 41 | value: application/json 42 | ``` 43 | -------------------------------------------------------------------------------- /circuit-breaker-slm-clustered/circuit-breaker-slm-clustered.yaml: -------------------------------------------------------------------------------- 1 | policy: 1.0.0 2 | 3 | info: 4 | title: Circuit Breaker Using SLM and Peering 5 | name: circuit-breaker-slm-clustered 6 | version: 1.0.0 7 | description: Concurrency based circuit breaker policy with SLM Peering enabled 8 | contact: 9 | name: IBM DataPower Samples 10 | url: https://github.com/ibm-datapower 11 | email: steve-product-manager@ibm.com 12 | 13 | attach: 14 | - rest 15 | - soap 16 | 17 | gateways: 18 | - datapower-gateway 19 | 20 | properties: 21 | $schema: "http://json-schema.org/draft-04/schema#" 22 | type: object 23 | properties: 24 | concurrency: 25 | label: "Maximum Concurrency" 26 | description: "Maximum allowed concurrency per partition key" 27 | type: integer 28 | key: 29 | label: "Partition Key" 30 | description: "Partition the counts using a unique string identifier" 31 | type: string 32 | default: default 33 | required: 34 | - concurrency 35 | - key 36 | -------------------------------------------------------------------------------- /circuit-breaker-slm-clustered/implementation/export.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Exported Configuration 4 | admin 5 | circuit-breaker-slm-clustered 6 | 7 | software 8 | IDG 9 | IDG 10 | IBM DataPower Gateway 11 | IBM DataPower Gateway 12 | e408e63b05fb 13 | 0000001 14 | IDG.7.6.0.2 15 | IDG.7.6.0.2 16 | 291940 17 | 2017/09/20 14:23:06 18 | 2018-01-09 19 | 15:37:38 EST 20 | 2018-01-09 21 | 09:52:14 EST 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | enabled 31 | custom-stylesheet 32 | per-extracted-value 33 | local:///policy/circuit-breaker-slm-clustered/credential.xsl 34 | 35 | 36 | enabled 37 | log-only 38 | debug 39 | 40 | 41 | enabled 42 | execute-all-statements 43 | 44 | 40 45 | 46 | circuit-breaker-slm-clustered-cred 47 | 48 | 49 | circuit-breaker-slm-clustered-log 50 | 0 51 | concurrent 52 | greater-than 53 | count-all 54 | 5 55 | 0 56 | 0 57 | 0 58 | 5000 59 | off 60 | 5000 61 | 62 | webapi-peering 63 | off 64 | 65 | 66 | enabled 67 | slm 68 | NULL 69 | 70 | 71 | 72 | 73 | 74 | none 75 | none 76 | off 77 | circuit-breaker-slm-clustered 78 | default 79 | proxy 80 | off 81 | circuit-breaker-slm-clustered-slm-action 82 | body 83 | static 84 | on 85 | off 86 | first-available 87 | 0 88 | 1000 89 | off 90 | XPATH 91 | 0 92 | GET 93 | POST 94 | POST 95 | 96 | 97 | enabled 98 | xform 99 | circuit-breaker-slm-clustered 100 | local:///policy/circuit-breaker-slm-clustered/check.xsl 101 | 102 | 103 | 104 | 105 | 106 | none 107 | none 108 | off 109 | NULL 110 | default 111 | proxy 112 | default 113 | off 114 | body 115 | static 116 | on 117 | off 118 | first-available 119 | 0 120 | 1000 121 | off 122 | XPATH 123 | 0 124 | GET 125 | POST 126 | POST 127 | 128 | 129 | enabled 130 | request-rule 131 | none 132 | none 133 | on 134 | off 135 | circuit-breaker-slm-clustered-main_slm_0 136 | circuit-breaker-slm-clustered-main_xform_0 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | -------------------------------------------------------------------------------- /circuit-breaker-slm-clustered/implementation/local/policy/circuit-breaker-slm-clustered/check.xsl: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /circuit-breaker-slm-clustered/implementation/local/policy/circuit-breaker-slm-clustered/credential.xsl: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /circuit-breaker-slm/README.md: -------------------------------------------------------------------------------- 1 | # Circuit Breaker SLM 2 | 3 | The Circuit Breaker SLM policy can be used in IBM API Connect to reject new connections when the total request concurrency exceeds a configurable threshold. Supports count partitioning using a unique string identifier (key). 4 | 5 | ## Prequisites 6 | 7 | IBM API Connect 5.x 8 | IBM DataPower 7.2.x -------------------------------------------------------------------------------- /circuit-breaker-slm/circuit-breaker-slm.yaml: -------------------------------------------------------------------------------- 1 | policy: 1.0.0 2 | 3 | info: 4 | title: Circuit Breaker Using SLM 5 | name: circuit-breaker-slm 6 | version: 1.0.0 7 | description: Concurrency based circuit breaker policy (non-clustered) 8 | contact: 9 | name: IBM DataPower Samples 10 | url: https://github.com/ibm-datapower 11 | email: steve-product-manager@ibm.com 12 | 13 | attach: 14 | - rest 15 | - soap 16 | 17 | gateways: 18 | - datapower-gateway 19 | 20 | properties: 21 | $schema: "http://json-schema.org/draft-04/schema#" 22 | type: object 23 | properties: 24 | concurrency: 25 | label: "Maximum Concurrency" 26 | description: "Maximum allowed concurrency per partition key" 27 | type: integer 28 | key: 29 | label: "Partition Key" 30 | description: "Partition the counts using a unique string identifier" 31 | type: string 32 | default: default 33 | required: 34 | - concurrency 35 | - key 36 | -------------------------------------------------------------------------------- /circuit-breaker-slm/implementation/export.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Exported Configuration 4 | admin 5 | circuit-breaker-slm 6 | 7 | software 8 | IDG 9 | IDG 10 | IBM DataPower Gateway 11 | IBM DataPower Gateway 12 | e408e63b05fb 13 | 0000001 14 | IDG.7.6.0.2 15 | IDG.7.6.0.2 16 | 291940 17 | 2017/09/20 14:23:06 18 | 2018-01-09 19 | 15:37:38 EST 20 | 2018-01-09 21 | 09:52:14 EST 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | enabled 31 | custom-stylesheet 32 | per-extracted-value 33 | local:///policy/circuit-breaker-slm/credential.xsl 34 | 35 | 36 | enabled 37 | log-only 38 | debug 39 | 40 | 41 | enabled 42 | execute-all-statements 43 | 44 | 40 45 | 46 | circuit-breaker-slm-cred 47 | 48 | 49 | circuit-breaker-slm-log 50 | 0 51 | concurrent 52 | greater-than 53 | count-all 54 | 5 55 | 0 56 | 0 57 | 0 58 | 5000 59 | off 60 | 5000 61 | 62 | off 63 | 64 | 65 | enabled 66 | slm 67 | NULL 68 | 69 | 70 | 71 | 72 | 73 | none 74 | none 75 | off 76 | circuit-breaker-slm 77 | default 78 | proxy 79 | off 80 | circuit-breaker-slm-slm-action 81 | body 82 | static 83 | on 84 | off 85 | first-available 86 | 0 87 | 1000 88 | off 89 | XPATH 90 | 0 91 | GET 92 | POST 93 | POST 94 | 95 | 96 | enabled 97 | xform 98 | circuit-breaker-slm 99 | local:///policy/circuit-breaker-slm/check.xsl 100 | 101 | 102 | 103 | 104 | 105 | none 106 | none 107 | off 108 | NULL 109 | default 110 | proxy 111 | default 112 | off 113 | body 114 | static 115 | on 116 | off 117 | first-available 118 | 0 119 | 1000 120 | off 121 | XPATH 122 | 0 123 | GET 124 | POST 125 | POST 126 | 127 | 128 | enabled 129 | request-rule 130 | none 131 | none 132 | on 133 | off 134 | circuit-breaker-slm-main_slm_0 135 | circuit-breaker-slm-main_xform_0 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /circuit-breaker-slm/implementation/local/policy/circuit-breaker-slm/check.xsl: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /circuit-breaker-slm/implementation/local/policy/circuit-breaker-slm/credential.xsl: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /clientIP-filter-policy/README.md: -------------------------------------------------------------------------------- 1 | # Access Control By ClientIP Policy 2 | 3 | The Access Control By ClientIP policy can be used in IBM Connect to filter 4 | API requests based upon the client's IP address. The policy properties 5 | have an array of "allow" or "deny" IP addresses. The IP addresses may be 6 | a single IP address or my use CIDR notation to specify a range of addresses. 7 | 8 | ## Prequisites 9 | 10 | - IBM API Connect 5.0.0 11 | - IBM Datapower 7.6.0 or later 12 | 13 | ``` 14 | -------------------------------------------------------------------------------- /clientIP-filter-policy/clientIP-filter-policy.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibm-apiconnect/policy/6c064ac48dbb7523a565e1c54b6bcfde10ac7d96/clientIP-filter-policy/clientIP-filter-policy.zip -------------------------------------------------------------------------------- /document-cache/README.md: -------------------------------------------------------------------------------- 1 | # Document Cache Policy 2 | 3 | The Document Cache policy can be used in IBM API Connect to alter the DataPower document cache policy rules that determine how backend responses will be cached. 4 | 5 | ## Prerequisites 6 | 7 | - IBM API Connect 5.0.0.0 8 | - IBM Datapower 7.2.0.5 9 | 10 | ``` 11 | -------------------------------------------------------------------------------- /document-cache/documentcache-policy.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibm-apiconnect/policy/6c064ac48dbb7523a565e1c54b6bcfde10ac7d96/document-cache/documentcache-policy.zip -------------------------------------------------------------------------------- /gatewayscript/README.md: -------------------------------------------------------------------------------- 1 | # GatewayScript Policy 2 | 3 | The GatewayScript policy can be used in IBM API Connect to alter 4 | JSON payloads for REST APIs. 5 | 6 | ## Prequisites 7 | 8 | - IBM API Connect 5.0.0.0 9 | - IBM Datapower 7.2.0.5 10 | - A DataPower GatewayScript source file accessible via URL, on the DataPower appliance (local:/// or store:///). 11 | 12 | ``` 13 | -------------------------------------------------------------------------------- /gatewayscript/gatewayscript-policy.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibm-apiconnect/policy/6c064ac48dbb7523a565e1c54b6bcfde10ac7d96/gatewayscript/gatewayscript-policy.zip -------------------------------------------------------------------------------- /jwe-decrypt/README.md: -------------------------------------------------------------------------------- 1 | # JWE Decrypt Policy 2 | 3 | The JWE Decrypt Policy policy can be used in IBM API Connect to decrypt 4 | JSON payloads for REST APIs. 5 | 6 | ## Prequisites 7 | 8 | - IBM API Management 5.0.0.0 9 | - IBM Datapower 7.2.0.5 10 | - Crypto object located in the IBM API Connect domain on the DataPower appliance 11 | 12 | ``` 13 | -------------------------------------------------------------------------------- /jwe-decrypt/jwe-decrypt-policy.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibm-apiconnect/policy/6c064ac48dbb7523a565e1c54b6bcfde10ac7d96/jwe-decrypt/jwe-decrypt-policy.zip -------------------------------------------------------------------------------- /jwe-encrypt/README.md: -------------------------------------------------------------------------------- 1 | # JWE Encrypt Policy 2 | 3 | The JWE Encrypt Policy policy can be used in IBM API Connect to encrypt 4 | entire JSON payloads for REST APIs. 5 | 6 | ## Prequisites 7 | 8 | - IBM API Connect 5.0.0.0 9 | - IBM Datapower 7.2.0.5 10 | - Crypto object located in the IBM API Connect domain on the DataPower appliance 11 | 12 | ``` 13 | -------------------------------------------------------------------------------- /jwe-encrypt/jwe-encrypt-policy.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibm-apiconnect/policy/6c064ac48dbb7523a565e1c54b6bcfde10ac7d96/jwe-encrypt/jwe-encrypt-policy.zip -------------------------------------------------------------------------------- /jws-sign/README.md: -------------------------------------------------------------------------------- 1 | # JWS Sign Policy 2 | 3 | The JWS Sign Policy can be used in IBM API Connect to sign 4 | JSON payloads. This policy is only valid for REST APIs. 5 | 6 | ## Prequisites 7 | 8 | - IBM API Connect 5.0.0.0 9 | - IBM Datapower 7.2.0.5 10 | - Crypto object located in the IBM API Connect domain on the DataPower appliance 11 | 12 | ## Usage 13 | 14 | - For algorithm types HS256, HS385, and HS512 the Crypto Object referenced must be a Shared Secret Key 15 | - For algorithm types RS256, RS385, and RS512 the Crypto Object referenced must be a Crypto Key (private key) 16 | 17 | ``` 18 | -------------------------------------------------------------------------------- /jws-sign/jws-sign-policy.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibm-apiconnect/policy/6c064ac48dbb7523a565e1c54b6bcfde10ac7d96/jws-sign/jws-sign-policy.zip -------------------------------------------------------------------------------- /jws-verify/README.md: -------------------------------------------------------------------------------- 1 | # JWS Verify Policy 2 | 3 | The JWS Verify Policy can be used in IBM API Connect to verify signatures for 4 | JSON payloads. This policy is only valid for REST APIs. 5 | 6 | ## Prequisites 7 | 8 | - IBM API Connect 5.0.0.0 9 | - IBM Datapower 7.2.0.5 10 | - Crypto object located in the IBM API Connect domain on the DataPower appliance 11 | 12 | ## Usage 13 | 14 | - If the original message was signed with a Shared Secret Key, the Crypto Object specified must be a Shared Secret Key 15 | - If the original message was signed with a private Key, Crypto Object specified must be a Crypto Certificate (public certificate) 16 | 17 | ``` 18 | -------------------------------------------------------------------------------- /jws-verify/jws-verify-policy.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibm-apiconnect/policy/6c064ac48dbb7523a565e1c54b6bcfde10ac7d96/jws-verify/jws-verify-policy.zip -------------------------------------------------------------------------------- /kerberos-validation/README.md: -------------------------------------------------------------------------------- 1 | # Kerberos Validation Policy 2 | 3 | The Kerberos Validation policy can be used in IBM API Connect to authenticate a SOAP request that contains a Kerberos Token in the BinarySecurityToken header element. 4 | 5 | ## Prerequisites 6 | 7 | - IBM API Connect 5.0.0.0 8 | - IBM Datapower 7.2.0.5 9 | - The server keytab file that is needed for verifying and authenticating the kerberos token must be manually uploaded to the DataPower appliance to either the API Connect domain's cert directory or the default domain's sharedcert directory. 10 | - The keytab file(s) must be referenced by an associated DataPower Kerberos Keytab object in the API Connect domain whose name will be used as input to the policy. 11 | 12 | ``` 13 | -------------------------------------------------------------------------------- /kerberos-validation/kerberos-validation-policy.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibm-apiconnect/policy/6c064ac48dbb7523a565e1c54b6bcfde10ac7d96/kerberos-validation/kerberos-validation-policy.zip -------------------------------------------------------------------------------- /saml-validation/README.md: -------------------------------------------------------------------------------- 1 | # SAML Validation Policy 2 | 3 | The SAML Validation policy can be used in IBM API Connect to authenticate a request that contains a digitally signed SAML assertion. 4 | 5 | ## Prerequisites 6 | 7 | - IBM API Connect 5.0.0.0 8 | - IBM Datapower 7.2.0.5 9 | - Trusted certificates files used to validate the digital signature must be manually uploaded to the DataPower appliance to either the API Connect domain's cert directory or the default domain's sharedcert directory. 10 | - The certificate file(s) must be referenced by an associated DataPower Crypto Certificate object in the API Connect domain. 11 | - The DataPower Crypto Certificate object(s) must be referenced by the validation credential in the API Management domain whose name begins with "saml-validation-policy-valcred" 12 | 13 | ``` 14 | -------------------------------------------------------------------------------- /saml-validation/saml-validation-policy.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibm-apiconnect/policy/6c064ac48dbb7523a565e1c54b6bcfde10ac7d96/saml-validation/saml-validation-policy.zip -------------------------------------------------------------------------------- /validate-auto/README.md: -------------------------------------------------------------------------------- 1 | # Validate AUTO 2 | 3 | The Validate JSON or XML policy can be used in IBM API Connect to validate 4 | JSON or XML messages for REST APIs. 5 | 6 | ## Prequisites 7 | 8 | IBM API Management 5.0.0.0 9 | IBM Datapower 7.2.0.5 10 | A valid JSON Schema, a valid XML Schema (both accessible via URL). The URL can reference schemas on the DataPower appliance (local:/// or store:///) or via HTTP. 11 | 12 | ``` 13 | -------------------------------------------------------------------------------- /validate-auto/validate-auto-xsd-jsv-policy.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibm-apiconnect/policy/6c064ac48dbb7523a565e1c54b6bcfde10ac7d96/validate-auto/validate-auto-xsd-jsv-policy.zip -------------------------------------------------------------------------------- /validate-json/README.md: -------------------------------------------------------------------------------- 1 | # Validate JSON 2 | 3 | The Validate JSON policy can be used in IBM API Connect to validate 4 | JSON messages for REST APIs. 5 | 6 | ## Prequisites 7 | 8 | IBM API Connect 5.0.0.0 9 | IBM Datapower 7.2.0.5 10 | A valid JSON Schema, accessible via URL, either on the DataPower appliance (local:/// or store:///) or via HTTP. 11 | 12 | ``` 13 | -------------------------------------------------------------------------------- /validate-json/validate-jsv-policy.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibm-apiconnect/policy/6c064ac48dbb7523a565e1c54b6bcfde10ac7d96/validate-json/validate-jsv-policy.zip -------------------------------------------------------------------------------- /validate-soap/README.md: -------------------------------------------------------------------------------- 1 | # Validate SOAP 2 | 3 | The Validate SOAP policy can be used in IBM API Connect to validate 4 | SOAP messages for SOAP or REST APIs. 5 | 6 | ## Prequisites 7 | 8 | IBM API Connect 5.0.0.0 9 | IBM Datapower 7.2.0.5 10 | A valid WSDL Schema, accessible via URL, either on the DataPower appliance (local:/// or store:///) or via HTTP. 11 | 12 | ``` 13 | -------------------------------------------------------------------------------- /validate-soap/validate-wsdl-policy.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibm-apiconnect/policy/6c064ac48dbb7523a565e1c54b6bcfde10ac7d96/validate-soap/validate-wsdl-policy.zip -------------------------------------------------------------------------------- /validate-xml/README.md: -------------------------------------------------------------------------------- 1 | # Validate XML 2 | 3 | The Validate XML policy can be used in IBM API Connect to validate 4 | XML messages for SOAP or REST APIs. 5 | 6 | ## Prequisites 7 | 8 | IBM API Connect 5.0.0.0 9 | IBM Datapower 7.2.0.5 10 | A valid XML Schema, accessible via URL, either on the DataPower appliance (local:/// or store:///) or via HTTP. 11 | 12 | ``` 13 | -------------------------------------------------------------------------------- /validate-xml/validate-xsd-policy.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibm-apiconnect/policy/6c064ac48dbb7523a565e1c54b6bcfde10ac7d96/validate-xml/validate-xsd-policy.zip -------------------------------------------------------------------------------- /xslt/README.md: -------------------------------------------------------------------------------- 1 | # XSLT Policy 2 | 3 | The XSLT policy can be used in IBM API Connect to alter 4 | XML payloads for SOAP or REST APIs. 5 | 6 | ## Prequisites 7 | 8 | IBM API Connect 5.0.0.0 9 | IBM Datapower 7.2.0.5 10 | A valid XSLT, accessible via URL, either on the DataPower appliance (local:/// or store:///) or via HTTP. 11 | 12 | ``` 13 | -------------------------------------------------------------------------------- /xslt/xslt-policy.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibm-apiconnect/policy/6c064ac48dbb7523a565e1c54b6bcfde10ac7d96/xslt/xslt-policy.zip --------------------------------------------------------------------------------