aspera-cli 4.10.0 → 4.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/BUGS.md +19 -0
  4. data/CHANGELOG.md +528 -0
  5. data/CONTRIBUTING.md +143 -0
  6. data/README.md +977 -589
  7. data/bin/ascli +4 -4
  8. data/bin/asession +12 -12
  9. data/docs/test_env.conf +29 -19
  10. data/examples/aoc.rb +6 -6
  11. data/examples/dascli +18 -16
  12. data/examples/faspex4.rb +15 -15
  13. data/examples/node.rb +12 -12
  14. data/examples/proxy.pac +2 -2
  15. data/examples/server.rb +12 -12
  16. data/lib/aspera/aoc.rb +344 -272
  17. data/lib/aspera/ascmd.rb +56 -54
  18. data/lib/aspera/ats_api.rb +4 -4
  19. data/lib/aspera/cli/basic_auth_plugin.rb +15 -12
  20. data/lib/aspera/cli/extended_value.rb +9 -9
  21. data/lib/aspera/cli/{formater.rb → formatter.rb} +69 -69
  22. data/lib/aspera/cli/listener/line_dump.rb +1 -1
  23. data/lib/aspera/cli/listener/logger.rb +1 -1
  24. data/lib/aspera/cli/listener/progress.rb +5 -6
  25. data/lib/aspera/cli/listener/progress_multi.rb +16 -21
  26. data/lib/aspera/cli/main.rb +72 -73
  27. data/lib/aspera/cli/manager.rb +112 -112
  28. data/lib/aspera/cli/plugin.rb +68 -48
  29. data/lib/aspera/cli/plugins/alee.rb +4 -4
  30. data/lib/aspera/cli/plugins/aoc.rb +322 -720
  31. data/lib/aspera/cli/plugins/ats.rb +50 -52
  32. data/lib/aspera/cli/plugins/bss.rb +10 -10
  33. data/lib/aspera/cli/plugins/config.rb +514 -410
  34. data/lib/aspera/cli/plugins/console.rb +12 -12
  35. data/lib/aspera/cli/plugins/cos.rb +18 -20
  36. data/lib/aspera/cli/plugins/faspex.rb +134 -136
  37. data/lib/aspera/cli/plugins/faspex5.rb +235 -70
  38. data/lib/aspera/cli/plugins/node.rb +378 -309
  39. data/lib/aspera/cli/plugins/orchestrator.rb +52 -49
  40. data/lib/aspera/cli/plugins/preview.rb +129 -120
  41. data/lib/aspera/cli/plugins/server.rb +137 -83
  42. data/lib/aspera/cli/plugins/shares.rb +77 -52
  43. data/lib/aspera/cli/plugins/sync.rb +13 -33
  44. data/lib/aspera/cli/transfer_agent.rb +61 -61
  45. data/lib/aspera/cli/version.rb +2 -1
  46. data/lib/aspera/colors.rb +3 -3
  47. data/lib/aspera/command_line_builder.rb +78 -74
  48. data/lib/aspera/cos_node.rb +31 -29
  49. data/lib/aspera/data_repository.rb +1 -1
  50. data/lib/aspera/environment.rb +30 -28
  51. data/lib/aspera/fasp/agent_base.rb +17 -15
  52. data/lib/aspera/fasp/agent_connect.rb +34 -32
  53. data/lib/aspera/fasp/agent_direct.rb +70 -73
  54. data/lib/aspera/fasp/agent_httpgw.rb +79 -74
  55. data/lib/aspera/fasp/agent_node.rb +26 -26
  56. data/lib/aspera/fasp/agent_trsdk.rb +20 -20
  57. data/lib/aspera/fasp/error.rb +3 -2
  58. data/lib/aspera/fasp/error_info.rb +11 -8
  59. data/lib/aspera/fasp/installation.rb +80 -80
  60. data/lib/aspera/fasp/listener.rb +2 -2
  61. data/lib/aspera/fasp/parameters.rb +103 -92
  62. data/lib/aspera/fasp/parameters.yaml +313 -214
  63. data/lib/aspera/fasp/resume_policy.rb +10 -10
  64. data/lib/aspera/fasp/transfer_spec.rb +22 -2
  65. data/lib/aspera/fasp/uri.rb +7 -7
  66. data/lib/aspera/faspex_gw.rb +80 -159
  67. data/lib/aspera/faspex_postproc.rb +77 -0
  68. data/lib/aspera/hash_ext.rb +3 -3
  69. data/lib/aspera/id_generator.rb +5 -5
  70. data/lib/aspera/keychain/encrypted_hash.rb +23 -28
  71. data/lib/aspera/keychain/macos_security.rb +21 -20
  72. data/lib/aspera/log.rb +13 -13
  73. data/lib/aspera/nagios.rb +24 -23
  74. data/lib/aspera/node.rb +217 -38
  75. data/lib/aspera/oauth.rb +78 -74
  76. data/lib/aspera/open_application.rb +19 -11
  77. data/lib/aspera/persistency_action_once.rb +4 -4
  78. data/lib/aspera/persistency_folder.rb +13 -13
  79. data/lib/aspera/preview/file_types.rb +8 -8
  80. data/lib/aspera/preview/generator.rb +67 -67
  81. data/lib/aspera/preview/utils.rb +27 -27
  82. data/lib/aspera/proxy_auto_config.js +63 -63
  83. data/lib/aspera/proxy_auto_config.rb +19 -19
  84. data/lib/aspera/rest.rb +65 -67
  85. data/lib/aspera/rest_call_error.rb +2 -1
  86. data/lib/aspera/rest_error_analyzer.rb +22 -21
  87. data/lib/aspera/rest_errors_aspera.rb +16 -16
  88. data/lib/aspera/secret_hider.rb +17 -14
  89. data/lib/aspera/ssh.rb +15 -14
  90. data/lib/aspera/sync.rb +177 -62
  91. data/lib/aspera/temp_file_manager.rb +2 -2
  92. data/lib/aspera/uri_reader.rb +4 -4
  93. data/lib/aspera/web_auth.rb +13 -64
  94. data/lib/aspera/web_server_simple.rb +76 -0
  95. data.tar.gz.sig +0 -0
  96. metadata +11 -6
  97. metadata.gz.sig +0 -0
