ruby_aem 3.6.0 → 3.10.1

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: b87692d45379fc2a9e6c9860148b34a413352431
4
- data.tar.gz: 73afdd6346a56fe3f3ae34604e4da80dc4957634
3
+ metadata.gz: 6bafd8e93a34eea1e44db851ebfc4f4067c0578c
4
+ data.tar.gz: f44a61f6090e948c85a5db8551c922e943bb025a
5
5
  SHA512:
6
- metadata.gz: d50ae162ac4d8af6fe5fe24bd40f9f4a8eb7fc53d63715faa6254352f050b80087756072dcaae327ef51ecee0a6ec93268add0d386c45f5321e473c439e175a7
7
- data.tar.gz: 235eee739d3208da3d0d96131813ad9bd7f99a73ba373fe6d733d4e6549a8280565cbb76b5995161edabbd71156837b747fe2ed743c6c79dc5e22253bc4f2cc0
6
+ metadata.gz: c3c22c215225b5ec46ebcdc3e10fcbc8c92aa1b2609f85d7eacb389b3797103e5ae510f21b9ce62c2be21c3b9d01f8023d7968329811767bd07d8cc5ff4b2add
7
+ data.tar.gz: 73cb51e959598af927c0af859f5590930d71e724f7049963578384ff0f3b180492b4bbbc0b8714f0471c85e8480b72a06ec04e0630967da31c2bb39e3df38310
@@ -1 +1 @@
1
- version: 3.6.0
1
+ version: 3.10.1
@@ -339,27 +339,27 @@ flushagent:
339
339
  name: '%{name}'
340
340
  optional:
341
341
  jcrprimary_type: cq:Page
342
- jcrcontentcqname: '%{name}'
343
- jcrcontentjcrtitle: '%{title}'
344
- jcrcontentjcrdescription: '%{description}'
345
- jcrcontentslingresource_type: cq/replication/components/agent
346
- jcrcontenttransport_uri: '%{dest_base_url}/dispatcher/invalidate.cache'
347
- jcrcontentlog_level: '%{log_level}'
348
- jcrcontentno_versioning: true
349
- jcrcontentprotocol_http_headers:
342
+ jcrcontent_cqname: '%{name}'
343
+ jcrcontent_jcrtitle: '%{title}'
344
+ jcrcontent_jcrdescription: '%{description}'
345
+ jcrcontent_slingresource_type: cq/replication/components/agent
346
+ jcrcontent_transport_uri: '%{dest_base_url}/dispatcher/invalidate.cache'
347
+ jcrcontent_log_level: '%{log_level}'
348
+ jcrcontent_no_versioning: true
349
+ jcrcontent_protocol_http_headers:
350
350
  - 'CQ-Action:{action}'
351
351
  - 'CQ-Handle:{path}'
352
352
  - 'CQ-Path:{path}'
353
- jcrcontentprotocol_http_headers_type_hint: String[]
354
- jcrcontentprotocol_http_method: GET
355
- jcrcontentretry_delay: '%{retry_delay}'
356
- jcrcontentserialization_type: flush
357
- jcrcontentjcrmixin_types: cq:ReplicationStatus
358
- jcrcontenttrigger_receive: true
359
- jcrcontenttrigger_specific: true
360
- jcrcontentcqtemplate: /libs/cq/replication/templates/agent
361
- jcrcontentenabled: true
362
- jcrcontentssl: '%{ssl}'
353
+ jcrcontent_protocol_http_headers_type_hint: String[]
354
+ jcrcontent_protocol_http_method: GET
355
+ jcrcontent_retry_delay: '%{retry_delay}'
356
+ jcrcontent_serialization_type: flush
357
+ jcrcontent_jcrmixin_types: cq:ReplicationStatus
358
+ jcrcontent_trigger_receive: true
359
+ jcrcontent_trigger_specific: true
360
+ jcrcontent_cqtemplate: /libs/cq/replication/templates/agent
361
+ jcrcontent_enabled: true
362
+ jcrcontent_ssl: '%{ssl}'
363
363
  responses:
364
364
  200:
365
365
  handler: simple
@@ -417,8 +417,8 @@ group:
417
417
  authorizable_id: '%{name}'
418
418
  intermediate_path: '%{path}'
419
419
  optional:
420
- create_group: ''
421
- profilegiven_name: '%{name}'
420
+ create_group: 'true'
421
+ profile_given_name: '%{name}'
422
422
  responses:
423
423
  201:
424
424
  handler: html_authorizable_id
@@ -447,7 +447,7 @@ group:
447
447
  path: '%{path}'
448
448
  name: '%{authorizable_id}'
