aspera-cli 4.28.0 → 4.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/BUGS.md +5 -10
  4. data/CHANGELOG.md +143 -2
  5. data/CODE_OF_CONDUCT.md +18 -0
  6. data/CONTRIBUTING.md +135 -56
  7. data/GOVERNANCE.md +30 -0
  8. data/LICENSE +201 -0
  9. data/README.md +103 -26
  10. data/SECURITY.md +70 -0
  11. data/bin/ascli +8 -5
  12. data/bin/asession +9 -6
  13. data/docs/README.md +1633 -609
  14. data/docs/test-mcp-with-ai.md +8 -8
  15. data/lib/aspera/agent/base.rb +23 -2
  16. data/lib/aspera/agent/connect.rb +16 -12
  17. data/lib/aspera/agent/desktop.rb +10 -7
  18. data/lib/aspera/agent/direct.rb +20 -19
  19. data/lib/aspera/agent/factory.rb +6 -3
  20. data/lib/aspera/agent/httpgw.rb +7 -5
  21. data/lib/aspera/agent/node.rb +15 -7
  22. data/lib/aspera/agent/transferd.rb +167 -43
  23. data/lib/aspera/api/alee.rb +4 -1
  24. data/lib/aspera/api/aoc.rb +14 -11
  25. data/lib/aspera/api/ats.rb +4 -2
  26. data/lib/aspera/api/cos_node.rb +7 -4
  27. data/lib/aspera/api/faspex.rb +16 -9
  28. data/lib/aspera/api/httpgw.rb +9 -6
  29. data/lib/aspera/api/node.rb +20 -20
  30. data/lib/aspera/ascmd.rb +8 -5
  31. data/lib/aspera/ascp/installation.rb +71 -65
  32. data/lib/aspera/ascp/log.schema.yaml +1084 -0
  33. data/lib/aspera/ascp/log_analyzer/advice.rb +97 -0
  34. data/lib/aspera/ascp/log_analyzer/diagnostics.rb +344 -0
  35. data/lib/aspera/ascp/log_analyzer/lines.rb +75 -0
  36. data/lib/aspera/ascp/log_analyzer/log_file.rb +593 -0
  37. data/lib/aspera/ascp/log_analyzer/records.rb +379 -0
  38. data/lib/aspera/ascp/log_analyzer/rules.rb +172 -0
  39. data/lib/aspera/ascp/log_analyzer/session.rb +782 -0
  40. data/lib/aspera/ascp/log_analyzer.rb +354 -0
  41. data/lib/aspera/ascp/management.rb +16 -8
  42. data/lib/aspera/ascp/session_errors.rb +217 -0
  43. data/lib/aspera/assert.rb +4 -0
  44. data/lib/aspera/cli/ascp_actions.rb +12 -19
  45. data/lib/aspera/cli/ascp_logs_actions.rb +176 -0
  46. data/lib/aspera/cli/async_transfer_store.rb +7 -4
  47. data/lib/aspera/cli/bootstrapper.rb +37 -33
  48. data/lib/aspera/cli/command_line.rb +24 -6
  49. data/lib/aspera/cli/command_registry.rb +6 -1
  50. data/lib/aspera/cli/command_spec.rb +34 -7
  51. data/lib/aspera/cli/completion/ascli.bash +19 -5
  52. data/lib/aspera/cli/completion/ascli.fish +13 -2
  53. data/lib/aspera/cli/completion/ascli.ps1 +31 -9
  54. data/lib/aspera/cli/completion/ascli.zsh +22 -6
  55. data/lib/aspera/cli/completion_actions.rb +303 -69
  56. data/lib/aspera/cli/context.rb +9 -4
  57. data/lib/aspera/cli/deprecation.rb +5 -2
  58. data/lib/aspera/cli/error.rb +3 -0
  59. data/lib/aspera/cli/extended_value.rb +61 -27
  60. data/lib/aspera/cli/formatter.rb +29 -22
  61. data/lib/aspera/cli/gem_checker.rb +9 -6
  62. data/lib/aspera/cli/hints.rb +22 -10
  63. data/lib/aspera/cli/http.rb +12 -9
  64. data/lib/aspera/cli/info.rb +12 -7
  65. data/lib/aspera/cli/mailer.rb +6 -3
  66. data/lib/aspera/cli/mcp/http_servlet.rb +7 -8
  67. data/lib/aspera/cli/mcp/secrets.rb +8 -5
  68. data/lib/aspera/cli/mcp/tool.rb +15 -14
  69. data/lib/aspera/cli/option_declarator.rb +10 -4
  70. data/lib/aspera/cli/option_registry.rb +6 -3
  71. data/lib/aspera/cli/option_types.rb +17 -2
  72. data/lib/aspera/cli/option_value.rb +65 -12
  73. data/lib/aspera/cli/options.schema.yaml +487 -63
  74. data/lib/aspera/cli/parser.rb +56 -32
  75. data/lib/aspera/cli/plugins/alee.rb +7 -4
  76. data/lib/aspera/cli/plugins/aoc.rb +244 -35
  77. data/lib/aspera/cli/plugins/ats.rb +9 -8
  78. data/lib/aspera/cli/plugins/base.rb +17 -12
  79. data/lib/aspera/cli/plugins/basic_auth.rb +5 -2
  80. data/lib/aspera/cli/plugins/config.rb +198 -103
  81. data/lib/aspera/cli/plugins/console.rb +6 -3
  82. data/lib/aspera/cli/plugins/cos.rb +8 -4
  83. data/lib/aspera/cli/plugins/factory.rb +21 -7
  84. data/lib/aspera/cli/plugins/faspex5.rb +28 -25
  85. data/lib/aspera/cli/plugins/faspio.rb +7 -5
  86. data/lib/aspera/cli/plugins/httpgw.rb +7 -4
  87. data/lib/aspera/cli/plugins/mcp.rb +28 -22
  88. data/lib/aspera/cli/plugins/node.rb +31 -30
  89. data/lib/aspera/cli/plugins/oauth.rb +5 -1
  90. data/lib/aspera/cli/plugins/orchestrator.rb +272 -72
  91. data/lib/aspera/cli/plugins/preview.rb +69 -44
  92. data/lib/aspera/cli/plugins/server.rb +63 -11
  93. data/lib/aspera/cli/plugins/shares.rb +86 -16
  94. data/lib/aspera/cli/plugins/transferd.rb +223 -0
  95. data/lib/aspera/cli/preset_actions.rb +144 -30
  96. data/lib/aspera/cli/preset_manager.rb +52 -18
  97. data/lib/aspera/cli/prompt.rb +4 -1
  98. data/lib/aspera/cli/result.rb +12 -8
  99. data/lib/aspera/cli/runner.rb +69 -46
  100. data/lib/aspera/cli/secret_finder.rb +4 -1
  101. data/lib/aspera/cli/security.rb +79 -9
  102. data/lib/aspera/cli/special_values.rb +4 -1
  103. data/lib/aspera/cli/sync_actions.rb +13 -10
  104. data/lib/aspera/cli/table_fitter.rb +3 -0
  105. data/lib/aspera/cli/terminal_formatter.rb +9 -6
  106. data/lib/aspera/cli/transfer_actions.rb +11 -8
  107. data/lib/aspera/cli/transfer_agent.rb +29 -20
  108. data/lib/aspera/cli/transfer_progress.rb +13 -45
  109. data/lib/aspera/cli/vault_actions.rb +45 -0
  110. data/lib/aspera/cli/vault_manager.rb +188 -42
  111. data/lib/aspera/cli/version.rb +4 -1
  112. data/lib/aspera/cli/web_secret.rb +12 -10
  113. data/lib/aspera/cli/wizard.rb +42 -39
  114. data/lib/aspera/command_line_builder.rb +9 -5
  115. data/lib/aspera/command_line_converter.rb +4 -1
  116. data/lib/aspera/coverage.rb +103 -33
  117. data/lib/aspera/data_repository.rb +4 -1
  118. data/lib/aspera/dot_container.rb +4 -1
  119. data/lib/aspera/duration.rb +5 -2
  120. data/lib/aspera/environment.rb +21 -12
  121. data/lib/aspera/exec_spec.rb +3 -0
  122. data/lib/aspera/faspex_gw.rb +13 -9
  123. data/lib/aspera/faspex_postproc.rb +15 -12
  124. data/lib/aspera/formatter_interface.rb +4 -1
  125. data/lib/aspera/graphql.rb +5 -1
  126. data/lib/aspera/hash_ext.rb +3 -0
  127. data/lib/aspera/id_generator.rb +4 -2
  128. data/lib/aspera/json_rpc/client.rb +6 -5
  129. data/lib/aspera/json_rpc/version.rb +3 -0
  130. data/lib/aspera/line_logger.rb +4 -1
  131. data/lib/aspera/link_header.rb +4 -1
  132. data/lib/aspera/log.rb +18 -5
  133. data/lib/aspera/markdown.rb +5 -2
  134. data/lib/aspera/mime.rb +3 -0
  135. data/lib/aspera/nagios.rb +6 -4
  136. data/lib/aspera/node_emulator.rb +15 -13
  137. data/lib/aspera/oauth/client/base.rb +91 -70
  138. data/lib/aspera/oauth/client/boot.rb +7 -4
  139. data/lib/aspera/oauth/client/factory.rb +6 -3
  140. data/lib/aspera/oauth/client/generic.rb +5 -1
  141. data/lib/aspera/oauth/client/json_credentials.rb +4 -1
  142. data/lib/aspera/oauth/client/jwt.rb +6 -3
  143. data/lib/aspera/oauth/client/shares_web.rb +85 -0
  144. data/lib/aspera/oauth/client/url_json.rb +4 -1
  145. data/lib/aspera/oauth/client/web.rb +39 -12
  146. data/lib/aspera/oauth/server/pkce.rb +6 -5
  147. data/lib/aspera/orchestrator_workflow_checker.rb +119 -1
  148. data/lib/aspera/persistency_action_once.rb +5 -3
  149. data/lib/aspera/persistency_folder.rb +6 -3
  150. data/lib/aspera/preview/file_types.rb +6 -3
  151. data/lib/aspera/preview/generator.rb +9 -5
  152. data/lib/aspera/preview/options.schema.yaml +3 -3
  153. data/lib/aspera/preview/terminal.rb +8 -4
  154. data/lib/aspera/preview/utils.rb +6 -4
  155. data/lib/aspera/products/connect.rb +5 -2
  156. data/lib/aspera/products/desktop.rb +4 -1
  157. data/lib/aspera/products/other.rb +4 -2
  158. data/lib/aspera/products/transferd.rb +6 -2
  159. data/lib/aspera/products/transferd_service.rb +610 -0
  160. data/lib/aspera/proxy_auto_config.js +2 -2
  161. data/lib/aspera/proxy_auto_config.rb +5 -2
  162. data/lib/aspera/rainbow.rb +3 -0
  163. data/lib/aspera/rest/aspera_errors.rb +4 -1
  164. data/lib/aspera/rest/call_error.rb +3 -0
  165. data/lib/aspera/rest/client.rb +22 -29
  166. data/lib/aspera/rest/error_analyzer.rb +5 -2
  167. data/lib/aspera/rest/list.rb +8 -4
  168. data/lib/aspera/rest/parameters.rb +3 -0
  169. data/lib/aspera/rest/util.rb +8 -5
  170. data/lib/aspera/rest.rb +9 -6
  171. data/lib/aspera/schema/IBM Aspera Faspex API-5.0-enhanced.yaml +9 -9
  172. data/lib/aspera/schema/IBM Aspera Orchestrator API-v1-enhanced.yaml +118 -30
  173. data/lib/aspera/schema/IBM Aspera on Cloud API-0.2.6-enhanced.yaml +11 -11
  174. data/lib/aspera/schema/IBM Aspera on Cloud Automation API-1.0.5-enhanced.yaml +2437 -1437
  175. data/lib/aspera/schema/async_tables.yaml +11 -10
  176. data/lib/aspera/schema/documentation.rb +8 -2
  177. data/lib/aspera/schema/reader.rb +7 -0
  178. data/lib/aspera/schema/registry.rb +43 -28
  179. data/lib/aspera/schema/transferd-config.schema.json +333 -0
  180. data/lib/aspera/schema/validator.rb +4 -1
  181. data/lib/aspera/sealed_hash.rb +166 -0
  182. data/lib/aspera/secret/hider.rb +201 -0
  183. data/lib/aspera/secret/reference.rb +150 -0
  184. data/lib/aspera/secret/resolver.rb +212 -0
  185. data/lib/aspera/secret/store/base.rb +153 -0
  186. data/lib/aspera/secret/store/encrypted_hash.rb +329 -0
  187. data/lib/aspera/secret/store/factory.rb +103 -0
  188. data/lib/aspera/secret/store/hashicorp_vault.rb +390 -0
  189. data/lib/aspera/secret/store/keeper.rb +141 -0
  190. data/lib/aspera/secret/store/macos_security.rb +284 -0
  191. data/lib/aspera/secret/store/one_password_api.rb +99 -0
  192. data/lib/aspera/secret/store/one_password_base.rb +42 -0
  193. data/lib/aspera/secret/store/one_password_cli.rb +110 -0
  194. data/lib/aspera/secret/store/secret_service.rb +125 -0
  195. data/lib/aspera/secret/strength.rb +119 -0
  196. data/lib/aspera/servlet_helpers.rb +5 -2
  197. data/lib/aspera/ssh.rb +10 -7
  198. data/lib/aspera/ssl.rb +5 -2
  199. data/lib/aspera/string_ext.rb +3 -0
  200. data/lib/aspera/sync/args.schema.yaml +3 -0
  201. data/lib/aspera/sync/conf.schema.yaml +9 -4
  202. data/lib/aspera/sync/database.rb +3 -0
  203. data/lib/aspera/sync/operations.rb +16 -14
  204. data/lib/aspera/temp_file_manager.rb +8 -4
  205. data/lib/aspera/timer_limiter.rb +3 -0
  206. data/lib/aspera/transfer/error.rb +4 -1
  207. data/lib/aspera/transfer/faux_file.rb +4 -1
  208. data/lib/aspera/transfer/parameters.rb +17 -14
  209. data/lib/aspera/transfer/result.rb +3 -0
  210. data/lib/aspera/transfer/resumer.rb +6 -4
  211. data/lib/aspera/transfer/spec.rb +9 -22
  212. data/lib/aspera/transfer/units.rb +75 -0
  213. data/lib/aspera/uri_reader.rb +57 -7
  214. data/lib/aspera/web_auth/index.html.erb +6 -2
  215. data/lib/aspera/web_auth/paste.rb +109 -0
  216. data/lib/aspera/web_auth/receiver.rb +50 -0
  217. data/lib/aspera/web_auth/relay.rb +76 -0
  218. data/lib/aspera/web_auth/reply.html.erb +150 -0
  219. data/lib/aspera/web_auth/server.rb +47 -10
  220. data/lib/aspera/web_page.rb +7 -2
  221. data/lib/aspera/web_server_simple.rb +6 -3
  222. data/lib/aspera/yaml.rb +5 -1
  223. data/llms.txt +81 -0
  224. data/skills/ascli/SKILL.md +88 -0
  225. data.tar.gz.sig +0 -0
  226. metadata +72 -19
  227. metadata.gz.sig +0 -0
  228. data/lib/aspera/keychain/base.rb +0 -30
  229. data/lib/aspera/keychain/encrypted_hash.rb +0 -192
  230. data/lib/aspera/keychain/factory.rb +0 -58
  231. data/lib/aspera/keychain/hashicorp_vault.rb +0 -77
  232. data/lib/aspera/keychain/macos_security.rb +0 -277
  233. data/lib/aspera/keychain/one_password_api.rb +0 -91
  234. data/lib/aspera/keychain/one_password_base.rb +0 -39
  235. data/lib/aspera/keychain/one_password_cli.rb +0 -100
  236. data/lib/aspera/secret_hider.rb +0 -196
  237. data/lib/aspera/secret_strength.rb +0 -114
