├── IC17-6381-DataPower-DevOps
├── IC17-6381-DataPower-DevOps.pdf
├── README.md
├── ci-demo
│ ├── docker-compose.yml
│ └── jenkins
│ │ ├── Dockerfile
│ │ ├── config.xml
│ │ ├── harvest.sh
│ │ └── plugins.txt
└── export.zip
├── IC17-7502-DataPower-APIConnect-Toolkit
├── instructions.pdf
├── lab1
│ ├── BankBack.xslt
│ ├── SBCRequest.xml
│ ├── SomeBankChecked.wsdl
│ ├── bankback_1.0.0.yaml
│ ├── bankbackproduct_1.0.0.yaml
│ ├── checkingRequest.json
│ ├── checkingResponse.json
│ └── checking_1.0.0.yaml
└── lab2
│ ├── JWTAPI.yaml
│ └── lab2_1.0.0.yaml
└── README.md
/IC17-6381-DataPower-DevOps/IC17-6381-DataPower-DevOps.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-datapower/interconnect-labs/95a6032ef76a7e575dee23a4086063cd33d2c407/IC17-6381-DataPower-DevOps/IC17-6381-DataPower-DevOps.pdf
--------------------------------------------------------------------------------
/IC17-6381-DataPower-DevOps/README.md:
--------------------------------------------------------------------------------
1 | # DataPower DevOps
2 |
3 | This lab will take you from an `export.zip` through running DataPower for Docker with Jenkins CI and GitLab VCS.
4 |
5 | Please follow the instructions in the included PDF file.
6 |
7 | In the lab, the virtual machine was simply Ubuntu 14.04 with `docker` and `docker-compose` installed. The lab is written with this in mind, but with small adjustments it can be run on any Docker system.
8 |
9 | The video https://www.youtube.com/watch?v=PYkBQU_kWt8 shows how DataPower development and continuous integration can work together -- it uses the CI system set up as part of this lab.
10 |
11 | ## Erratta:
12 |
13 | Common questions during the lab:
14 |
15 | ### The lab was written with DataPower 7.5.2
16 |
17 | DataPower 7.6 works a little bit differently because DataPower does not run as root inside the container. Whenever the lab references `ibmcom/datapower:latest` you should replace it with `ibmcom/datapower:7.5.2`. Doing so means that you are using the most recent fixpack of DataPower v7.5.2 instead of the most recent fixpack of the most recent release.
18 |
19 | ### Ensure use of the correct VM
20 |
21 | Please check to ensure that the correct VM is running. To do this, issue the command:
22 |
23 | `docker images`
24 |
25 | If the result is `Command not found`, please ask for help. Or of you are familiar with VMWare, switch back to the NewStartLab snapshot.
26 |
27 | ### Directory already exists
28 |
29 | If the `interconnect-labs` directory is present already. You can either remove it with the
30 | command `rm -rf interconnect-labs` then use the `git clone` command in the lab or just leave
31 | it in place.
32 |
33 | ### Issues with copy & paste from the PDF
34 |
35 | In the PDF, some of the dash characters (`-`) are incorrect. They look like the dash character but they are not. If you have a problem with a command, and you copied and pasted it from the PDF, please replace the dashes manually.
36 |
37 |
--------------------------------------------------------------------------------
/IC17-6381-DataPower-DevOps/ci-demo/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '3'
2 |
3 | services:
4 |
5 | jenkins:
6 | build: ./jenkins
7 | ports:
8 | - "8080:8080"
9 | depends_on:
10 | - gitlab
11 | volumes:
12 | - /var/run/docker.sock:/var/run/docker.sock
13 |
14 | gitlab:
15 | image: gitlab/gitlab-ce:8.16.7-ce.0
16 | restart: always
17 | environment:
18 | GITLAB_OMNIBUS_CONFIG: |
19 | external_url 'http://gitlab/'
20 | # Add any other gitlab.rb configuration here, each on its own line
21 | ports:
22 | - "80:80"
23 |
--------------------------------------------------------------------------------
/IC17-6381-DataPower-DevOps/ci-demo/jenkins/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM jenkins:2.32.2
2 |
3 | USER root
4 | RUN apt-get update \
5 | && apt-get install -y sudo curl \
6 | && curl -sSL https://get.docker.com/ | sh \
7 | && curl -L "https://github.com/docker/compose/releases/download/1.11.1/docker-compose-$(uname -s)-$(uname -m)" \
8 | -o /usr/local/bin/docker-compose \
9 | && chmod a+x /usr/local/bin/docker-compose \
10 | && usermod -aG docker jenkins \
11 | && rm -rf /var/lib/apt/lists/* \
12 | && echo "jenkins ALL=NOPASSWD: ALL" >> /etc/sudoers
13 |
14 | USER jenkins
15 |
16 | # Generate the list with './generate-plugins-txt.sh'
17 | COPY plugins.txt /var/jenkins_home/plugins.txt
18 | RUN /usr/local/bin/plugins.sh /var/jenkins_home/plugins.txt
19 |
20 | COPY config.xml /usr/share/jenkins/ref/config.xml
21 | RUN echo 2.0 > /usr/share/jenkins/ref/jenkins.install.UpgradeWizard.state
22 |
23 |
--------------------------------------------------------------------------------
/IC17-6381-DataPower-DevOps/ci-demo/jenkins/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | OldData
5 | jenkins.diagnostics.SecurityIsOffMonitor
6 |
7 | 2.32.2
8 | 2
9 | NORMAL
10 | true
11 |
12 |
13 | false
14 |
15 | ${ITEM_ROOTDIR}/workspace
16 | ${ITEM_ROOTDIR}/builds
17 |
18 |
19 |
20 | JDK 8
21 | /usr/lib/jvm/java-8-openjdk-amd64
22 |
23 |
24 |
25 |
26 |
27 |
28 | 5
29 | 0
30 |
31 |
32 |
33 | All
34 | false
35 | false
36 |
37 |
38 |
39 |
40 | Seed Jobs
41 |
42 | true
43 | true
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | .*seed-job.*
59 | false
60 |
61 |
62 | All
63 | 50000
64 |
65 |
66 |
67 | true
68 |
--------------------------------------------------------------------------------
/IC17-6381-DataPower-DevOps/ci-demo/jenkins/harvest.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Harvest plugins.txt and config.xml. Must be run from *this* directory.
3 | # Must be running the composed application with the default name.
4 |
5 | set -ex
6 |
7 | # Uses the technique for harvesting the plugins as described at
8 | # https://github.com/jenkinsci/docker#preinstalling-plugins
9 | curl -sSL \
10 | "http://localhost:8080/pluginManager/api/xml?depth=1&xpath=/*/*/shortName|/*/*/version&wrapper=plugins" \
11 | | perl -pe 's/.*?([\w-]+).*?([^<]+)()(<\/\w+>)+/\1 \2\n/g' \
12 | | sed 's/ /:/' \
13 | > plugins.txt
14 |
15 | docker exec -it cidemo_jenkins_1 cat /var/jenkins_home/config.xml > config.xml
16 |
17 |
--------------------------------------------------------------------------------
/IC17-6381-DataPower-DevOps/ci-demo/jenkins/plugins.txt:
--------------------------------------------------------------------------------
1 | pipeline-build-step:2.4
2 | matrix-auth:1.4
3 | ace-editor:1.1
4 | junit:1.20
5 | credentials:2.1.12
6 | branch-api:2.0.7
7 | momentjs:1.1.1
8 | durable-task:1.13
9 | pipeline-milestone-step:1.3
10 | subversion:2.7.1
11 | gradle:1.26
12 | ssh-slaves:1.13
13 | mapdb-api:1.0.9.0
14 | pipeline-stage-tags-metadata:1.0.2
15 | workflow-job:2.10
16 | github-organization-folder:1.6
17 | gitlab-plugin:1.4.5
18 | icon-shim:2.0.3
19 | display-url-api:1.1.1
20 | workflow-multibranch:2.12
21 | build-timeout:1.18
22 | pipeline-graph-analysis:1.3
23 | pipeline-model-api:1.0.2
24 | pipeline-model-declarative-agent:1.0.2
25 | pipeline-model-definition:1.0.2
26 | pipeline-multibranch-defaults:1.1
27 | git-client:2.3.0
28 | workflow-step-api:2.9
29 | ant:1.4
30 | cloudbees-folder:5.18
31 | external-monitor-job:1.7
32 | bouncycastle-api:2.16.0
33 | pipeline-stage-view:2.5
34 | scm-api:2.0.7
35 | ldap:1.14
36 | credentials-binding:1.10
37 | resource-disposer:0.6
38 | workflow-cps:2.28
39 | docker-commons:1.6
40 | github-api:1.84
41 | authentication-tokens:1.3
42 | pipeline-github-lib:1.0
43 | token-macro:2.0
44 | pipeline-stage-step:2.2
45 | ssh-credentials:1.13
46 | timestamper:1.8.8
47 | git:3.0.5
48 | workflow-scm-step:2.4
49 | ws-cleanup:0.32
50 | antisamy-markup-formatter:1.5
51 | windows-slaves:1.2
52 | email-ext:2.57
53 | workflow-support:2.13
54 | workflow-aggregator:2.5
55 | git-server:1.7
56 | pipeline-rest-api:2.5
57 | pipeline-input-step:2.5
58 | mailer:1.19
59 | github:1.26.1
60 | matrix-project:1.8
61 | handlebars:1.1.1
62 | github-branch-source:2.0.3
63 | script-security:1.27
64 | pam-auth:1.3
65 | plain-credentials:1.4
66 | workflow-basic-steps:2.4
67 | docker-workflow:1.10
68 | workflow-api:2.11
69 | config-file-provider:2.15.6
70 | structs:1.6
71 | workflow-durable-task-step:2.9
72 | workflow-cps-global-lib:2.6
73 | jquery-detached:1.2.1
74 | ansicolor:0.4.3
75 |
--------------------------------------------------------------------------------
/IC17-6381-DataPower-DevOps/export.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-datapower/interconnect-labs/95a6032ef76a7e575dee23a4086063cd33d2c407/IC17-6381-DataPower-DevOps/export.zip
--------------------------------------------------------------------------------
/IC17-7502-DataPower-APIConnect-Toolkit/instructions.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ibm-datapower/interconnect-labs/95a6032ef76a7e575dee23a4086063cd33d2c407/IC17-7502-DataPower-APIConnect-Toolkit/instructions.pdf
--------------------------------------------------------------------------------
/IC17-7502-DataPower-APIConnect-Toolkit/lab1/BankBack.xslt:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 23423
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/IC17-7502-DataPower-APIConnect-Toolkit/lab1/SBCRequest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | fred
7 | smith
8 |
9 |
10 |
11 |
12 |
13 | Cartoon Studios
14 | 8458jf8757275234
15 | P
16 | Elmer Funn
17 | 124 East Sunset Drive; Sunset, AL 64846
18 | 03849032874908
19 | 999.00
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/IC17-7502-DataPower-APIConnect-Toolkit/lab1/SomeBankChecked.wsdl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
125 |
126 |
127 |
--------------------------------------------------------------------------------
/IC17-7502-DataPower-APIConnect-Toolkit/lab1/bankback_1.0.0.yaml:
--------------------------------------------------------------------------------
1 | swagger: '2.0'
2 | info:
3 | x-ibm-name: bankback
4 | title: BankBack
5 | version: 1.0.0
6 | schemes:
7 | - https
8 | host: $(catalog.host)
9 | basePath: /bankback
10 | consumes:
11 | - text/xml
12 | produces:
13 | - text/xml
14 | securityDefinitions:
15 | clientIdHeader:
16 | type: apiKey
17 | in: query
18 | name: client_id
19 | security:
20 | - clientIdHeader: []
21 | x-ibm-configuration:
22 | testable: true
23 | enforced: true
24 | cors:
25 | enabled: true
26 | assembly:
27 | execute:
28 | - xslt:
29 | title: xslt
30 | input: true
31 | source: "\n\n\t\n\t\n\t\n\t\n\t\t\n\t\t\n\t\t23423\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n\n"
32 | phase: realized
33 | gateway: datapower-gateway
34 | paths:
35 | /checkRequest:
36 | post:
37 | responses:
38 | '200':
39 | description: 200 OK
40 | parameters:
41 | - name: body
42 | required: false
43 | in: body
44 | schema:
45 | type: string
46 | definitions: {}
47 | tags: []
48 |
--------------------------------------------------------------------------------
/IC17-7502-DataPower-APIConnect-Toolkit/lab1/bankbackproduct_1.0.0.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | product: "1.0.0"
3 | info:
4 | name: "bankback"
5 | title: "bankBack"
6 | version: "1.0.0"
7 | visibility:
8 | view:
9 | enabled: true
10 | type: "public"
11 | tags: []
12 | orgs: []
13 | subscribe:
14 | enabled: true
15 | type: "authenticated"
16 | tags: []
17 | orgs: []
18 | apis:
19 | bankback:
20 | $ref: "bankback_1.0.0.yaml"
21 | checking:
22 | $ref: "checking_1.0.0.yaml"
23 | plans:
24 | default:
25 | title: "Default Plan"
26 | description: "Default Plan"
27 | approval: false
28 | rate-limit:
29 | hard-limit: false
30 | value: "100/hour"
31 |
--------------------------------------------------------------------------------
/IC17-7502-DataPower-APIConnect-Toolkit/lab1/checkingRequest.json:
--------------------------------------------------------------------------------
1 |
2 | {"PayorAccountName":"Cartoon Studios",
3 | "PayorAccountID":"8458jf8757275234",
4 | "CheckType":"P",
5 | "Payee":"Elmer Funn",
6 | "PayeeAddr":"124 East Sunset Drive; Sunset, AL 64846",
7 | "PayeeRouteNo":"03849032874908",
8 | "Amount":"999.00"}
9 |
--------------------------------------------------------------------------------
/IC17-7502-DataPower-APIConnect-Toolkit/lab1/checkingResponse.json:
--------------------------------------------------------------------------------
1 | {
2 | "TransactionNum": "24943424",
3 | "CheckNum": "23423",
4 | "CheckType": "",
5 | "PayorAccountID": "",
6 | "Payee": "",
7 | "Amount": ""
8 | }
--------------------------------------------------------------------------------
/IC17-7502-DataPower-APIConnect-Toolkit/lab1/checking_1.0.0.yaml:
--------------------------------------------------------------------------------
1 | swagger: '2.0'
2 | info:
3 | x-ibm-name: checking
4 | title: checking
5 | version: 1.0.0
6 | schemes:
7 | - https
8 | host: $(catalog.host)
9 | basePath: /
10 | consumes:
11 | - application/json
12 | produces:
13 | - application/json
14 | securityDefinitions:
15 | clientIdHeader:
16 | type: apiKey
17 | in: query
18 | name: client_id
19 | security:
20 | - clientIdHeader: []
21 | x-ibm-configuration:
22 | testable: true
23 | enforced: true
24 | cors:
25 | enabled: true
26 | assembly:
27 | execute:
28 | - map:
29 | title: 'checkRequest: input'
30 | inputs:
31 | CheckRequestElement:
32 | schema:
33 | $ref: '#/definitions/JSONCheckRequest'
34 | variable: request.body.CheckRequestElement
35 | content: application/json
36 | outputs:
37 | body:
38 | schema:
39 | $ref: >-
40 | #/x-ibm-configuration/targets/SomeBankService/definitions/checkRequestInput
41 | variable: message.body
42 | content: application/xml
43 | content-type:
44 | schema:
45 | type: string
46 | variable: message.headers.content-type
47 | SOAPAction:
48 | schema:
49 | type: string
50 | variable: message.headers.SOAPAction
51 | actions:
52 | - set: content-type
53 | default: text/xml
54 | - set: SOAPAction
55 | - set: body.Envelope.Body.CheckRequestElement.PayorAccountName
56 | from: CheckRequestElement.PayorAccountName
57 | - set: body.Envelope.Body.CheckRequestElement.PayorAccountID
58 | from: CheckRequestElement.PayorAccountID
59 | - set: body.Envelope.Body.CheckRequestElement.CheckType
60 | from: CheckRequestElement.CheckType
61 | - set: body.Envelope.Body.CheckRequestElement.Payee
62 | from: CheckRequestElement.Payee
63 | - set: body.Envelope.Body.CheckRequestElement.PayeeAddr
64 | from: CheckRequestElement.PayeeAddr
65 | - set: body.Envelope.Body.CheckRequestElement.PayeeRouteNo
66 | from: CheckRequestElement.PayeeRouteNo
67 | - set: body.Envelope.Body.CheckRequestElement.Amount
68 | from: CheckRequestElement.Amount
69 | - if:
70 | title: if
71 | condition: 'true'
72 | execute:
73 | - invoke:
74 | title: 'checkRequest: invoke'
75 | target-url: >-
76 | https://$(api.endpoint.address)/$(api.org.name)/$(env.path)/bankback/checkRequest?client_id=d733581c-26d4-4142-a3df-c7f695ad8dd5
77 | timeout: 60
78 | verb: POST
79 | cache-response: protocol
80 | cache-ttl: 900
81 | output: checkRequestOut
82 | - map:
83 | title: 'checkRequest: output'
84 | inputs:
85 | input:
86 | schema:
87 | $ref: >-
88 | #/x-ibm-configuration/targets/SomeBankService/definitions/checkRequestOutput
89 | variable: checkRequestOut.body
90 | content: application/xml
91 | outputs:
92 | output:
93 | schema:
94 | $ref: '#/definitions/JSONCheckResponse'
95 | variable: message.body
96 | content: application/json
97 | actions:
98 | - set: output.TransactionNum
99 | from: input.Envelope.Body.CheckResponseElement.TransactionNum
100 | - set: output.CheckNum
101 | from: input.Envelope.Body.CheckResponseElement.CheckNum
102 | - set: output.CheckType
103 | from: input.Envelope.Body.CheckResponseElement.CheckType
104 | - set: output.PayorAccountID
105 | from: input.Envelope.Body.CheckResponseElement.PayorAccountID
106 | - set: output.Payee
107 | from: input.Envelope.Body.CheckResponseElement.Payee
108 | - set: output.Amount
109 | from: input.Envelope.Body.CheckResponseElement.Amount
110 | version: 1.0.0
111 | phase: realized
112 | targets:
113 | SomeBankService:
114 | swagger: '2.0'
115 | info:
116 | title: SomeBankService
117 | description: ''
118 | x-ibm-name: somebankservice
119 | version: 1.0.0
120 | schemes:
121 | - https
122 | basePath: /SomeBankService
123 | produces:
124 | - application/xml
125 | consumes:
126 | - text/xml
127 | securityDefinitions:
128 | clientID:
129 | type: apiKey
130 | name: X-IBM-Client-Id
131 | in: header
132 | description: ''
133 | security:
134 | - clientID: []
135 | x-ibm-configuration:
136 | type: wsdl
137 | wsdl-definition:
138 | wsdl: 58c0561ce4b0e13332d3782e
139 | service: SomeBankService
140 | port: SomeBankPort
141 | soap-version: '1.1'
142 | assembly:
143 | execute:
144 | - proxy:
145 | title: proxy
146 | target-url: 'http://9.33.70.26:22068/SomeBank/services/checking'
147 | gateway: datapower-gateway
148 | enforced: true
149 | testable: true
150 | phase: realized
151 | cors:
152 | enabled: true
153 | paths:
154 | /accountEnquiry:
155 | post:
156 | summary: Operation accountEnquiry
157 | description: ''
158 | operationId: accountEnquiry
159 | x-ibm-soap:
160 | soap-action: ''
161 | soap-operation: '{http://somebank.com}AccountRequestElement'
162 | parameters:
163 | - in: body
164 | name: body
165 | required: true
166 | schema:
167 | $ref: >-
168 | #/x-ibm-configuration/targets/SomeBankService/definitions/accountEnquiryInput
169 | responses:
170 | default:
171 | description: ''
172 | schema:
173 | $ref: >-
174 | #/x-ibm-configuration/targets/SomeBankService/definitions/accountEnquiryOutput
175 | /checkRequest:
176 | post:
177 | summary: Operation checkRequest
178 | description: ''
179 | operationId: checkRequest
180 | x-ibm-soap:
181 | soap-action: ''
182 | soap-operation: '{http://somebank.com}CheckRequestElement'
183 | parameters:
184 | - in: body
185 | name: body
186 | required: true
187 | schema:
188 | $ref: >-
189 | #/x-ibm-configuration/targets/SomeBankService/definitions/checkRequestInput
190 | responses:
191 | default:
192 | description: ''
193 | schema:
194 | $ref: >-
195 | #/x-ibm-configuration/targets/SomeBankService/definitions/checkRequestOutput
196 | definitions:
197 | Security:
198 | xml:
199 | namespace: >-
200 | http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
201 | prefix: wsse
202 | type: object
203 | properties:
204 | UsernameToken:
205 | type: object
206 | properties:
207 | Username:
208 | type: string
209 | Password:
210 | type: string
211 | accountEnquiryInput:
212 | type: object
213 | properties:
214 | Envelope:
215 | xml:
216 | prefix: soap-env
217 | namespace: 'http://schemas.xmlsoap.org/soap/envelope/'
218 | type: object
219 | properties:
220 | Header:
221 | $ref: >-
222 | #/x-ibm-configuration/targets/SomeBankService/definitions/accountEnquiryHeader
223 | Body:
224 | type: object
225 | properties:
226 | AccountRequestElement:
227 | $ref: >-
228 | #/x-ibm-configuration/targets/SomeBankService/definitions/AccountRequestElement_bank
229 | example: >-
230 |
231 |
233 |
234 |
235 |
236 | string
237 | string
238 |
239 |
240 |
241 |
242 |
243 | string
244 | string
245 | string
246 |
247 |
248 |
249 | accountEnquiryHeader:
250 | type: object
251 | properties:
252 | Security:
253 | $ref: >-
254 | #/x-ibm-configuration/targets/SomeBankService/definitions/Security
255 | accountEnquiryOutput:
256 | type: object
257 | properties:
258 | Envelope:
259 | xml:
260 | prefix: soap-env
261 | namespace: 'http://schemas.xmlsoap.org/soap/envelope/'
262 | type: object
263 | properties:
264 | Body:
265 | type: object
266 | properties:
267 | AccountResponseElement:
268 | $ref: >-
269 | #/x-ibm-configuration/targets/SomeBankService/definitions/AccountResponseElement_bank
270 | example: >-
271 |
272 |
274 |
275 |
276 | 3.14
277 |
278 |
279 |
280 | checkRequestInput:
281 | type: object
282 | properties:
283 | Envelope:
284 | xml:
285 | prefix: soap-env
286 | namespace: 'http://schemas.xmlsoap.org/soap/envelope/'
287 | type: object
288 | properties:
289 | Header:
290 | $ref: >-
291 | #/x-ibm-configuration/targets/SomeBankService/definitions/checkRequestHeader
292 | Body:
293 | type: object
294 | properties:
295 | CheckRequestElement:
296 | $ref: >-
297 | #/x-ibm-configuration/targets/SomeBankService/definitions/CheckRequestElement_bank
298 | example: >-
299 |
300 |
302 |
303 |
304 |
305 | string
306 | string
307 |
308 |
309 |
310 |
311 |
312 | string
313 | string
314 | string
315 | string
316 | string
317 | string
318 | 3.14
319 |
320 |
321 |
322 | checkRequestHeader:
323 | type: object
324 | properties:
325 | Security:
326 | $ref: >-
327 | #/x-ibm-configuration/targets/SomeBankService/definitions/Security
328 | checkRequestOutput:
329 | type: object
330 | properties:
331 | Envelope:
332 | xml:
333 | prefix: soap-env
334 | namespace: 'http://schemas.xmlsoap.org/soap/envelope/'
335 | type: object
336 | properties:
337 | Body:
338 | type: object
339 | properties:
340 | CheckResponseElement:
341 | $ref: >-
342 | #/x-ibm-configuration/targets/SomeBankService/definitions/CheckResponseElement_bank
343 | example: >-
344 |
345 |
347 |
348 |
349 | 3
350 | 3
351 | string
352 | string
353 | string
354 | 3.14
355 |
356 |
357 |
358 | AccountRequestElement_bank:
359 | xml:
360 | namespace: 'http://somebank.com'
361 | prefix: bank
362 | type: object
363 | properties:
364 | accountName:
365 | type: string
366 | accountID:
367 | type: string
368 | accountType:
369 | type: string
370 | required:
371 | - accountName
372 | - accountID
373 | - accountType
374 | example: |-
375 |
376 |
377 | string
378 | string
379 | string
380 |
381 | AccountResponseElement_bank:
382 | xml:
383 | namespace: 'http://somebank.com'
384 | prefix: bank
385 | type: object
386 | properties:
387 | balance:
388 | type: number
389 | format: float
390 | required:
391 | - balance
392 | example: |-
393 |
394 |
395 | 3.14
396 |
397 | CheckRequestElement_bank:
398 | xml:
399 | namespace: 'http://somebank.com'
400 | prefix: bank
401 | type: object
402 | properties:
403 | PayorAccountName:
404 | type: string
405 | PayorAccountID:
406 | type: string
407 | CheckType:
408 | type: string
409 | Payee:
410 | type: string
411 | PayeeAddr:
412 | type: string
413 | PayeeRouteNo:
414 | type: string
415 | Amount:
416 | type: number
417 | format: float
418 | required:
419 | - PayorAccountName
420 | - PayorAccountID
421 | - CheckType
422 | - Payee
423 | - Amount
424 | example: |-
425 |
426 |
427 | string
428 | string
429 | string
430 | string
431 | string
432 | string
433 | 3.14
434 |
435 | CheckResponseElement_bank:
436 | xml:
437 | namespace: 'http://somebank.com'
438 | prefix: bank
439 | type: object
440 | properties:
441 | TransactionNum:
442 | type: integer
443 | format: int32
444 | CheckNum:
445 | type: integer
446 | format: int32
447 | CheckType:
448 | type: string
449 | PayorAccountID:
450 | type: string
451 | Payee:
452 | type: string
453 | Amount:
454 | type: number
455 | format: float
456 | required:
457 | - TransactionNum
458 | - CheckNum
459 | - CheckType
460 | - PayorAccountID
461 | - Payee
462 | - Amount
463 | example: |-
464 |
465 |
466 | 3
467 | 3
468 | string
469 | string
470 | string
471 | 3.14
472 |
473 | gateway: datapower-gateway
474 | paths:
475 | /checkRequest:
476 | post:
477 | responses:
478 | '200':
479 | description: 200 OK
480 | parameters:
481 | - name: body
482 | required: true
483 | in: body
484 | schema:
485 | type: object
486 | definitions:
487 | JSONCheckResponse:
488 | properties:
489 | TransactionNum:
490 | type: string
491 | CheckNum:
492 | type: string
493 | CheckType:
494 | type: string
495 | PayorAccountID:
496 | type: string
497 | Payee:
498 | type: string
499 | Amount:
500 | type: integer
501 | format: int32
502 | additionalProperties: false
503 | JSONCheckRequest:
504 | description: ''
505 | type: object
506 | properties:
507 | PayorAccountName:
508 | type: string
509 | PayorAccountID:
510 | type: string
511 | CheckType:
512 | type: string
513 | Payee:
514 | type: string
515 | PayeeAddr:
516 | type: string
517 | PayeeRouteNo:
518 | type: string
519 | Amount:
520 | type: number
521 | example: "{\"CheckRequestElement\":\r{\"PayorAccountName\":\"Cartoon Studios\", \"PayorAccountID\":\"8458jf8757275234\",\r\"CheckType\":\"P\",\r\"Payee\":\"Elmer Funn\",\r\"PayeeAddr\":\"124 East Sunset Drive; Sunset, AL 64846\", \"PayeeRouteNo\":\"03849032874908\",\r\"Amount\":999}\r}"
522 | tags: []
523 |
--------------------------------------------------------------------------------
/IC17-7502-DataPower-APIConnect-Toolkit/lab2/JWTAPI.yaml:
--------------------------------------------------------------------------------
1 | swagger: '2.0'
2 | info:
3 | version: 1.0.0
4 | title: jwtAPI
5 | x-ibm-name: jwtapi
6 | host: $(catalog.host)
7 | basePath: /
8 | paths:
9 | /validate-jwt:
10 | get:
11 | responses:
12 | '200':
13 | description: 200 OK
14 | parameters:
15 | - name: Authorization
16 | type: string
17 | required: true
18 | in: header
19 | description: 'Bearer '
20 | /generate-jwt:
21 | get:
22 | responses:
23 | '200':
24 | description: 200 OK
25 | parameters:
26 | - name: iss-claim
27 | type: string
28 | required: true
29 | in: header
30 | description: Issuer claim
31 | - name: aud-claim
32 | type: string
33 | required: true
34 | in: header
35 | description: Audience claim
36 | securityDefinitions: {}
37 | security: []
38 | x-ibm-configuration:
39 | assembly:
40 | execute:
41 | - switch:
42 | title: switch
43 | case:
44 | - condition: "((request.verb==='GET')&&(api.operation.path==='/generate-jwt'))"
45 | execute:
46 | - jwt-generate:
47 | title: jwt-generate
48 | jwt: generated-jwt
49 | exp-claim: 36000
50 | version: 1.0.0
51 | jwe-enc: A128CBC-HS256
52 | jwe-alg: A256KW
53 | jws-alg: HS256
54 | jti-claim: false
55 | jws-jwk: hs256-key
56 | iss-claim: request.headers.iss-claim
57 | sub-claim: ''
58 | aud-claim: request.headers.aud-claim
59 | - gatewayscript:
60 | title: gatewayscript
61 | source: "apim.setvariable('message.body',apim.getvariable('generated-jwt')); \n"
62 | - condition: "request.authorization.indexOf(\"Bearer\") > -1 && request.verb==='GET'&& api.operation.path==='/validate-jwt'"
63 | execute:
64 | - gatewayscript:
65 | title: gatewayscript
66 | source: |-
67 | var authNode = apim.getvariable('request.headers.authorization');
68 |
69 | apim.setvariable('input-jwt', authNode.replace(/^Bearer /g, ''));
70 | - jwt-validate:
71 | title: jwt-validate
72 | jwt: input-jwt
73 | output-claims: decoded-claims
74 | version: 1.0.0
75 | iss-claim: apic
76 | aud-claim: id1
77 | description: ''
78 | jws-jwk: hs256-key
79 | - gatewayscript:
80 | title: gatewayscript
81 | source: "apim.setvariable('message.body',apim.getvariable('decoded-claims')); \n"
82 | - otherwise:
83 | - set-variable:
84 | title: set-variable
85 | actions:
86 | - value: '302'
87 | set: message.status.code
88 | - set: message.status.reason
89 | value: Found
90 | - set: message.headers.Location
91 | value: 'https://myidp.ibm.com'
92 | catch:
93 | - errors:
94 | - RuntimeError
95 | execute:
96 | - set-variable:
97 | title: set-variable
98 | actions:
99 | - value: '400'
100 | set: message.status.code
101 | - set: message.status.reason
102 | value: Bad request
103 | - gatewayscript:
104 | title: gatewayscript
105 | source: "apim.setvariable('message.body',apim.getvariable('jwt-validate.error-message')); \n"
106 | enforced: true
107 | testable: true
108 | phase: realized
109 | cors:
110 | enabled: true
111 | gateway: datapower-gateway
112 | properties:
113 | hs256-key:
114 | value: eyAiYWxnIjogIkhTMjU2IiwgICAia3R5IjogIm9jdCIsICAgInVzZSI6ICJzaWciLCAgICJrIjogIm81eUVyTGFFLWRiZ1ZwU3c2NVJxNTdPQTlkSHlhRjY2UV9FdDVhelBhLVhVamJ5UDB3OWlSV2hSNGtydTA5YUZmUUxYZUlPRElONHVoakVsWUtYdDhuNzZqdDBQamtkMnBxazR0OWFiUkY2dG5MMTlHVjRwZmxmTDZ1dlZLa1A0d2VPaDM5dHFIdDRUbWtCZ0YyUC1nRmhnc3NacGp3cTZsODJmejNkVWhRMm5rem9MQV9DbnlER0xaTGQ3U1oxeXY3M3V6ZkUyT3Q4MTN6bWlnOEtUTUVNV1ZjV1NEdnk2MUYwNnZzXzZMVVJjcV9JRUVldlVpdWJCeEc1UzJha05uV2lnZnBiaFdZak1JNU0yMkZPQ3BkY0RCdDRMN0sxLXlIdDk1U2l6MFFVYjBNTmxUX1g4Rjc2d0g3X0EzN0dwS0tKR3FlYWlOV21Ia2dXZEU4UVdEUSIsICAgImtpZCI6ICJoczI1Ni1rZXkiIH0=
115 | description: ''
116 | encoded: true
117 | schemes:
118 | - https
119 | consumes:
120 | - application/json
121 | - application/xml
122 | produces:
123 | - application/xml
124 | - application/json
125 |
--------------------------------------------------------------------------------
/IC17-7502-DataPower-APIConnect-Toolkit/lab2/lab2_1.0.0.yaml:
--------------------------------------------------------------------------------
1 | product: 1.0.0
2 | info:
3 | name: lab2
4 | title: lab2
5 | version: 1.0.0
6 | visibility:
7 | view:
8 | type: public
9 | subscribe:
10 | type: authenticated
11 | plans:
12 | default:
13 | title: Default Plan
14 | description: Default Plan
15 | approval: false
16 | rate-limit:
17 | value: 100/hour
18 | hard-limit: false
19 | apis:
20 | jwtapi:
21 | $ref: JWTAPI.yaml
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # interconnect-labs
2 |
--------------------------------------------------------------------------------