@@ -0,0 +1,76 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'webrick'
4
+ require 'webrick/https'
5
+ require 'aspera/log'
6
+ require 'openssl'
7
+
8
+ module Aspera
9
+ class WebServerSimple < WEBrick::HTTPServer
10
+ CERT_PARAMETERS = %i[key cert chain].freeze
11
+ # generates and adds self signed cert to provided webrick options
12
+ def self.fill_self_signed_cert(cert, key)
13
+ cert.subject = cert.issuer = OpenSSL::X509::Name.parse('/C=FR/O=Test/OU=Test/CN=Test')
14
+ cert.not_before = Time.now
15
+ cert.not_after = Time.now + 365 * 24 * 60 * 60
16
+ cert.public_key = key.public_key
17
+ cert.serial = 0x0
18
+ cert.version = 2
19
+ ef = OpenSSL::X509::ExtensionFactory.new
20
+ ef.issuer_certificate = cert
21
+ ef.subject_certificate = cert
22
+ cert.extensions = [
23
+ ef.create_extension('basicConstraints', 'CA:TRUE', true),
24
+ ef.create_extension('subjectKeyIdentifier', 'hash')
25
+ # ef.create_extension('keyUsage', 'cRLSign,keyCertSign', true),
26
+ ]
27
+ cert.add_extension(ef.create_extension('authorityKeyIdentifier', 'keyid:always,issuer:always'))
28
+ cert.sign(key, OpenSSL::Digest.new('SHA256'))
29
+ end
30
+
31
+ # @param uri [URI]
32
+ def initialize(uri, certificate: nil)
33
+ # see https://www.rubydoc.info/stdlib/webrick/WEBrick/Config
34
+ webrick_options = {
35
+ BindAddress: uri.host,
36
+ Port: uri.port,
37
+ Logger: Log.log,
38
+ AccessLog: [[self, WEBrick::AccessLog::COMMON_LOG_FORMAT]] # replace default access log to call local method "<<" below
39
+ }
40
+ case uri.scheme
41
+ when 'http'
42
+ Log.log.debug('HTTP mode')
43
+ when 'https'
44
+ webrick_options[:SSLEnable] = true
45
+ if certificate.nil?
46
+ webrick_options[:SSLCertName] = [['CN', WEBrick::Utils.getservername]]
47
+ else
48
+ raise 'certificate must be Hash' unless certificate.is_a?(Hash)
49
+ certificate = certificate.symbolize_keys
50
+ raise "unexpected key in certificate config: only: #{CERT_PARAMETERS.join(', ')}" if certificate.keys.any?{|k|!CERT_PARAMETERS.include?(k)}
51
+ webrick_options[:SSLPrivateKey] = if certificate.key?(:key)
52
+ OpenSSL::PKey::RSA.new(File.read(certificate[:key]))
53
+ else
54
+ OpenSSL::PKey::RSA.new(4096)
55
+ end
56
+ if certificate.key?(:cert)
57
+ webrick_options[:SSLCertificate] = OpenSSL::X509::Certificate.new(File.read(certificate[:cert]))
58
+ else
59
+ webrick_options[:SSLCertificate] = OpenSSL::X509::Certificate.new
60
+ self.class.fill_self_signed_cert(webrick_options[:SSLCertificate], webrick_options[:SSLPrivateKey])
61
+ end
62
+ if certificate.key?(:chain)
63
+ webrick_options[:SSLExtraChainCert] = [OpenSSL::X509::Certificate.new(File.read(certificate[:chain]))]
64
+ end
65
+ end
66
+ end
67
+ # self signed certificate generates characters on STDERR, see create_self_signed_cert in webrick/ssl.rb
68
+ Log.capture_stderr { super(webrick_options) }
69
+ end
70
+
71
+ # log web server access ( option AccessLog )
72
+ def <<(access_log)
73
+ Log.log.debug{"webrick log #{access_log.chomp}"}
74
+ end
75
+ end
76
+ end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aspera-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.10.0
4
+ version: 4.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Laurent Martin
@@ -35,7 +35,7 @@ cert_chain:
35
35
  ZjkOWbUc1aLIsfaQFHWyNfisY9X2RgkFHjX0p5493wnoA7aWh52MUhc145npFh8z