@@ -1,3 +1,4 @@
1
+ # cspell:ignore cksum parentrid peerxfer SSDB SSSTATE xferres
1
2
  # Schema for the SQLite tables inside the Async snap database (snap.db).
2
3
  # Sources:
3
4
  # include/async/session/Sqlite3_SSDB.h (SYNC_SQLITE3_META_SCHEMA, SYNC_SQLITE3_COUNTERS_SCHEMA, SYNC_SQLITE3_SCHEMA_1_0)
@@ -14,19 +15,19 @@ properties:
14
15
  description: One row per session, written at start and updated at stop.
15
16
  type: object
16
17
  properties:
17
- dbversion:
18
+ dbversion: # cspell:disable-line
18
19
  description: Database schema version.
19
20
  type: string
20
- pairname:
21
+ pairname: # cspell:disable-line
21
22
  description: Sync session name.
22
23
  type: string
23
- ldir:
24
+ ldir: # cspell:disable-line
24
25
  description: Local directory path.
25
26
  type: string
26
- rhost:
27
+ rhost: # cspell:disable-line
27
28
  description: Remote host.
28
29
  type: string
29
- rdir:
30
+ rdir: # cspell:disable-line
30
31
  description: Remote directory path.
31
32
  type: string
32
33
  direction:
@@ -68,7 +69,7 @@ properties:
68
69
  sync_point:
69
70
  description: Synchronization point sequence number.
70
71
  type: integer
71
- max_recid:
72
+ max_recid: # cspell:disable-line
72
73
  description: Highest record ID allocated in the snapshot table.
73
74
  type: integer
74
75
  sync_uuid:
@@ -308,7 +309,7 @@ properties:
308
309
  f_cont_timestamp:
309
310
  description: Filesystem content — internal timestamp.
310
311
  type: integer
311
- pcr_reqno:
312
+ pcr_reqno: # cspell:disable-line
312
313
  description: Peer content request sequence number.
313
314
  type: integer
314
315
  pp_cont_size:
@@ -323,7 +324,7 @@ properties:
323
324
  pp_cont_timestamp:
324
325
  description: Peer pending content — internal timestamp.
325
326
  type: integer
326
- tobe_deleted:
327
+ tobe_deleted: # cspell:disable-line
327
328
  description: Set to 1 when the record is flagged for deletion (garbage collection pending).
328
329
  type: integer
329
330
  scn_not_visited:
@@ -338,10 +339,10 @@ properties:
338
339
  candidate_in_prog:
339
340
  description: Set to 1 when this record is currently in the candidate transfer list.
340
341
  type: integer
341
- meta_lastreq_no:
342
+ meta_lastreq_no: # cspell:disable-line
342
343
  description: Sequence number of the last metadata request sent.