449
449
  optional:
450
- delete_authorizable: ''
450
+ delete_authorizable: '%{name}'
451
451
  responses:
452
452
  200:
453
453
  handler: simple
@@ -960,18 +960,18 @@ replicationagent:
960
960
  name: '%{name}'
961
961
  optional:
962
962
  jcrprimary_type: cq:Page
963
- jcrcontentcqname: '%{name}'
964
- jcrcontentjcrtitle: '%{title}'
965
- jcrcontentjcrdescription: '%{description}'
966
- jcrcontentslingresource_type: cq/replication/components/agent
967
- jcrcontentserialization_type: durbo
968
- jcrcontenttransport_uri: '%{dest_base_url}/bin/receive?sling:authRequestLogin=1'
969
- jcrcontenttransport_user: '%{transport_user}'
970
- jcrcontenttransport_password: '%{transport_password}'
971
- jcrcontentlog_level: '%{log_level}'
972
- jcrcontentretry_delay: '%{retry_delay}'
973
- jcrcontentcqtemplate: /libs/cq/replication/templates/agent
974
- jcrcontentenabled: true
963
+ jcrcontent_cqname: '%{name}'
964
+ jcrcontent_jcrtitle: '%{title}'
965
+ jcrcontent_jcrdescription: '%{description}'
966
+ jcrcontent_slingresource_type: cq/replication/components/agent
967
+ jcrcontent_serialization_type: durbo
968
+ jcrcontent_transport_uri: '%{dest_base_url}/bin/receive?sling:authRequestLogin=1'
969
+ jcrcontent_transport_user: '%{transport_user}'
970
+ jcrcontent_transport_password: '%{transport_password}'
971
+ jcrcontent_log_level: '%{log_level}'
972
+ jcrcontent_retry_delay: '%{retry_delay}'
973
+ jcrcontent_cqtemplate: /libs/cq/replication/templates/agent
974
+ jcrcontent_enabled: true
975
975
  responses:
976
976
  200:
977
977
  handler: simple
@@ -1030,19 +1030,19 @@ outboxreplicationagent:
1030
1030
  name: '%{name}'
1031
1031
  optional:
1032
1032
  jcrprimary_type: cq:Page
1033
- jcrcontentcqname: '%{name}'
1034
- jcrcontentjcrtitle: '%{title}'
1035
- jcrcontentjcrdescription: '%{description}'
1036
- jcrcontentslingresource_type: cq/replication/components/agent
1037
- jcrcontenttransport_uri: repo://var/replication/outbox
1038
- jcrcontentno_versioning: true
1039
- jcrcontentlog_level: '%{log_level}'
1040
- jcrcontentcqtemplate: /libs/cq/replication/templates/agent
1041
- jcrcontentenabled: true
1042
- jcrcontenttrigger_distribute: true
1043
- jcrcontenttrigger_modified: false
1044
- jcrcontenttrigger_specific: true
1045
- jcrcontentuser_id: '%{user_id}'
1033
+ jcrcontent_cqname: '%{name}'
1034
+ jcrcontent_jcrtitle: '%{title}'
1035
+ jcrcontent_jcrdescription: '%{description}'
1036
+ jcrcontent_slingresource_type: cq/replication/components/agent
1037
+ jcrcontent_transport_uri: repo://var/replication/outbox
1038
+ jcrcontent_no_versioning: true
1039
+ jcrcontent_log_level: '%{log_level}'
1040
+ jcrcontent_cqtemplate: /libs/cq/replication/templates/agent
1041
+ jcrcontent_enabled: true
1042
+ jcrcontent_trigger_distribute: true
1043
+ jcrcontent_trigger_modified: false
1044
+ jcrcontent_trigger_specific: true
1045
+ jcrcontent_user_id: '%{user_id}'
1046
1046
  responses:
1047
1047
  200:
1048
1048
  handler: simple
@@ -1101,19 +1101,19 @@ reversereplicationagent:
1101
1101
  name: '%{name}'
1102
1102
  optional:
1103
1103
  jcrprimary_type: cq:Page
