ruby_aem 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2603c82cd2ec0808f1153a92230a2c228b5d6fa9
4
- data.tar.gz: 9edf06b032769cb9378bed54e68006e50dd23e96
3
+ metadata.gz: cd11af37ca8e9013b07f8ad6aa2b68d9920cbeb4
4
+ data.tar.gz: 95ed3e49a24c45cc43c7859eec883c17fe21240d
5
5
  SHA512:
6
- metadata.gz: 5ef1da3b8e4f6ee8ebb105d9d9c638a66d03071c29dee24b077d195c057104489c1e2a9b1561c2f9115b8a3e4860f9c7ff779127fd2174047885fe581416c3d1
7
- data.tar.gz: 25f03e2d4f9d77b3cb53882da9b1d2f8ed1a2aef6f2952fbdbef7bacdf07b2901c91908df370d8e8e77064dbcf9f21fa533eeaf947baee6c4e706c6d274d2210
6
+ metadata.gz: 274b7be5c5e4672805ba5af13f695c09fd4531533050c8cbcce2601faf2375fc13af8cdd7c4d3ff05bacc6bc9907d351902e0e1584b8c6e071805620a3f1a623
7
+ data.tar.gz: 06a4bea0b79068ac69e207572c9d8a9c30f80b1198c1552dcec35f8a054e738405d29a9e3d6ee97205704afe6e9b42982315e3f03dfe26961bd9beb56f591ede
data/conf/spec.yaml CHANGED
@@ -62,6 +62,120 @@ aem:
62
62
  200:
63
63
  handler: xml_package_list
64
64
  message: 'All packages list retrieved successfully'
65
+ authorizablekeystore:
66
+ responses:
67
+ 404:
68
+ handler: simple_error
69
+ message: 'Authorizable keystore not found'
70
+ actions:
71
+ create:
72
+ api: sling
73
+ operation: postAuthorizableKeystore
74
+ params:
75
+ required:
76
+ intermediate_path: '%{intermediate_path}'
77
+ authorizable_id: '%{authorizable_id}'
78
+ optional:
79
+ new_password: '%{password}'
80
+ re_password: '%{password}'
81
+ operation: createStore
82
+ responses:
83
+ 200:
84
+ handler: simple
85
+ message: 'Authorizable keystore created'
86
+ 201:
87
+ handler: simple
88
+ message: 'Authorizable keystore created'
89
+ change_password:
90
+ api: sling
91
+ operation: postAuthorizableKeystore
92
+ params:
93
+ required:
94
+ intermediate_path: '%{intermediate_path}'
95
+ authorizable_id: '%{authorizable_id}'
96
+ optional:
97
+ current_password: '%{old_password}'
98
+ new_password: '%{new_password}'
99
+ re_password: '%{new_password}'
100
+ responses:
101
+ 200:
102
+ handler: simple
103
+ message: 'Authorizable keystore password successfully changed'
104
+ upload:
105
+ api: sling
106
+ operation: postAuthorizableKeystore
107
+ params:
108
+ required:
109
+ intermediate_path: '%{intermediate_path}'
110
+ authorizable_id: '%{authorizable_id}'
111
+ optional:
112
+ new_alias: '%{new_alias}'
113
+ key_store: __FILE_PLAIN__
114
+ key_store_pass: '%{keystore_password}'
115
+ _alias: '%{private_key_alias}'
116
+ key_password: '%{private_key_password}'
117
+ responses:
118
+ 200:
119
+ handler: simple
120
+ message: 'Authorizable keystore uploaded'
121
+ 201:
122
+ handler: simple
123
+ message: 'Authorizable keystore uploaded'
124
+ download:
125
+ api: sling
126
+ operation: getKeystore
127
+ params:
128
+ required:
129
+ intermediate_path: '%{intermediate_path}'
130
+ authorizable_id: '%{authorizable_id}'
131
+ responses:
132
+ 200:
133
+ handler: file_download
134
+ message: 'Authorizable keystore downloaded to %{file_path}'
135
+ delete:
136
+ api: sling
137
+ operation: postNode
138
+ params:
139
+ required:
140
+ path: '%{intermediate_path}/%{authorizable_id}/keystore'
141
+ name: store.p12
142
+ optional:
143
+ operation: delete
144
+ responses:
145
+ 200:
146
+ handler: simple
147
+ message: 'Authorizable keystore deleted'
148
+ 201:
149
+ handler: simple
150
+ message: 'Authorizable keystore deleted'
151
+ 403:
152
+ handler: simple_error
153
+ message: 'Authorizable keystore not found'
154
+ exists:
155
+ api: sling
156
+ operation: getAuthorizableKeystore
157
+ params:
158
+ required:
159
+ intermediate_path: '%{intermediate_path}'
160
+ authorizable_id: '%{authorizable_id}'
161
+ responses:
162
+ 200:
163
+ handler: json_authorizable_keystore_exists
164
+ message: 'Authorizable keystore exists'
165
+ 404:
166
+ handler: json_authorizable_keystore_exists
167
+ message: 'Authorizable keystore not found'
168
+ info:
169
+ api: sling
170
+ operation: getAuthorizableKeystore
171
+ params:
172
+ required:
173
+ intermediate_path: '%{intermediate_path}'
174
+ authorizable_id: '%{authorizable_id}'
175
+ responses:
176
+ 200:
177
+ handler: simple_body
178
+ message: 'Retrieved authorizable keystore info'
65
179
  bundle:
66
180
  responses:
67
181
  404:
@@ -90,6 +204,91 @@ bundle:
90
204
  200:
91
205
  handler: simple
92
206
  message: 'Bundle %{name} stopped'
207
+ certificate:
208
+ actions:
209
+ import:
210
+ api: sling
211
+ operation: postTruststore
212
+ params:
213
+ optional:
214
+ certificate: __FILE_PLAIN__
215
+ key_store_type: jks
216
+ responses:
217
+ 200:
218
+ handler: simple
219
+ message: 'Certificate imported'
220
+ 201:
221
+ handler: simple
222
+ message: 'Certificate imported'
223
+ delete:
224
+ api: sling
225
+ operation: postTruststore
226
+ params:
227
+ optional:
228
+ remove_alias: '%{cert_alias}'
229
+ responses:
230
+ 200:
231
+ handler: simple
232
+ message: 'Certificate %{serial_number} deleted'
233
+ exists:
234
+ api: sling
235
+ operation: getTruststoreInfo
236
+ params:
237
+ required:
238
+ responses:
239
+ 200:
240
+ handler: json_certificate_exists
241
+ message: 'Certificate exists'
242
+ 404:
243
+ handler: json_certificate_exists
244
+ message: 'Certificate not found'
245
+ certificatechain:
246
+ actions:
247
+ import:
248
+ api: sling
249
+ operation: postAuthorizableKeystore
250
+ params:
251
+ required:
252
+ intermediate_path: '%{keystore_intermediate_path}'
253
+ authorizable_id: '%{keystore_authorizable_id}'
254
+ optional:
255
+ _alias: '%{private_key_alias}'
256
+ cert_chain: __FILE_CERTIFICATE__
257
+ pk: __FILE_PRIVATE_KEY__
258
+ responses:
259
+ 200:
260
+ handler: simple
261
+ message: 'Certificate chain and private key successfully imported'
262
+ 201:
263
+ handler: simple
264
+ message: 'Certificate chain and private key successfully imported'
265
+ delete:
266
+ api: sling
267
+ operation: postAuthorizableKeystore
268
+ params:
269
+ required:
270
+ intermediate_path: '%{keystore_intermediate_path}'
271
+ authorizable_id: '%{keystore_authorizable_id}'
272
+ optional:
273
+ remove_alias: '%{private_key_alias}'
274
+ responses:
275
+ 200:
276
+ handler: simple
277
+ message: 'Certificate chain deleted'
278
+ exists:
279
+ api: sling
280
+ operation: getAuthorizableKeystore
281
+ params:
282
+ required:
283
+ intermediate_path: '%{keystore_intermediate_path}'
284
+ authorizable_id: '%{keystore_authorizable_id}'
285
+ responses:
286
+ 200:
287
+ handler: json_certificate_chain_exists
288
+ message: 'Certificate chain exists'
289
+ 404:
290
+ handler: json_certificate_chain_exists
291
+ message: 'Certificate chain not found'
93
292
  flushagent:
94
293
  responses:
95
294
  404:
@@ -415,7 +614,7 @@ package:
415
614
  version: '%{package_version}'
416
615
  responses:
417
616
  200:
418
- handler: file_download
617
+ handler: package_file_download
419
618
  message: 'Package downloaded to %{file_path}/%{package_name}-%{package_version}.zip'
420
619
  upload:
421
620
  api: crx
@@ -426,7 +625,7 @@ package:
426
625
  cmd: upload
427
626
  optional:
428
627
  force: '%{force}'
429
- package: __FILE__
628
+ package: __FILE_PACKAGE__
430
629
  responses:
431
630
  200:
432
631
  handler: json_package_service
@@ -492,7 +691,6 @@ configproperty:
492
691
  operation: postConfigApacheFelixJettyBasedHttpService
493
692
  params:
494
693
  required:
495
- runmode: '%{run_mode}'
496
694
  optional:
497
695
  - org_apache_felix_https_nio
498
696
  - org_apache_felix_https_nio_type_hint
@@ -504,7 +702,7 @@ configproperty:
504
702
  - org_apache_felix_https_keystore_key_type_hint
505
703
  - org_apache_felix_https_keystore_key_password
506
704
  - org_apache_felix_https_keystore_key_password_type_hint
507
- - org_apache_felix_https_truststore
705
+ - org_apache_felix_https_
508
706
  - org_apache_felix_https_truststore_key_type_hint
509
707
  - org_apache_felix_https_truststore_password
510
708
  - org_apache_felix_https_truststore_password_type_hint
@@ -519,16 +717,15 @@ configproperty:
519
717
  responses:
520
718
  200:
521
719
  handler: simple
522
- message: 'Set %{run_mode} %{config_node_name} config %{type} property %{name}=%{value}'
720
+ message: 'Set %{config_node_name} config %{type} property %{name}=%{value}'
523
721
  201:
524
722
  handler: simple
525
- message: 'Set %{run_mode} %{config_node_name} config %{type} property %{name}=%{value}'
723
+ message: 'Set %{config_node_name} config %{type} property %{name}=%{value}'
526
724
  createapacheslinggetservlet:
527
725
  api: sling
528
726
  operation: postConfigApacheSlingGetServlet
529
727
  params:
530
728
  required:
531
- runmode: '%{run_mode}'
532
729
  optional:
533
730
  - json_maximumresults
534
731
  - json_maximumresults_type_hint
@@ -541,16 +738,15 @@ configproperty:
541
738
  responses:
542
739
  200:
543
740
  handler: simple
544
- message: 'Set %{run_mode} %{config_node_name} config %{type} property %{name}=%{value}'
741
+ message: 'Set %{config_node_name} config %{type} property %{name}=%{value}'
545
742
  201:
546
743
  handler: simple
547
- message: 'Set %{run_mode} %{config_node_name} config %{type} property %{name}=%{value}'
744
+ message: 'Set %{config_node_name} config %{type} property %{name}=%{value}'
548
745
  createapacheslingreferrerfilter:
549
746
  api: sling
550
747
  operation: postConfigApacheSlingReferrerFilter
551
748
  params:
552
749
  required:
553
- runmode: '%{run_mode}'
554
750
  optional:
555
751
  - allow_empty
556
752
  - allow_empty_type_hint
@@ -558,19 +754,20 @@ configproperty:
558
754
  - allow_hosts_type_hint
559
755
  - allow_hosts_regexp
560
756
  - allow_hosts_regexp_type_hint
757
+ - filter_methods
758
+ - filter_methods_type_hint
561
759
  responses:
562
760
  200:
563
761
  handler: simple