343
344
  type: integer
344
- meta_lastresp_no:
345
+ meta_lastresp_no: # cspell:disable-line
345
346
  description: Sequence number of the last metadata response received.
346
347
  type: integer
347
348
  commit_version:
@@ -1,5 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # SPDX-FileCopyrightText: IBM Corp.
4
+ # SPDX-License-Identifier: Apache-2.0
5
+
3
6
  module Aspera
4
7
  module Schema
5
8
  # Generate documentation from a JSON Schema: in terminal and in manual.
@@ -36,7 +39,7 @@ module Aspera
36
39
 
37
40
  def rows
38
41
  @sections.flat_map do |section|
39
- sorted = section[:rows].sort_by { |i| i['name'] }
42
+ sorted = section[:rows].sort_by { |i| i['name'].delete('`') }
40
43
  section[:header] ? [section[:header]] + sorted : sorted
41
44
  end
42
45
  end
@@ -82,6 +85,7 @@ module Aspera
82
85
  next if annotations.nil?
83
86
  item = {'name' => code.call(property_full_name)}
84
87
  item_type = type_text(node)
88
+ item_type = "Enum[#{item_type}]" if node.key?('enum') && !item_type.nil?
85
89
  item['type'] = code.call(item_type) unless item_type.nil?
86
90
  @extra_columns.each { |column, value| item[column] = value.call(node, @formatter) }
87
91
  description = []
@@ -91,7 +95,9 @@ module Aspera
91
95
  description.push('Required.') if required
92
96
  description.push("Allowed values: #{node['enum'].map { |v| value_text(v) }.join(', ')}.") if node.key?('enum')
93
97
  description.push("Default: #{value_text(node['default'])}.") if node.key?('default')
94
- description.push("Example: #{value_text(node['example'])}.") if node.key?('example')
98
+ # OpenAPI 3.1: `examples` array (3.0: `example`)
99
+ example = node.key?('examples') ? Array(node['examples']).first : node['example']
100
+ description.push("Example: #{value_text(example)}.") unless example.nil?
95
101
  description.concat(annotations)
96
102
  item['description'] = description unless description.empty?
97
103
  @sections.last[:rows].push(item)
@@ -1,5 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # SPDX-FileCopyrightText: IBM Corp.
4
+ # SPDX-License-Identifier: Apache-2.0
5
+
6
+ require_relative '../assert'
7
+
3
8
  module Aspera
4
9
  # base class for plugins modules
5
10
  module Schema
@@ -155,6 +160,7 @@ module Aspera
155
160
  # description [String] human description (may contain Markdown **bold** / `code`)
156
161
  # default [Object] (optional) default value as native Ruby type
157
162
  # enum [Array] (optional) list of allowed string values
163
+ # complete [String] (optional) kind of value proposed by shell completion (`x-cli-complete`), e.g. `file`
158
164
  #
159
165
  # @return [Array<Hash>]
160
166
  def to_rows
@@ -204,6 +210,7 @@ module Aspera
204
210
  }
205
211
  row['default'] = node['default'] if node.key?('default')
206
212
  row['enum'] = node['enum'] if node.key?('enum')
213
+ row['complete'] = node['x-cli-complete'] if node.key?('x-cli-complete')
207
214
  rows << row
208
215
  # Recurse into nested object or array-of-objects (`type` is a list for a nullable value)
209
216
  types = Array(node['type'])
@@ -1,8 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # SPDX-FileCopyrightText: IBM Corp.
4
+ # SPDX-License-Identifier: Apache-2.0
5
+
6
+ require_relative '../assert'
7
+ require_relative '../yaml'
8
+ require_relative 'reader'
3
9
  require 'singleton'
4
- require 'aspera/yaml'
5
- require 'aspera/schema/reader'
6
10
 
7
11
  module Aspera
8
12
  # base class for plugins modules
@@ -67,11 +71,13 @@ module Aspera
67
71
  node: 'aspera/schema/IBM Aspera Node API-4.4.6.yaml',
68
72
  shares: 'aspera/schema/IBM_Aspera_Shares.yaml',
69
73
  orchestrator: 'aspera/schema/IBM Aspera Orchestrator API-v1-enhanced.yaml',
70
- async_tables: 'aspera/schema/async_tables.yaml'
71
- }
74
+ async_tables: 'aspera/schema/async_tables.yaml',
75
+ ascp_log: 'aspera/ascp/log.schema.yaml',
76
+ transferd: 'aspera/schema/transferd-config.schema.json'
77
+ }.freeze
72
78
 