1104
- jcrcontentcqname: '%{name}'
1105
- jcrcontentjcrtitle: '%{title}'
1106
- jcrcontentjcrdescription: '%{description}'
1107
- jcrcontentslingresource_type: cq/replication/components/agent
1108
- jcrcontentserialization_type: durbo
1109
- jcrcontenttransport_uri: '%{dest_base_url}/bin/receive?sling:authRequestLogin=1'
1110
- jcrcontenttransport_user: '%{transport_user}'
1111
- jcrcontenttransport_password: '%{transport_password}'
1112
- jcrcontentlog_level: '%{log_level}'
1113
- jcrcontentretry_delay: '%{retry_delay}'
1114
- jcrcontentcqtemplate: /libs/cq/replication/templates/agent
1115
- jcrcontentenabled: true
1116
- jcrcontentreverse_replication: true
1104
+ jcrcontent_cqname: '%{name}'
1105
+ jcrcontent_jcrtitle: '%{title}'
1106
+ jcrcontent_jcrdescription: '%{description}'
1107
+ jcrcontent_slingresource_type: cq/replication/components/agent
1108
+ jcrcontent_serialization_type: durbo
1109
+ jcrcontent_transport_uri: '%{dest_base_url}/bin/receive?sling:authRequestLogin=1'
1110
+ jcrcontent_transport_user: '%{transport_user}'
1111
+ jcrcontent_transport_password: '%{transport_password}'
1112
+ jcrcontent_log_level: '%{log_level}'
1113
+ jcrcontent_retry_delay: '%{retry_delay}'
1114
+ jcrcontent_cqtemplate: /libs/cq/replication/templates/agent
1115
+ jcrcontent_enabled: true
1116
+ jcrcontent_reverse_replication: true
1117
1117
  responses:
1118
1118
  200:
1119
1119
  handler: simple
@@ -1292,7 +1292,7 @@ truststore:
1292
1292
  operation: postNode
1293
1293
  params:
1294
1294
  required:
1295
- path: /etc/truststore/
1295
+ path: etc/truststore
1296
1296
  name: truststore.p12
1297
1297
  optional:
1298
1298
  operation: delete
@@ -1341,7 +1341,7 @@ user:
1341
1341
  authorizable_id: '%{name}'
1342
1342
  intermediate_path: '%{path}'
1343
1343
  optional:
1344
- create_user: ''
1344
+ create_user: 'true'
1345
1345
  reppassword: '%{password}'
1346
1346
  responses:
1347
1347
  201:
@@ -1371,7 +1371,7 @@ user:
1371
1371
  path: '%{path}'
1372
1372
  name: '%{authorizable_id}'
1373
1373
  optional:
1374
- delete_authorizable: ''
1374
+ delete_authorizable: '%{name}'
1375
1375
  responses:
1376
1376
  200:
1377
1377
  handler: simple
@@ -1422,3 +1422,44 @@ user:
1422
1422
  200:
1423
1423
  handler: html_change_password
1424
1424
  message: 'User %{user}''s password has been changed'
1425
+ ssl:
1426
+ actions:
1427
+ enable:
1428
+ api: granite
1429
+ operation: sslSetup
1430
+ params:
1431
+ required:
1432
+ keystore_password: '%{keystore_password}'
1433
+ keystore_passwordConfirm: '%{keystore_passwordConfirm}'
1434
+ truststore_password: '%{truststore_password}'
1435
+ truststore_passwordConfirm: '%{truststore_passwordConfirm}'
1436
+ https_hostname: '%{https_hostname}'
1437
+ https_port: '%{https_port}'
1438
+ optional:
1439
+ privatekey_file: __FILE_PRIVATE_KEY__
1440
+ certificate_file: __FILE_CERTIFICATE__
1441
+ responses:
1442
+ 200:
1443
+ handler: simple
1444
+ message: 'HTTPS has been configured on port %{https_port}'
1445
+ get:
1446
+ api: configmgr
1447
+ operation: comAdobeGraniteJettySslInternalGraniteSslConnectorFactory
1448
+ params:
1449
+ optional:
1450
+ post: true
1451
+ responses:
1452
+ 200:
1453
+ handler: simple
1454
+ message: 'HTTPS Configuration found'
1455
+ disable:
1456
+ api: configmgr
1457
+ operation: comAdobeGraniteJettySslInternalGraniteSslConnectorFactory
1458
+ params:
1459
+ optional:
1460
+ apply: true
1461
+ delete: true
1462
+ responses:
1463
+ 200:
1464
+ handler: simple
1465
+ message: 'HTTPS has been disabled'
@@ -29,6 +29,7 @@ require 'ruby_aem/resources/replication_agent'
29
29
  require 'ruby_aem/resources/outbox_replication_agent'
30
30
  require 'ruby_aem/resources/reverse_replication_agent'
31
31
  require 'ruby_aem/resources/saml'
32
+ require 'ruby_aem/resources/ssl'
32
33
  require 'ruby_aem/resources/repository'
33
34
  require 'ruby_aem/resources/truststore'
34
35
  require 'ruby_aem/resources/user'
@@ -87,7 +88,8 @@ module RubyAem
87
88
  custom: SwaggerAemClient::CustomApi.new,