564
- message: 'Set %{run_mode} %{config_node_name} config %{type} property %{name}=%{value}'
762
+ message: 'Set %{config_node_name} config %{type} property %{name}=%{value}'
565
763
  201:
566
764
  handler: simple
567
- message: 'Set %{run_mode} %{config_node_name} config %{type} property %{name}=%{value}'
765
+ message: 'Set %{config_node_name} config %{type} property %{name}=%{value}'
568
766
  createapacheslingdavexservlet:
569
767
  api: sling
570
768
  operation: postConfigApacheSlingDavExServlet
571
769
  params:
572
770
  required:
573
- runmode: '%{run_mode}'
574
771
  optional:
575
772
  - _alias
576
773
  - alias_type_hint
@@ -579,42 +776,100 @@ configproperty:
579
776
  responses:
580
777
  200:
581
778
  handler: simple
582
- message: 'Set %{run_mode} %{config_node_name} config %{type} property %{name}=%{value}'
779
+ message: 'Set %{config_node_name} config %{type} property %{name}=%{value}'
583
780
  201:
584
781
  handler: simple
585
- message: 'Set %{run_mode} %{config_node_name} config %{type} property %{name}=%{value}'
782
+ message: 'Set %{config_node_name} config %{type} property %{name}=%{value}'
586
783
  createaempasswordresetactivator:
587
784
  api: custom
588
785
  operation: postConfigAemPasswordReset
589
786
  params:
590
787
  required:
591
- runmode: '%{run_mode}'
592
788
  optional:
593
789
  - pwdreset_authorizables
594
790
  - pwdreset_authorizables_type_hint
595
791
  responses:
596
792
  200:
597
793
  handler: simple
598
- message: 'Set %{run_mode} %{config_node_name} config %{type} property %{name}=%{value}'
794
+ message: 'Set %{config_node_name} config %{type} property %{name}=%{value}'
599
795
  201:
600
796
  handler: simple
601
- message: 'Set %{run_mode} %{config_node_name} config %{type} property %{name}=%{value}'
797
+ message: 'Set %{config_node_name} config %{type} property %{name}=%{value}'
602
798
  createaemhealthcheckservlet:
603
799
  api: custom
604
800
  operation: postConfigAemHealthCheckServlet
605
801
  params:
606
802
  required:
607
- runmode: '%{run_mode}'
608
803
  optional:
609
804
  - bundles_ignored
610
805
  - bundles_ignored_type_hint
611
806
  responses:
612
807
  200:
613
808
  handler: simple
614
- message: 'Set %{run_mode} %{config_node_name} config %{type} property %{name}=%{value}'
809
+ message: 'Set %{config_node_name} config %{type} property %{name}=%{value}'
615
810
  201:
616
811
  handler: simple
617
- message: 'Set %{run_mode} %{config_node_name} config %{type} property %{name}=%{value}'
812
+ message: 'Set %{config_node_name} config %{type} property %{name}=%{value}'
813
+ createadobegranitesamlauthenticationhandler:
814
+ api: sling
815
+ operation: postConfigAdobeGraniteSamlAuthenticationHandler
816
+ params:
817
+ optional:
818
+ - key_store_password
819
+ - key_store_password_type_hint
820
+ - service_ranking
821
+ - service_ranking_type_hint
822
+ - idp_http_redirect
823
+ - idp_http_redirect_type_hint
824
+ - create_user
825
+ - create_user_type_hint
826
+ - default_redirect_url
827
+ - default_redirect_url_type_hint
828
+ - user_id_attribute
829
+ - user_id_attribute_type_hint
830
+ - default_groups
831
+ - default_groups_type_hint
832
+ - idp_cert_alias
833
+ - idp_cert_alias_type_hint
834
+ - add_group_memberships
835
+ - add_group_memberships_type_hint
836
+ - path
837
+ - path_type_hint
838
+ - synchronize_attributes
839
+ - synchronize_attributes_type_hint
840
+ - clock_tolerance
841
+ - clock_tolerance_type_hint
842
+ - group_membership_attribute
843
+ - group_membership_attribute_type_hint
844
+ - idp_url
845
+ - idp_url_type_hint
846
+ - logout_url
847
+ - logout_url_type_hint
848
+ - service_provider_entity_id
849
+ - service_provider_entity_id_type_hint
850
+ - assertion_consumer_service_url
851
+ - assertion_consumer_service_url_type_hint
852
+ - handle_logout
853
+ - handle_logout_type_hint
854
+ - sp_private_key_alias
855
+ - sp_private_key_alias_type_hint
856
+ - use_encryption
857
+ - use_encryption_type_hint
858
+ - name_id_format
859
+ - name_id_format_type_hint
860
+ - digest_method
861
+ - digestMethod_type_hint
862
+ - signature_method
863
+ - signature_method_type_hint
864
+ - user_intermediate_path
865
+ - user_intermediate_path_type_hint
866
+ responses:
867
+ 200:
868
+ handler: simple
869
+ message: 'Set %{config_node_name} config %{type} property %{name}=%{value}'
870
+ 201:
871
+ handler: simple
872
+ message: 'Set %{config_node_name} config %{type} property %{name}=%{value}'
618
873
  replicationagent:
619
874
  responses:
620
875
  404:
@@ -849,6 +1104,154 @@ repository:
849
1104
  200:
850
1105
  handler: simple
851
1106
  message: 'Repository writes unblocked'
1107
+ saml:
1108
+ actions:
1109
+ get:
1110
+ api: console
1111
+ operation: postSamlConfiguration
1112
+ params:
1113
+ optional:
1114
+ post: true
1115
+ responses:
1116
+ 200:
1117
+ handler: simple
1118
+ message: 'SAML Configuration found'
1119
+ create:
1120
+ api: console
1121
+ operation: postSamlConfiguration
1122
+ params:
1123
+ optional:
1124
+ - post
1125
+ - apply
1126
+ - delete
1127
+ - action
1128
+ - location
1129
+ - path
1130
+ - service_ranking
1131
+ - idp_url
1132
+ - idp_cert_alias
1133
+ - idp_http_redirect
1134
+ - service_provider_entity_id
1135
+ - assertion_consumer_service_url
1136
+ - sp_private_key_alias
1137
+ - key_store_password
1138
+ - default_redirect_url
1139
+ - user_id_attribute
1140
+ - use_encryption
1141
+ - create_user
1142
+ - add_group_memberships
1143
+ - group_membership_attribute
1144
+ - default_groups
1145
+ - name_id_format
1146
+ - synchronize_attributes
1147
+ - handle_logout
1148
+ - logout_url
1149
+ - clock_tolerance
1150
+ - digest_method
1151
+ - signature_method
1152
+ - user_intermediate_path
1153
+ - propertylist
1154
+ responses:
1155
+ 200:
1156
+ handler: simple
1157
+ message: 'SAML Configuration found'
1158
+ 302:
1159
+ handler: simple
1160
+ message: 'SAML Configuration created'
1161
+ delete:
1162
+ api: console
1163
+ operation: postSamlConfiguration
1164
+ params:
1165
+ optional:
1166
+ - apply
1167
+ - delete
1168
+ responses:
1169
+ 200:
1170
+ handler: simple
1171
+ message: 'SAML Configuration successfully deleted'
1172
+ truststore:
1173
+ responses:
1174
+ 404:
1175
+ handler: simple_error
1176
+ message: 'Truststore not found'
1177
+ actions:
1178
+ create:
1179
+ api: sling
1180
+ operation: postTruststore
1181
+ params:
1182
+ optional:
1183
+ new_password: '%{password}'
1184
+ re_password: '%{password}'
1185
+ operation: createStore
1186
+ responses:
1187
+ 200:
1188
+ handler: simple
1189
+ message: 'Truststore created'
1190
+ 201:
1191
+ handler: simple
1192
+ message: 'Truststore created'
1193
+ upload:
1194
+ api: sling
1195
+ operation: post_truststore_pkcs12
1196
+ params:
1197
+ optional:
1198
+ truststore_p12: __FILE_PLAIN__
1199
+ responses:
1200
+ 200:
1201
+ handler: simple
1202
+ message: 'Truststore uploaded'
1203
+ 201:
1204
+ handler: simple
1205
+ message: 'Truststore uploaded'
1206
+ download:
1207
+ api: sling
1208
+ operation: getTruststore
1209
+ params:
1210
+ required:
1211
+ responses:
1212
+ 200:
1213
+ handler: file_download
1214
+ message: 'Truststore downloaded to %{file_path}'
1215
+ delete:
1216
+ api: sling
1217
+ operation: postNode
1218
+ params:
1219
+ required:
1220
+ path: /etc/truststore/
1221
+ name: truststore.p12
1222
+ optional:
1223
+ operation: delete
1224
+ responses:
1225
+ 200:
1226
+ handler: simple
1227
+ message: 'Truststore deleted'
1228
+ 201:
1229
+ handler: simple
1230
+ message: 'Truststore deleted'
1231
+ 403:
1232
+ handler: simple_error
1233
+ message: 'Truststore not found'
1234
+ exists:
1235
+ api: sling
1236
+ operation: getTruststoreInfo
1237
+ params:
1238
+ required:
1239
+ responses:
1240
+ 200:
1241
+ handler: json_truststore_exists
1242
+ message: 'Truststore exists'
1243
+ 404:
1244
+ handler: json_truststore_exists
1245
+ message: 'Truststore not found'
1246
+ info:
1247
+ api: sling
1248
+ operation: getTruststoreInfo
1249
+ params:
1250
+ required:
1251
+ responses:
1252
+ 200:
1253
+ handler: simple_body
1254
+ message: 'Retrieved truststore info'
852
1255
  user:
853
1256
  responses:
854
1257
  404:
@@ -93,8 +93,19 @@ module RubyAem
93
93
  # if value is provided in optional param spec,
94
94
  # then apply variable interpolation the same way as required param
95
95
  elsif value.class == String
96
- if value == '__FILE__'
97
- File.open("#{call_params[:file_path]}/#{call_params[:package_name]}-#{call_params[:package_version]}.zip", 'r') { |file|
96
+ case value
97
+ when '__FILE_PACKAGE__'
98
+ file_path = "#{call_params[:file_path]}/#{call_params[:package_name]}-#{call_params[:package_version]}.zip"
99
+ when '__FILE_PLAIN__'
100
+ file_path = call_params[:file_path]
101
+ when '__FILE_CERTIFICATE__'
102
+ file_path = call_params[:file_path_certificate]
103
+ when '__FILE_PRIVATE_KEY__'
104
+ file_path = call_params[:file_path_private_key]
105
+ end
106
+
107
+ if !file_path.nil?
108
+ File.open(file_path.to_s, 'r') { |file|
98
109
  params[-1][key.to_sym] = file
99
110
  }
100
111
  else
@@ -23,7 +23,7 @@ module RubyAem
23
23
  # @param response_spec response specification as configured in conf/spec.yaml
24
24
  # @param call_params API call parameters
25
25
  # @return RubyAem::Result
26
- def self.file_download(response, response_spec, call_params)
26
+ def self.package_file_download(response, response_spec, call_params)
27
27
  FileUtils.cp(response.body.path, "#{call_params[:file_path]}/#{call_params[:package_name]}-#{call_params[:package_version]}.zip")
28
28
  response.body.delete
29
29
 
@@ -31,5 +31,18 @@ module RubyAem
31
31
 
32
32
  RubyAem::Result.new(message, response)
33
33
  end
34
+
35
+ # @param response HTTP response containing status_code, body, and headers
36
+ # @param response_spec response specification as configured in conf/spec.yaml
37
+ # @param call_params API call parameters
38
+ # @return RubyAem::Result
39
+ def self.file_download(response, response_spec, call_params)
40
+ FileUtils.cp(response.body.path, call_params[:file_path].to_s)
41
+ response.body.delete
42
+
43
+ message = response_spec['message'] % call_params
44
+
45
+ RubyAem::Result.new(message, response)
46
+ end
34
47
  end
35
48
  end