73
79
  # Schemas owned by ascli: values are validated against them (vendor API schemas are validated by the API)
74
- OWNED = %i[spec args conf opts preview async_tables].freeze
80
+ OWNED = %i[spec args conf opts preview async_tables ascp_log transferd].freeze
75
81
 
76
82
  OPTIONS = 'opts'
77
83
  TRANSFER_SPEC = 'spec'
@@ -87,26 +93,35 @@ module Aspera
87
93
  ORCHESTRATOR = 'orchestrator'
88
94
  SHARES = 'shares+/api/v1'
89
95
  ASYNC_TABLES = 'async_tables'
90
- LOG_OPTIONS = "#{OPTIONS}:components.schemas.LogOptions"
91
- UI_OPTIONS = "#{OPTIONS}:components.schemas.UiOptions"
92
- SECURITY_OPTIONS = "#{OPTIONS}:components.schemas.SecurityOptions"
93
- TEMP_OPTIONS = "#{OPTIONS}:components.schemas.TempOptions"
94
- DIRECT_AGENT_OPTIONS = "#{OPTIONS}:components.schemas.DirectAgentOptions"
95
- NODE_AGENT_OPTIONS = "#{OPTIONS}:components.schemas.NodeAgentOptions"
96
- NODE_EMULATOR_OPTIONS = "#{OPTIONS}:components.schemas.NodeEmulatorOptions"
97
- HTTPGW_AGENT_OPTIONS = "#{OPTIONS}:components.schemas.HttpgwAgentOptions"
98
- TRANSFERD_AGENT_OPTIONS = "#{OPTIONS}:components.schemas.TransferdAgentOptions"
99
- TRANSFER_AGENT_OPTIONS = "#{OPTIONS}:components.schemas.TransferAgentOptions"
100
- SMTP_OPTIONS = "#{OPTIONS}:components.schemas.SmtpOptions"
101
- HTTP_OPTIONS = "#{OPTIONS}:components.schemas.HttpOptions"
102
- VAULT_OPTIONS = "#{OPTIONS}:components.schemas.VaultOptions"
103
- VAULT_SECRET = "#{OPTIONS}:components.schemas.VaultSecret"
104
- IMAGE_OPTIONS = "#{OPTIONS}:components.schemas.ImageOptions"
105
- OUT_OPTIONS = "#{OPTIONS}:components.schemas.OutOptions"
106
- PACKAGE_FOLDER_OPTIONS = "#{OPTIONS}:components.schemas.PackageFolderOptions"
107
- WEB_SERVER_OPTIONS = "#{OPTIONS}:components.schemas.WebServerOptions"
108
- GATEWAY_OPTIONS = "#{OPTIONS}:components.schemas.Faspex4GatewayOptions"
109
- POSTPROC_OPTIONS = "#{OPTIONS}:components.schemas.Faspex4PostProcOptions"
96
+ ASCP_LOG = 'ascp_log'
97
+ LOG_OPTIONS = "#{OPTIONS}:components.schemas.LogOptions".freeze
98
+ UI_OPTIONS = "#{OPTIONS}:components.schemas.UiOptions".freeze
99
+ SECURITY_OPTIONS = "#{OPTIONS}:components.schemas.SecurityOptions".freeze
100
+ TEMP_OPTIONS = "#{OPTIONS}:components.schemas.TempOptions".freeze
101
+ DIRECT_AGENT_OPTIONS = "#{OPTIONS}:components.schemas.DirectAgentOptions".freeze
102
+ NODE_AGENT_OPTIONS = "#{OPTIONS}:components.schemas.NodeAgentOptions".freeze
103
+ NODE_EMULATOR_OPTIONS = "#{OPTIONS}:components.schemas.NodeEmulatorOptions".freeze
104
+ HTTPGW_AGENT_OPTIONS = "#{OPTIONS}:components.schemas.HttpgwAgentOptions".freeze
105
+ TRANSFERD_AGENT_OPTIONS = "#{OPTIONS}:components.schemas.TransferdAgentOptions".freeze
106
+ TRANSFER_AGENT_OPTIONS = "#{OPTIONS}:components.schemas.TransferAgentOptions".freeze
107
+ SMTP_OPTIONS = "#{OPTIONS}:components.schemas.SmtpOptions".freeze
108
+ SERVICE_OPTIONS = "#{OPTIONS}:components.schemas.ServiceOptions".freeze
109
+ TRANSFERD_SERVICE_CONFIG = "#{OPTIONS}:components.schemas.TransferdServiceConfig".freeze
110
+ HTTP_OPTIONS = "#{OPTIONS}:components.schemas.HttpOptions".freeze
111
+ VAULT_OPTIONS = "#{OPTIONS}:components.schemas.VaultOptions".freeze
112
+ VAULT_SECRET = "#{OPTIONS}:components.schemas.VaultSecret".freeze
113
+ VAULT_STORE = "#{OPTIONS}:components.schemas.VaultStore".freeze
114
+ VAULT_STORES = "#{OPTIONS}:components.schemas.VaultStores".freeze
115
+ DETECT_OPTIONS = "#{OPTIONS}:components.schemas.DetectOptions".freeze
116
+ PRESET_LOOKUP_CRITERIA = "#{OPTIONS}:components.schemas.PresetLookupCriteria".freeze
117
+ WIZARD_OPTIONS = "#{OPTIONS}:components.schemas.WizardOptions".freeze
118
+ IMAGE_OPTIONS = "#{OPTIONS}:components.schemas.ImageOptions".freeze
119
+ ASCP_LOGS_OPTIONS = "#{OPTIONS}:components.schemas.AscpLogsOptions".freeze
120
+ OUT_OPTIONS = "#{OPTIONS}:components.schemas.OutOptions".freeze
121
+ PACKAGE_FOLDER_OPTIONS = "#{OPTIONS}:components.schemas.PackageFolderOptions".freeze
122
+ WEB_SERVER_OPTIONS = "#{OPTIONS}:components.schemas.WebServerOptions".freeze
123
+ GATEWAY_OPTIONS = "#{OPTIONS}:components.schemas.Faspex4GatewayOptions".freeze
124
+ POSTPROC_OPTIONS = "#{OPTIONS}:components.schemas.Faspex4PostProcOptions".freeze
110
125
 