36
36
  v4P9xwkT02Shkert4B4iwNvVjoAUGk+J4090svZCroAyXBjon5LV7MJ4fyw=
37
37
  -----END CERTIFICATE-----
38
- date: 2022-12-01 00:00:00.000000000 Z
38
+ date: 2023-03-20 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: execjs
@@ -89,14 +89,14 @@ dependencies:
89
89
  name: net-ssh
90
90
  requirement: !ruby/object:Gem::Requirement
91
91
  requirements:
92
- - - "~>"
92
+ - - ">="
93
93
  - !ruby/object:Gem::Version
94
94
  version: '6.0'
95
95
  type: :runtime
96
96
  prerelease: false
97
97
  version_requirements: !ruby/object:Gem::Requirement
98
98
  requirements:
99
- - - "~>"
99
+ - - ">="
100
100
  - !ruby/object:Gem::Version
101
101
  version: '6.0'
102
102
  - !ruby/object:Gem::Dependency
@@ -360,6 +360,9 @@ executables:
360
360
  extensions: []
361
361
  extra_rdoc_files: []
362
362
  files:
363
+ - BUGS.md
364
+ - CHANGELOG.md
365
+ - CONTRIBUTING.md
363
366
  - README.md
364
367
  - bin/ascli
365
368
  - bin/asession
@@ -375,7 +378,7 @@ files:
375
378
  - lib/aspera/ats_api.rb
376
379
  - lib/aspera/cli/basic_auth_plugin.rb
377
380
  - lib/aspera/cli/extended_value.rb
378
- - lib/aspera/cli/formater.rb
381
+ - lib/aspera/cli/formatter.rb
379
382
  - lib/aspera/cli/info.rb
380
383
  - lib/aspera/cli/listener/line_dump.rb
381
384
  - lib/aspera/cli/listener/logger.rb
@@ -429,6 +432,7 @@ files:
429
432
  - lib/aspera/fasp/transfer_spec.rb
430
433
  - lib/aspera/fasp/uri.rb
431
434
  - lib/aspera/faspex_gw.rb
435
+ - lib/aspera/faspex_postproc.rb
432
436
  - lib/aspera/hash_ext.rb
433
437
  - lib/aspera/id_generator.rb
434
438
  - lib/aspera/keychain/encrypted_hash.rb
@@ -459,6 +463,7 @@ files:
459
463
  - lib/aspera/timer_limiter.rb
460
464
  - lib/aspera/uri_reader.rb
461
465
  - lib/aspera/web_auth.rb
466
+ - lib/aspera/web_server_simple.rb
462
467
  homepage: https://github.com/IBM/aspera-cli
463
468
  licenses:
464
469
  - Apache-2.0
@@ -485,7 +490,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
485
490
  version: '0'
486
491
  requirements:
487
492
  - Read the manual for any requirement
488
- rubygems_version: 3.1.6
493
+ rubygems_version: 3.4.6
489
494
  signing_key:
490
495
  specification_version: 4
491
496
  summary: 'Execute actions using command line on IBM Aspera Server products: Aspera
metadata.gz.sig CHANGED
Binary file