forked from mosip/mosip-onboarding
-
Notifications
You must be signed in to change notification settings - Fork 1
/
run-onboarding.sh
executable file
·428 lines (386 loc) · 27.9 KB
/
run-onboarding.sh
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
#!/usr/bin/env bash
PROP_FILE=./onboarding.properties
function prop {
grep "${1}=" ${PROP_FILE}|cut -d'=' -f2
}
mkdir -p $(prop 'report_dir') $(prop 'tmp_dir')
mydir="$(pwd)"
echo $mydir
env_temp_file=$(prop 'tmp_dir')
#get date
function update_props() {
date=$(date --utc +%FT%T.%3NZ)
env_url=$(prop 'env-url')
keycloak_url=$(prop 'keycloak-url')
keycloak_admin_username=$(prop 'keycloak-admin-username')
keycloak_admin_password=$(prop 'keycloak-admin-password')
partner_kc_username=$(prop 'partner-kc-username')
partner_kc_userpassword=$(prop 'partner-kc-userpassword')
partner_kc_user_firstname=$(prop 'partner-kc-user-firstname')
partner_kc_user_lastname=$(prop 'partner-kc-user-lastname')
partner_kc_user_email=$(prop 'partner-kc-user-email')
partner_org_name=$(prop 'partner-org-name')
partner_kc_user_role=$(prop 'partner-kc-user-role')
partner_manager_username=$(prop 'partner-manager-username')
partner_manager_password=$(prop 'partner-manager-password')
application_id=$(prop 'application-id')
policy_group_name=$(prop 'policy-group-name')
policy_name=$(prop 'policy-name')
policy_type=$(prop 'policy-type')
partner_type=$(prop 'partner-type')
partner_address=$(prop 'partner-address')
partner_contact=$(prop 'partner-contact')
partner_domain=$(prop 'partner-domain')
credential_type=$(prop 'credential-type')
cert_manager_username=$(prop 'cert-manager-username')
cert_manager_password=$(prop 'cert-manager-password')
root_cert_path="$mydir/certs/$partner_kc_username/root-ca.pem"
client_cert_path="$mydir/certs/$partner_kc_username/client.pem"
#
echo "Copying properties to env variables."$'\n'
jq '.values |= map(if .key=="request-time" then (.value="'$date'") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="url" then (.value="'$env_url'") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="keycloak-url" then (.value="'$keycloak_url'") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="keycloak-admin-username" then (.value="'$keycloak_admin_username'") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="keycloak-admin-password" then (.value="'$keycloak_admin_password'") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="partner-kc-username" then (.value="'$partner_kc_username'") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="partner-kc-user-firstname" then (.value="'$partner_kc_user_firstname'") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="partner-kc-user-lastname" then (.value="'$partner_kc_user_lastname'") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="partner-kc-user-email" then (.value="'$partner_kc_user_email'") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="partner-organization-name" then (.value="'$partner_org_name'") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="partner-kc-userpassword" then (.value="'$partner_kc_userpassword'") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="partner-kc-user-role" then (.value="'$partner_kc_user_role'") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="partner-manager-username" then (.value="'$partner_manager_username'") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="partner-manager-password" then (.value="'$partner_manager_password'") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="application-id" then (.value="'$application_id'") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="policy-group-name" then (.value="'$policy_group_name'") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="policy-name" then (.value="'$policy_name'") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="policy-type" then (.value="'$policy_type'") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="partner-type" then (.value="'$partner_type'") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="partner-address" then (.value="'$partner_address'") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="partner-contact" then (.value="'$partner_contact'") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="partner-domain" then (.value="'$partner_domain'") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="credential-type" then (.value="'$credential_type'") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="cert-manager-username" then (.value="'$cert_manager_username'") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="cert-manager-password" then (.value="'$cert_manager_password'") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
echo "Completed copying properties"$'\n'
}
function create_partner() {
echo -e "\e[31m************Please select option based on your requirement.******************\e[0m \n \
Press 0 : If you want to upload default certificates. \n \
Press 1 : If you want to onboard Auth_Partner domain.\n \
Press 2 : If you want to onboard Credential_Partner domain. \n \
Press 3 : If you want to onboard Misp_Partner domain. \n \
Press 4 : If you want to onboard Device_Provider domain. \n \
Press 5 : If you want to onboard Online_Verification_Partner domain. \n \
Press 6 : If you want to onboard Manual_Adjudication domain. \n \
Press 7 : If you want to onboard FTM_Provider domain. \n \
Press 8 : If you want to onboard ABIS_Partner domain. \n \
Press 9 : If you want to onboard Print_Partner domain. \n \
Press 10 : If you want to connect with MOSIP Team. \n"
read -p 'Enter Choice: ' choice
if [[ -z "${choice}" ]]; then
echo "\e[31m Input cannot be blank please try again.\e[0m \n"
exit 0
else
if ! [[ "${choice}" =~ ^[+-]?[0-9]+\.?[0-9]*$ ]]; then
echo "\e[31m Input must be a numbers.\e[0m \n"
exit 1
fi
fi
case ${choice} in
0)
update_props
echo "upload default certs" $'\n'
echo "uploading root cert" $'\n'
jq '.values |= map(if .key=="cert-application-id" then (.value="ROOT") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="cert-reference-id" then (.value="") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
newman run onboarding.postman_collection.json --delay-request 2000 -e onboarding.postman_environment.json --export-environment $env_temp_file/onboarding.postman_environment.json \
--folder authenticate-to-download-certs \
--folder download-ida-certificate \
--folder upload-ca-certificate \
-r htmlextra --reporter-htmlextra-export $(prop 'report_dir')/IDA-Root.html
rm $env_temp_file/*
echo "uploading ida cert" $'\n'
jq '.values |= map(if .key=="cert-application-id" then (.value="IDA") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="cert-reference-id" then (.value="NULL") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
newman run onboarding.postman_collection.json --delay-request 2000 -e onboarding.postman_environment.json --export-environment $env_temp_file/onboarding.postman_environment.json \
--folder authenticate-to-download-certs \
--folder download-ida-certificate \
--folder upload-ca-certificate \
-r htmlextra --reporter-htmlextra-export $(prop 'report_dir')/IDA-CA.html
rm $env_temp_file/*
echo "uploading mpartner default auth cert" $'\n'
jq '.values |= map(if .key=="cert-application-id" then (.value="IDA") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="cert-reference-id" then (.value="mpartner-default-auth") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="partner-kc-username" then (.value="mpartner-default-auth") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
newman run onboarding.postman_collection.json --delay-request 2000 -e onboarding.postman_environment.json --export-environment $env_temp_file/onboarding.postman_environment.json \
--folder authenticate-to-download-certs \
--folder download-ida-certificate \
--folder upload-leaf-certificate \
--folder upload-signed-leaf-certificate \
-r htmlextra --reporter-htmlextra-export $(prop 'report_dir')/mpartner-default-auth.html
rm $env_temp_file/*
echo "uploading ida cred cert" $'\n'
jq '.values |= map(if .key=="cert-application-id" then (.value="IDA") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="cert-reference-id" then (.value="CRED_SERVICE") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
newman run onboarding.postman_collection.json --delay-request 2000 -e onboarding.postman_environment.json --export-environment $env_temp_file/onboarding.postman_environment.json \
--folder authenticate-to-download-certs \
--folder download-ida-certificate \
-r htmlextra --reporter-htmlextra-export $(prop 'report_dir')/cred-service.html
jq '.values |= map(if .key=="cert-reference-id" then (.value="PUBLIC_KEY") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
newman run onboarding.postman_collection.json --delay-request 2000 -e onboarding.postman_environment.json --export-environment $env_temp_file/onboarding.postman_environment.json \
--folder authenticate-to-download-certs \
--folder upload-other-domain-certificate-to-keymanager \
-r htmlextra --reporter-htmlextra-export $(prop 'report_dir')/public-key.html
rm $env_temp_file/*
echo "uploading mpartner default resident cert" $'\n'
jq '.values |= map(if .key=="cert-application-id" then (.value="RESIDENT") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="cert-reference-id" then (.value="mpartner-default-resident") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="partner-kc-username" then (.value="mpartner-default-resident") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
newman run onboarding.postman_collection.json --delay-request 2000 -e onboarding.postman_environment.json --export-environment $env_temp_file/onboarding.postman_environment.json \
--folder authenticate-to-download-certs \
--folder download-ca-certificate-from-keymanager \
--folder download-leaf-certificate-from-keymanager \
--folder upload-ca-certificate \
--folder upload-leaf-certificate \
--folder upload-signed-leaf-certifcate-to-keymanager \
-r htmlextra --reporter-htmlextra-export $(prop 'report_dir')/mapartner-default-resident.html
rm $env_temp_file/*
echo "uploading mpartner default print cert" $'\n'
root_cert_path="$mydir/certs/print/root-ca.pem"
client_cert_path="$mydir/certs/print/client.pem"
RootCACert=$(awk 'NF {sub(/\r/, ""); printf "%s\\r\\n",$0;}' $root_cert_path)
PartnerCert=$(awk 'NF {sub(/\r/, ""); printf "%s\\r\\n",$0;}' $client_cert_path)
jq '.values |= map(if .key=="partner-kc-username" then (.value="mpartner-default-print") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
newman run onboarding.postman_collection.json --delay-request 2000 -e onboarding.postman_environment.json --export-environment $env_temp_file/onboarding.postman_environment.json \
--folder authenticate-to-download-certs \
--env-var ca-certificate="$RootCACert" \
--env-var leaf-certificate="$PartnerCert" \
--folder upload-ca-certificate \
--folder upload-leaf-certificate \
-r htmlextra --reporter-htmlextra-export $(prop 'report_dir')/mapartner-default-print.html
rm $env_temp_file/*
echo "uploading mpartner default abis cert" $'\n'
root_cert_path="$mydir/certs/abis/root-ca.pem"
client_cert_path="$mydir/certs/abis/client.pem"
RootCACert=$(awk 'NF {sub(/\r/, ""); printf "%s\\r\\n",$0;}' $root_cert_path)
PartnerCert=$(awk 'NF {sub(/\r/, ""); printf "%s\\r\\n",$0;}' $client_cert_path)
jq '.values |= map(if .key=="partner-kc-username" then (.value="mpartner-default-abis") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
newman run onboarding.postman_collection.json --delay-request 2000 -e onboarding.postman_environment.json --export-environment $env_temp_file/onboarding.postman_environment.json \
--folder authenticate-to-download-certs \
--env-var ca-certificate="$RootCACert" \
--env-var leaf-certificate="$PartnerCert" \
--folder upload-ca-certificate \
--folder upload-leaf-certificate \
-r htmlextra --reporter-htmlextra-export $(prop 'report_dir')/mapartner-default-abis.html
rm $env_temp_file/*
;;
1)
update_props
bash $mydir/certs/create-signing-certs.sh $mydir
RootCACert=$(awk 'NF {sub(/\r/, ""); printf "%s\\r\\n",$0;}' $root_cert_path)
PartnerCert=$(awk 'NF {sub(/\r/, ""); printf "%s\\r\\n",$0;}' $client_cert_path)
echo "Starting Auth Partner Creation" $'\n'
newman run onboarding.postman_collection.json --delay-request 2000 -e onboarding.postman_environment.json --export-environment $env_temp_file/onboarding.postman_environment.json \
--folder 'create_keycloak_user' \
--folder 'create/publish_policy_group_and_policy' \
--folder 'partner_self_registration' \
--folder authenticate-to-upload-certs \
--env-var ca-certificate="$RootCACert" \
--env-var leaf-certificate="$PartnerCert" \
--folder upload-ca-certificate \
--folder upload-leaf-certificate \
--folder 'partner_request_for_mapping_partner_to_policy' \
--folder authenticate-as-partner-manager \
--folder approve-partner-mapping-to-policy \
--folder 'request_for_partner_api_key' \
-d default-auth-policy.json -r htmlextra --reporter-htmlextra-export $(prop 'report_dir')/$partner_kc_username.html
rm $env_temp_file/*
;;
2)
update_props
bash $mydir/certs/create-signing-certs.sh $mydir
RootCACert=$(awk 'NF {sub(/\r/, ""); printf "%s\\r\\n",$0;}' $root_cert_path)
PartnerCert=$(awk 'NF {sub(/\r/, ""); printf "%s\\r\\n",$0;}' $client_cert_path)
echo "Starting Credential Partner Creation" $'\n'
newman run onboarding.postman_collection.json --delay-request 2000 -e onboarding.postman_environment.json --export-environment $env_temp_file/onboarding.postman_environment.json \
--folder 'create_keycloak_user' \
--folder 'create/publish_policy_group_and_policy' \
--folder 'partner_self_registration' \
--folder authenticate-to-upload-certs \
--env-var ca-certificate="$RootCACert" \
--env-var leaf-certificate="$PartnerCert" \
--folder upload-ca-certificate \
--folder upload-leaf-certificate \
--folder 'partner_request_for_mapping_partner_to_policy' \
--folder authenticate-as-partner-manager \
--folder mapping-partner-to-policy-credential-type \
--folder adding-bioextractors-for-partner \
-d default-datashare-policy.json -r htmlextra --reporter-htmlextra-export $(prop 'report_dir')/$partner_kc_username.html
rm $env_temp_file/*
;;
3)
update_props
bash $mydir/certs/create-signing-certs.sh $mydir
RootCACert=$(awk 'NF {sub(/\r/, ""); printf "%s\\r\\n",$0;}' $root_cert_path)
PartnerCert=$(awk 'NF {sub(/\r/, ""); printf "%s\\r\\n",$0;}' $client_cert_path)
echo "Starting MISP Partner Creation" $'\n'
newman run onboarding.postman_collection.json --delay-request 2000 -e onboarding.postman_environment.json --export-environment $env_temp_file/onboarding.postman_environment.json \
--folder 'create_keycloak_user' \
--folder 'partner_self_registration' \
--folder authenticate-to-upload-certs \
--env-var ca-certificate="$RootCACert" \
--env-var leaf-certificate="$PartnerCert" \
--folder upload-ca-certificate \
--folder upload-leaf-certificate \
--folder create-the-MISP-license-key-for-partner \
-r htmlextra --reporter-htmlextra-export $(prop 'report_dir')/$partner_kc_username.html
rm $env_temp_file/*
;;
4)
update_props
bash $mydir/certs/create-signing-certs.sh $mydir
RootCACert=$(awk 'NF {sub(/\r/, ""); printf "%s\\r\\n",$0;}' $root_cert_path)
PartnerCert=$(awk 'NF {sub(/\r/, ""); printf "%s\\r\\n",$0;}' $client_cert_path)
echo "Starting Device Provider Partner Creation" $'\n'
newman run onboarding.postman_collection.json --delay-request 2000 -e onboarding.postman_environment.json --export-environment $env_temp_file/onboarding.postman_environment.json \
--folder 'create_keycloak_user' \
--folder 'partner_self_registration' \
--folder authenticate-to-upload-certs \
--env-var ca-certificate="$RootCACert" \
--env-var leaf-certificate="$PartnerCert" \
--folder upload-ca-certificate \
--folder upload-leaf-certificate \
-r htmlextra --reporter-htmlextra-export $(prop 'report_dir')/$partner_kc_username.html
rm $env_temp_file/*
;;
5)
update_props
echo "Starting online-verification-partner creation" $'\n'
jq '.values |= map(if .key=="cert-application-id" then (.value="IDA") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
jq '.values |= map(if .key=="cert-reference-id" then (.value="'$partner_kc_username'") else . end)' onboarding.postman_environment.json > $(prop 'tmp_dir')/tmp.json && mv $(prop 'tmp_dir')/tmp.json onboarding.postman_environment.json
newman run onboarding.postman_collection.json --delay-request 2000 -e onboarding.postman_environment.json --export-environment $env_temp_file/onboarding.postman_environment.json \
--folder 'create_keycloak_user' \
--folder 'create/publish_policy_group_and_policy' \
--folder 'partner_self_registration' \
--folder authenticate-to-download-certs \
--folder download-ida-certificate \
--folder upload-leaf-certificate \
--folder upload-signed-leaf-certificate \
--folder 'partner_request_for_mapping_partner_to_policy' \
--folder authenticate-as-partner-manager \
--folder adding-bioextractors-for-partner \
--folder approve-partner-mapping-to-policy \
--folder 'request_for_partner_api_key' \
-d default-datashare-policy.json -r htmlextra --reporter-htmlextra-export $(prop 'report_dir')/$partner_kc_username.html
rm $env_temp_file/*
;;
6)
update_props
bash $mydir/certs/create-signing-certs.sh $mydir
RootCACert=$(awk 'NF {sub(/\r/, ""); printf "%s\\r\\n",$0;}' $root_cert_path)
PartnerCert=$(awk 'NF {sub(/\r/, ""); printf "%s\\r\\n",$0;}' $client_cert_path)
echo "Starting Manual_Adjudication partner Creation" $'\n'
newman run onboarding.postman_collection.json --delay-request 2000 -e onboarding.postman_environment.json --export-environment $env_temp_file/onboarding.postman_environment.json \
--folder 'create_keycloak_user' \
--folder 'create/publish_policy_group_and_policy' \
--folder 'partner_self_registration' \
--folder authenticate-to-upload-certs \
--env-var ca-certificate="$RootCACert" \
--env-var leaf-certificate="$PartnerCert" \
--folder upload-ca-certificate \
--folder upload-leaf-certificate \
--folder 'partner_request_for_mapping_partner_to_policy' \
--folder authenticate-as-partner-manager \
--folder approve-partner-mapping-to-policy \
--folder 'request_for_partner_api_key' \
-d default-datashare-policy.json -r htmlextra --reporter-htmlextra-export $(prop 'report_dir')/$partner_kc_username.html
rm $env_temp_file/*
;;
7)update_props
bash $mydir/certs/create-signing-certs.sh $mydir
RootCACert=$(awk 'NF {sub(/\r/, ""); printf "%s\\r\\n",$0;}' $root_cert_path)
PartnerCert=$(awk 'NF {sub(/\r/, ""); printf "%s\\r\\n",$0;}' $client_cert_path)
echo "Starting FTM_Provider Partner Creation" $'\n'
newman run onboarding.postman_collection.json --delay-request 2000 -e onboarding.postman_environment.json --export-environment $env_temp_file/onboarding.postman_environment.json \
--folder 'create_keycloak_user' \
--folder 'partner_self_registration' \
--folder authenticate-to-upload-certs \
--env-var ca-certificate="$RootCACert" \
--env-var leaf-certificate="$PartnerCert" \
--folder upload-ca-certificate \
--folder upload-leaf-certificate \
-r htmlextra --reporter-htmlextra-export $(prop 'report_dir')/$partner_kc_username.html
rm $env_temp_file/*
;;
8)
update_props
bash $mydir/certs/create-signing-certs.sh $mydir
RootCACert=$(awk 'NF {sub(/\r/, ""); printf "%s\\r\\n",$0;}' $root_cert_path)
PartnerCert=$(awk 'NF {sub(/\r/, ""); printf "%s\\r\\n",$0;}' $client_cert_path)
echo "Starting ABIS_Partner Creation" $'\n'
newman run onboarding.postman_collection.json --delay-request 2000 -e onboarding.postman_environment.json --export-environment $env_temp_file/onboarding.postman_environment.json \
--folder 'create_keycloak_user' \
--folder 'create/publish_policy_group_and_policy' \
--folder 'partner_self_registration' \
--folder authenticate-to-upload-certs \
--env-var ca-certificate="$RootCACert" \
--env-var leaf-certificate="$PartnerCert" \
--folder upload-ca-certificate \
--folder upload-leaf-certificate \
--folder 'partner_request_for_mapping_partner_to_policy' \
--folder authenticate-as-partner-manager \
--folder adding-bioextractors-for-partner \
-d default-datashare-policy.json -r htmlextra --reporter-htmlextra-export $(prop 'report_dir')/$partner_kc_username.html
rm $env_temp_file/*
;;
9)
update_props
bash $mydir/certs/create-signing-certs.sh $mydir
RootCACert=$(awk 'NF {sub(/\r/, ""); printf "%s\\r\\n",$0;}' $root_cert_path)
PartnerCert=$(awk 'NF {sub(/\r/, ""); printf "%s\\r\\n",$0;}' $client_cert_path)
echo "Starting Print_Partner Creation" $'\n'
newman run onboarding.postman_collection.json --delay-request 2000 -e onboarding.postman_environment.json --export-environment $env_temp_file/onboarding.postman_environment.json \
--folder 'create_keycloak_user' \
--folder 'create/publish_policy_group_and_policy' \
--folder 'partner_self_registration' \
--folder authenticate-to-upload-certs \
--env-var ca-certificate="$RootCACert" \
--env-var leaf-certificate="$PartnerCert" \
--folder upload-ca-certificate \
--folder upload-leaf-certificate \
--folder 'partner_request_for_mapping_partner_to_policy' \
--folder authenticate-as-partner-manager \
--folder mapping-partner-to-policy-credential-type \
--folder adding-bioextractors-for-partner \
-d default-datashare-policy.json -r htmlextra --reporter-htmlextra-export $(prop 'report_dir')/$partner_kc_username.html
rm $env_temp_file/*
;;
10)
echo -e "\e[31m\e[1m\e[5m**Please email on below email id. \e[25m\e[21m We will revert back to you with the solution.\e[0m \n"
echo "[email protected]"
echo "Thanks for connecting with us. !!!Have a Good day"
;;
esac
echo "Your partner registered successfully. Please check the report for any issue"$'\n'
read -p $'Do you want to register any other partner? (y/n): ' want
if [[ ("$want" = "Y") || ("$want" = "y") ]]; then
echo "Okay. Please change the properties for new partner and select the appropriate option"$'\n'
read -rsn1 -p $"Have you updated properties for partner. Press any key to continue or Ctrl+C to stop."$'\n'
create_partner
else
echo "Thank you for registering with MOSIP"$'\n'
exit
fi
}
echo -e "\e[31m\e[1m\e[5m**NOTE: \e[25m\e[21m This script is used to on-board different partners type available in MOSIP. You will be asked to provide few inputs initialy please accept accordingly.\e[0m \n"
read -p $"Do you agree to install newman and its libraries? Please read docs in case of any issue. Press (y/n): "$'\n' agree
if [[ ("$agree" = "Y") || ("$agree" = "y") ]]; then
npm install -g newman -y
npm install -g newman-reporter-htmlextra -y
else
echo "Skipping installation. Please check requirement"$'\n'
fi
read -rsn1 -p $"Please make sure that you set the properties carefully. Press any key to continue or Ctrl+C to stop."$'\n'
create_partner