111
126
  REQ_BODY = '.requestBody.content.application/json.schema'
112
127
  # Suffix appended to a dotted path to signal query-param extraction in reader()
@@ -119,7 +134,7 @@ module Aspera
119
134
 
120
135
  # Read schema from file or from cache.
121
136
  # When name_path ends with QUERY_PARAMS_SUFFIX, the OAS `parameters` array at that path
122
- # is synthesised into an object schema via Reader.from_query_params instead of navigating
137
+ # is synthesized into an object schema via Reader.from_query_params instead of navigating
123
138
  # into the tree.
124
139
  # @param name_path [String] registry key with optional colon-separated dotted path suffix,
125
140
  # e.g. "faspex:paths./packages.get.parameters" or "faspex:paths./packages.post.requestBody..."
@@ -129,8 +144,8 @@ module Aspera
129
144
  sym = name.to_sym
130
145
  Aspera.assert(Registry.known?(sym)) { "schema: #{sym}" }
131
146
  spec_file = File.join(@main_folder, LOCATIONS[sym])
132
- @cache[sym] = Yaml.safe_load(File.read(spec_file)) if spec_file.end_with?('.yaml') && !@cache.key?(sym)
133
- @cache[sym] = JSON.parse(File.read(spec_file)) if spec_file.end_with?('.json') && !@cache.key?(sym)
147
+ # JSON is read with the YAML loader: it accepts the header comment added by `rake tools:openapi`
148
+ @cache[sym] = Yaml.safe_load(File.read(spec_file)) unless @cache.key?(sym)
134
149
  # Query-params path: strip the suffix, navigate to the operation node, extract parameters
135
150
  if path&.end_with?(QUERY_PARAMS_SUFFIX)
136
151
  parent_path = path.delete_suffix(QUERY_PARAMS_SUFFIX)