88
89
  cq: SwaggerAemClient::CqApi.new,
89
90
  crx: SwaggerAemClient::CrxApi.new,
90
- sling: SwaggerAemClient::SlingApi.new
91
+ sling: SwaggerAemClient::SlingApi.new,
92
+ granite: SwaggerAemClient::GraniteApi.new
91
93
  }
92
94
 
93
95
  spec = YAML.load_file(File.expand_path('../../conf/spec.yaml', __FILE__))
@@ -254,6 +256,13 @@ module RubyAem
254
256
  RubyAem::Resources::Saml.new(@client)
255
257
  end
256
258
 
259
+ # Create a SSL instance.
260
+ #
261
+ # @return new RubyAem::Resources::Saml instance
262
+ def ssl
263
+ RubyAem::Resources::Ssl.new(@client)
264
+ end
265
+
257
266
  # Create a Truststore instance.
258
267
  #
259
268
  # @return new RubyAem::Resources::Truststore instance
@@ -33,6 +33,8 @@ module RubyAem
33
33
  intermediate_path: intermediate_path,
34
34
  authorizable_id: authorizable_id
35
35
  }
36
+
37
+ @call_params[:intermediate_path] = RubyAem::Swagger.path(@call_params[:intermediate_path])
36
38
  end
37
39
 
38
40
  # Create AEM Authorizable Keystore.
@@ -38,6 +38,8 @@ module RubyAem
38
38
  keystore_intermediate_path: keystore_intermediate_path,
39
39
  keystore_authorizable_id: keystore_authorizable_id
40
40
  }
41
+
42
+ @call_params[:keystore_intermediate_path] = RubyAem::Swagger.path(@call_params[:keystore_intermediate_path])
41
43
  end
42
44
 
43
45
  # Create is an alias to import.