@@ -0,0 +1,333 @@
1
+ # DO NOT EDIT THIS FILE MANUALLY
2
+ # This file is automatically downloaded from:
3
+ # https://raw.githubusercontent.com/laurent-martin/aspera-api-examples/refs/heads/main/openapi/transferd-config.schema.json
4
+ # Use 'rake tools:openapi' to update this file
5
+
6
+ {
7
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
8
+ "$comment": "Matches transferd 1.1.10 (source of truth: internal/config/config.go in the transferd repository). Durations are in seconds.",
9
+ "title": "IBM Aspera Transfer SDK daemon (transferd) configuration",
10
+ "description": "Configuration file of transferd, in JSON or YAML. Without option --config (-c), transferd reads ../etc/transferd.json relative to the directory of the transferd executable, then /etc/transferd/transferd.json, and if neither exists uses built-in defaults. transferd ignores unknown keys, so a misspelled key silently has no effect: validate the file against this schema to catch it.",
11
+ "type": "object",
12
+ "additionalProperties": false,
13
+ "properties": {
14
+ "$schema": {
15
+ "type": "string",
16
+ "description": "Optional URI or path of this schema, used by editors for completion and validation. Ignored by transferd."
17
+ },
18
+ "log_directory": {
19
+ "type": "string",
20
+ "description": "Directory of the transferd log file transferd.log (rotated at 10 MiB, 10 files kept). A relative path is resolved from the directory of the transferd executable. The directory is created if missing. Empty or omitted: logs are written to standard output.",
21
+ "examples": ["/var/log/aspera", "../var/log"]
22
+ },
23
+ "log_level": {
24
+ "type": "string",
25
+ "description": "Level of detail of the transferd log, from most (trace) to least (panic) verbose. Omitted or unrecognized value: info.",
26
+ "enum": ["trace", "debug", "info", "warning", "error", "fatal", "panic"],
27
+ "default": "info"
28
+ },
29
+ "log_format": {
30
+ "type": "string",
31
+ "description": "Format of the transferd log: text for human-readable lines, json for one JSON object per line. Any value other than text gives json.",
32
+ "enum": ["text", "json"],
33
+ "default": "text"
34
+ },
35
+ "address": {
36
+ "type": "string",
37
+ "description": "IP address or host name on which the gRPC API listens. Use 0.0.0.0 to listen on all IPv4 interfaces (for example in a container); when not listening on a loopback address, consider enabling tls and authentication. Overridden by environment variable TRANSFERD_ADDRESS, and by option --address (-a), which takes precedence.",
38
+ "default": "127.0.0.1",
39
+ "examples": ["127.0.0.1", "0.0.0.0"]
40
+ },
41
+ "port": {
42
+ "type": "integer",
43
+ "description": "TCP port on which the gRPC API listens. 0 or omitted: a free port is selected at startup; it is written in the log and in file transferd.<port>.optport of runtime_dir. The configuration file shipped with the SDK sets 55002. Overridden by environment variable TRANSFERD_PORT, and by option --port (-p), which takes precedence.",
44
+ "minimum": 0,
45
+ "maximum": 65535,
46
+ "default": 0,
47
+ "examples": [55002]
48
+ },
49
+ "runtime_dir": {
50
+ "type": "string",
51
+ "description": "Directory for runtime files. When port is 0, transferd writes the selected port in file transferd.<port>.optport there. Created with owner-only permissions if missing. Omitted: ../var/run/aspera relative to the directory of the transferd executable.",
52
+ "examples": ["/var/run/aspera"]
53
+ },
54
+ "reflection": {
55
+ "type": "boolean",
56
+ "description": "Enables the gRPC server reflection service, so that tools such as `grpcurl` or `grpcui` can list and call the API without the transferd.proto file. Useful for debugging; leave disabled otherwise.",
57
+ "default": false
58
+ },
59
+ "workers": {
60
+ "type": "object",
61
+ "description": "Transfer execution and retention.",
62
+ "additionalProperties": false,
63
+ "properties": {
64
+ "max_concurrent": {
65
+ "type": "integer",
66
+ "description": "Maximum number of transfers running at the same time. Additional transfers wait in a queue until a running one ends. 0 or omitted: 100.",
67
+ "minimum": 0,
68
+ "default": 100,
69
+ "examples": [10]
70
+ },
71
+ "transfer_cleaning_period": {
72
+ "type": "integer",
73
+ "description": "Interval, in seconds, at which transferd removes ended transfers older than transfer_max_age. 0 or omitted: 3600 (1 hour).",
74
+ "minimum": 0,
75
+ "default": 3600
76
+ },
77
+ "transfer_max_age": {
78
+ "type": "integer",
79
+ "description": "Time, in seconds, during which an ended transfer remains known to transferd (status queries, events) before it can be removed. Removal happens at the next cleaning, so a transfer may remain up to transfer_max_age + transfer_cleaning_period. 0 or omitted: 7200 (2 hours).",
80
+ "minimum": 0,
81
+ "default": 7200,
82
+ "examples": [86400]
83
+ }
84
+ }
85
+ },
86
+ "fasp_management": {
87
+ "type": "object",
88
+ "description": "Management port on which the ascp processes started by transferd report transfer progress.",
89
+ "additionalProperties": false,
90
+ "properties": {
91
+ "promiscuous_mode_enabled": {
92
+ "type": "boolean",
93
+ "description": "When true, transferd also reports transfers of ascp processes that it did not start. So that those processes find the management port, transferd writes it in file transferd.<port>.optport of directory ../var/run/aspera, relative to the FASP runtime bin directory. Those ascp processes must use the same FASP runtime as transferd (see fasp_runtime).",
94
+ "default": false
95
+ },
96
+ "port": {
97
+ "type": "integer",
98
+ "description": "TCP port of the management server. 0 or omitted: a free port is selected at startup. Overridden by environment variable TRANSFERD_MGMT_PORT, and by option --mgmtport (-P), which takes precedence.",
99
+ "minimum": 0,
100
+ "maximum": 65535,
101
+ "default": 0,
102
+ "examples": [23456]
103
+ },
104
+ "address": {
105
+ "type": "string",
106
+ "description": "IP address on which the management server listens. Change it only when ascp must reach transferd through an interface other than loopback. Overridden by environment variable TRANSFERD_MGMT_ADDRESS, and by option --mgmtaddress (-A), which takes precedence.",
107
+ "default": "127.0.0.1",
108
+ "examples": ["127.0.0.1"]
109
+ }
110
+ }
111
+ },
112
+ "fasp_runtime": {
113
+ "type": "object",
114
+ "description": "FASP runtime (ascp, async, license, aspera.conf) used for transfers. Omitted: the runtime embedded in the SDK is used. When this section is present, set use_embedded explicitly: if it is not true, user_defined is required.",
115
+ "additionalProperties": false,
116
+ "properties": {
117
+ "use_embedded": {
118
+ "type": "boolean",
119
+ "description": "true: use the FASP runtime embedded in the SDK, and ignore user_defined. false: use the runtime located by user_defined. Omitted while the fasp_runtime section is present: false.",
120
+ "examples": [true]
121
+ },
122
+ "force_version": {
123
+ "type": "string",
124
+ "description": "Accepted for backward compatibility. Has no effect.",
125
+ "deprecated": true
126
+ },
127
+ "user_defined": {
128
+ "type": "object",
129
+ "description": "Location of a separately installed FASP runtime. Required when use_embedded is not true, ignored otherwise. Both directories must exist at startup.",
130
+ "additionalProperties": false,
131
+ "required": ["bin", "etc"],
132
+ "properties": {
133
+ "bin": {
134
+ "type": "string",
135
+ "description": "Directory containing the ascp and async executables. A relative path is resolved from the working directory of transferd.",
136
+ "minLength": 1,
137
+ "examples": ["/opt/aspera/bin"]
138
+ },
139
+ "etc": {
140
+ "type": "string",
141
+ "description": "Directory containing the license file aspera-license and the configuration file aspera.conf. A relative path is resolved from the working directory of transferd.",
142
+ "minLength": 1,
143
+ "examples": ["/opt/aspera/etc"]
144
+ }
145
+ }
146
+ },
147
+ "log": {
148
+ "type": "object",
149
+ "description": "Default logging of ascp, for transfers whose request configuration does not set localLog or logLevel. Does not apply to async.",
150
+ "additionalProperties": false,
151
+ "properties": {
152
+ "dir": {
153
+ "type": "string",
154
+ "description": "Directory where ascp writes its log (ascp option -L). Empty or omitted: default location of ascp.",
155
+ "examples": ["/var/log/aspera"]
156
+ },
157
+ "level": {
158
+ "type": "integer",
159
+ "description": "Level of detail of the ascp log: 0 for basic information (files transferred, transfer rate), 1 to 4 for increasingly detailed debug messages (ascp options -D to -DDDD).",
160
+ "minimum": 0,
161
+ "maximum": 4,
162
+ "default": 0
163
+ }
164
+ }
165
+ },
166
+ "extra_config": {
167
+ "type": "array",
168
+ "description": "Extra command line options added to the executables started for transfers. Does not apply to async.",
169
+ "items": {
170
+ "type": "object",
171
+ "additionalProperties": false,
172
+ "required": ["command"],
173
+ "properties": {
174
+ "command": {
175
+ "type": "string",
176
+ "description": "End of the path of the executable to which options are added, for example ascp (ascp.exe on Windows). Only the first matching entry is used.",
177
+ "minLength": 1,
178
+ "examples": ["ascp", "ascp.exe"]
179
+ },
180
+ "options": {
181
+ "type": "array",
182
+ "description": "Options added to the command line, one argument per item, before the transfer arguments.",
183
+ "items": {
184
+ "type": "string"
185
+ },
186
+ "examples": [["--save-before-overwrite"]]
187
+ }
188
+ }
189
+ }
190
+ }
191
+ },
192
+ "if": {
193
+ "required": ["use_embedded"],
194
+ "properties": {
195
+ "use_embedded": {
196
+ "const": true
197
+ }
198
+ }
199
+ },
200
+ "else": {
201
+ "required": ["user_defined"]
202
+ }
203
+ },
204
+ "tls": {
205
+ "type": "object",
206
+ "description": "TLS for the gRPC API. When enabled, clients must connect using TLS.",
207
+ "additionalProperties": false,
208
+ "properties": {
209
+ "enabled": {
210
+ "type": "boolean",
211
+ "description": "Enables TLS. certificate and key are then required.",
212
+ "default": false
213
+ },
214
+ "certificate": {
215
+ "type": "string",
216
+ "description": "Path of the PEM server certificate file, which may include intermediate certificates. A relative path is resolved from the working directory of transferd.",
217
+ "minLength": 1,
218
+ "examples": ["/etc/transferd/server.crt"]
219
+ },
220
+ "key": {
221
+ "type": "string",
222
+ "description": "Path of the PEM private key file matching certificate. A relative path is resolved from the working directory of transferd.",
223
+ "minLength": 1,
224
+ "examples": ["/etc/transferd/server.key"]
225
+ },
226
+ "min_tls_version": {
227
+ "type": "string",
228
+ "description": "Minimum TLS version accepted from clients. Omitted or other value: TLSv12.",
229
+ "enum": ["TLSv12", "TLSv13"],
230
+ "default": "TLSv12"
231
+ }
232
+ },
233
+ "if": {
234
+ "required": ["enabled"],
235
+ "properties": {
236
+ "enabled": {
237
+ "const": true
238
+ }
239
+ }
240
+ },
241
+ "then": {
242
+ "required": ["certificate", "key"]
243
+ }
244
+ },
245
+ "authentication": {
246
+ "type": "object",
247
+ "description": "API key authentication of clients of the gRPC API.",
248
+ "additionalProperties": false,
249
+ "properties": {
250
+ "enabled": {
251
+ "type": "boolean",
252
+ "description": "Requires every call to carry the API key; other calls are rejected with status UNAUTHENTICATED. api_key is then required.",
253
+ "default": false
254
+ },
255
+ "api_key": {
256
+ "type": "string",
257
+ "description": "Value that clients must send in gRPC request metadata entry api_key. It is stored in clear text: restrict read access to this file.",
258
+ "minLength": 1,
259
+ "examples": ["change-me-to-a-long-random-value"]
260
+ }
261
+ },
262
+ "if": {
263
+ "required": ["enabled"],
264
+ "properties": {
265
+ "enabled": {
266
+ "const": true
267
+ }
268
+ }
269
+ },
270
+ "then": {
271
+ "required": ["api_key"]
272
+ }
273
+ },
274
+ "api_time_settings": {
275
+ "type": "object",
276
+ "description": "Keepalive and connection lifetime settings of the gRPC API server, in seconds.",
277
+ "additionalProperties": false,
278
+ "properties": {
279
+ "max_conn_idle": {
280
+ "type": "integer",
281
+ "description": "Time after which a client connection with no ongoing call is closed. 0 or omitted: 86400 (24 hours).",
282
+ "minimum": 0,
283
+ "default": 86400,
284
+ "examples": [120]
285
+ },
286
+ "max_conn_age": {
287
+ "type": "integer",
288
+ "description": "Maximum lifetime of a client connection, with a random variation of +/-10%; the client must then reconnect. 0 or omitted: no limit.",
289
+ "minimum": 0,
290
+ "default": 0,
291
+ "examples": [3600]
292
+ },
293
+ "max_conn_age_grace": {
294
+ "type": "integer",
295
+ "description": "Additional time given to ongoing calls once max_conn_age is reached, before the connection is forcibly closed. 0 or omitted: no limit.",
296
+ "minimum": 0,
297
+ "default": 0,
298
+ "examples": [10]
299
+ },
300
+ "time": {
301
+ "type": "integer",
302
+ "description": "Time without activity from a client after which the server pings it to check that the connection is still alive. 0 or omitted: 7200 (2 hours).",
303
+ "minimum": 0,
304
+ "default": 7200,
305
+ "examples": [60]
306
+ },
307
+ "timeout": {
308
+ "type": "integer",
309
+ "description": "Time the server waits for activity after a keepalive ping before closing the connection. 0 or omitted: 20.",
310
+ "minimum": 0,
311
+ "default": 20,
312
+ "examples": [3]
313
+ }
314
+ }
315
+ }
316
+ },
317
+ "examples": [
318
+ {
319
+ "address": "127.0.0.1",
320
+ "port": 55002,
321
+ "workers": {
322
+ "max_concurrent": 10
323
+ },
324
+ "fasp_management": {
325
+ "promiscuous_mode_enabled": false,
326
+ "port": 23456
327
+ },
328
+ "fasp_runtime": {
329
+ "use_embedded": true
330
+ }
331
+ }
332
+ ]
333
+ }
@@ -1,8 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # SPDX-FileCopyrightText: IBM Corp.
4
+ # SPDX-License-Identifier: Apache-2.0
5
+
6
+ require_relative 'registry'
3
7
  require 'singleton'
4
8
  require 'json'
5
- require 'aspera/schema/registry'
6
9
 
7
10
  module Aspera
8
11
  module Schema