@@ -0,0 +1,148 @@
1
+ # Copyright 2016-2018 Shine Solutions
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
+ require 'ruby_aem/error'
16
+
17
+ module RubyAem
18
+ module Resources
19
+ # AEM class contains API calls related to managing SSL via Granite.
20
+ class Ssl
21
+ # Initialise Ssl resource.
22
+ #
23
+ # @param client RubyAem::Client
24
+ # @return new RubyAem::Resources::Ssl instance
25
+ def initialize(client)
26
+ @client = client
27
+ @call_params = {
28
+ }
29
+ end
30
+
31
+ # Disable SSL
32
+ #
33
+ # @return RubyAem::Result
34
+ def disable
35
+ @client.call(self.class, __callee__.to_s, @call_params)
36
+ end
37
+
38
+ # Enable SSL
39
+ #
40
+ # @param opts hash of the following values:
41
+ # - keystore_password: Authorizable Keystore password for system-user ssl-service. keystore will be created if it doesn't exist.
42
+ # - truststore_password: AEM Global Truststore password. Truststore will be created if it doesn't exist.
43
+ # - https_hostname: Hostname for enabling HTTPS listener matching the certificate's common name.
44
+ # - https_port: Port to listen on for HTTPS requests.
45
+ # - certificate_file_path: Path to the HTTPS public certificate file.
46
+ # - privatekey_file_path: Path to the HTTPS Private Key file.
47
+ # @return RubyAem::Result
48
+ def enable(opts = {
49
+ keystore_password: nil,
50
+ truststore_password: nil,
51
+ https_hostname: nil,
52
+ https_port: nil,
53
+ certificate_file_path: nil,
54
+ privatekey_file_path: nil
55
+ })
56
+ @call_params[:keystore_password] = opts[:keystore_password]
57
+ @call_params[:keystore_passwordConfirm] = opts[:keystore_password]
58
+ @call_params[:truststore_password] = opts[:truststore_password]
59
+ @call_params[:truststore_passwordConfirm] = opts[:truststore_password]
60
+ @call_params[:https_hostname] = opts[:https_hostname]
61
+ @call_params[:https_port] = opts[:https_port]
62
+ @call_params[:file_path_certificate] = opts[:certificate_file_path]
63
+ @call_params[:file_path_private_key] = opts[:privatekey_file_path]
64
+
65
+ @client.call(self.class, __callee__.to_s, @call_params)
66
+ end
67
+
68
+ # Get SSL Granite configuration
69
+ #
70
+ # @return RubyAem::Result
71
+ def get
72
+ @client.call(self.class, __callee__.to_s, @call_params)
73
+ end
74
+
75
+ # Check if SSL is enabled via Granite
76
+ #
77
+ # @return RubyAem::Result
78
+ def is_enabled
79
+ get_ssl = get
80
+
81
+ response = get_ssl.response
82
+ ssl_properties = response.body.properties
83
+ ssl_enabled = ssl_properties.com_adobe_granite_jetty_ssl_port.is_set
84
+ ssl_port = ssl_properties.com_adobe_granite_jetty_ssl_port.value
85
+
86
+ message = if ssl_enabled.eql?(true)
87
+ "HTTPS has been configured on port #{ssl_port}"
88
+ else
89
+ 'HTTPS is not configured'
90
+ end
91
+
92
+ result = RubyAem::Result.new(message, response)
93
+ result.data = ssl_enabled
94
+
95
+ result
96
+ end
97
+
98
+ # Enable SSL via granite and wait until SSL was enabled
99
+ #
100
+ # @param opts hash of the following values:
101
+ # - keystore_password: Authorizable Keystore password for system-user ssl-service. keystore will be created if it doesn't exist.
102
+ # - truststore_password: AEM Global Truststore password. Truststore will be created if it doesn't exist.
103
+ # - https_hostname: Hostname for enabling HTTPS listener matching the certificate's common name.
104
+ # - https_port: Port to listen on for HTTPS requests.
105
+ # - certificate_file_path: Path to the HTTPS public certificate file.
106
+ # - privatekey_file_path: Path to the HTTPS Private Key file.
107
+ # - _retries: retries library's options (http://www.rubydoc.info/gems/retries/0.0.5#Usage), restricted to max_tries, base_sleep_seconds, max_sleep_seconds
108
+ # @return RubyAem::Result
109
+ def enable_wait_until_ready(
110
+ opts = {
111
+ force: true,
112
+ _retries: {
113
+ max_tries: 30,
114
+ base_sleep_seconds: 2,
115
+ max_sleep_seconds: 2
116
+ }
117
+ }
118
+ )
119
+ opts[:_retries] ||= {}
120
+ opts[:_retries][:max_tries] ||= 30
121
+ opts[:_retries][:base_sleep_seconds] ||= 2
122
+ opts[:_retries][:max_sleep_seconds] ||= 2
123
+
124
+ # ensure integer retries setting (Puppet 3 passes numeric string)
125
+ opts[:_retries][:max_tries] = opts[:_retries][:max_tries].to_i
126
+ opts[:_retries][:base_sleep_seconds] = opts[:_retries][:base_sleep_seconds].to_i
127
+ opts[:_retries][:max_sleep_seconds] = opts[:_retries][:max_sleep_seconds].to_i
128
+
129
+ # The AEM Granite API to enable SSl is unstable and in some cases it response with response code 0.
130
+ # This is because the HTTP service is getting restarted during the process of enabling SSL via Granite.
131
+ # To not end with an error we have to rescue this behaviour and verify afterwards if SSL was enabled.
132
+ begin
133
+ result = enable(**opts)
134
+ rescue RubyAem::Error => e
135
+ raise StandardError.new(result) unless e.result.response.status_code.zero?
136
+
137
+ with_retries(max_tries: opts[:_retries][:max_tries], base_sleep_seconds: opts[:_retries][:base_sleep_seconds], max_sleep_seconds: opts[:_retries][:max_sleep_seconds]) { |retries_count|
138
+ result = is_enabled
139
+ message = 'SSL could not be configured or connection timeout please try again.'
140
+ puts format('SSL Enable check #%<retries_count>d: %<check_result_data>s - %<check_result_message>s', retries_count: retries_count, check_result_data: result.data, check_result_message: result.message)
141
+ raise StandardError.new(message) if result.data == false
142
+ }
143
+ end
144
+ result
145
+ end
146
+ end
147
+ end
148
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_aem
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.0
4
+ version: 3.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shine Solutions
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-04-18 00:00:00.000000000 Z
12
+ date: 2020-12-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: retries
@@ -31,14 +31,14 @@ dependencies:
31
31
  requirements:
32
32
  - - '='
33
33
  - !ruby/object:Gem::Version
34
- version: 3.2.0
34
+ version: 3.4.0
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - '='
40
40
  - !ruby/object:Gem::Version
41
- version: 3.2.0
41
+ version: 3.4.0
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: swagger_aem_osgi
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -117,6 +117,7 @@ files:
117
117
  - lib/ruby_aem/resources/repository.rb
118
118
  - lib/ruby_aem/resources/reverse_replication_agent.rb
119
119
  - lib/ruby_aem/resources/saml.rb
120
+ - lib/ruby_aem/resources/ssl.rb
120
121
  - lib/ruby_aem/resources/truststore.rb
121
122
  - lib/ruby_aem/resources/user.rb
122
123
  - lib/ruby_aem/response.rb