aspera-cli 4.25.4 → 4.25.6

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 (44) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/CHANGELOG.md +33 -11
  4. data/CONTRIBUTING.md +41 -23
  5. data/README.md +9 -7
  6. data/lib/aspera/agent/direct.rb +10 -8
  7. data/lib/aspera/agent/factory.rb +3 -3
  8. data/lib/aspera/agent/node.rb +1 -1
  9. data/lib/aspera/api/alee.rb +1 -0
  10. data/lib/aspera/api/aoc.rb +10 -6
  11. data/lib/aspera/api/ats.rb +1 -1
  12. data/lib/aspera/api/cos_node.rb +1 -0
  13. data/lib/aspera/api/faspex.rb +17 -19
  14. data/lib/aspera/api/httpgw.rb +19 -3
  15. data/lib/aspera/api/node.rb +56 -2
  16. data/lib/aspera/ascp/installation.rb +32 -34
  17. data/lib/aspera/cli/error.rb +8 -0
  18. data/lib/aspera/cli/info.rb +2 -1
  19. data/lib/aspera/cli/main.rb +30 -12
  20. data/lib/aspera/cli/manager.rb +31 -28
  21. data/lib/aspera/cli/plugins/aoc.rb +2 -2
  22. data/lib/aspera/cli/plugins/base.rb +1 -88
  23. data/lib/aspera/cli/plugins/faspex.rb +6 -6
  24. data/lib/aspera/cli/plugins/faspex5.rb +41 -53
  25. data/lib/aspera/cli/plugins/node.rb +26 -68
  26. data/lib/aspera/cli/plugins/server.rb +1 -1
  27. data/lib/aspera/cli/plugins/shares.rb +4 -2
  28. data/lib/aspera/cli/transfer_agent.rb +3 -0
  29. data/lib/aspera/cli/version.rb +1 -1
  30. data/lib/aspera/dot_container.rb +10 -10
  31. data/lib/aspera/environment.rb +29 -19
  32. data/lib/aspera/keychain/macos_security.rb +1 -1
  33. data/lib/aspera/log.rb +1 -1
  34. data/lib/aspera/markdown.rb +1 -1
  35. data/lib/aspera/persistency_folder.rb +1 -1
  36. data/lib/aspera/preview/utils.rb +2 -2
  37. data/lib/aspera/rest.rb +39 -36
  38. data/lib/aspera/rest_list.rb +121 -0
  39. data/lib/aspera/sync/operations.rb +2 -2
  40. data/lib/aspera/transfer/parameters.rb +8 -8
  41. data/lib/aspera/yaml.rb +1 -1
  42. data.tar.gz.sig +0 -0
  43. metadata +4 -3
  44. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 34cb77d2badea1e3650f2aed72fb3a91c419e6457a08acd62808c9a6d9ab0e74
4
- data.tar.gz: 31e1e1a28d99afebd6b6a3f7b9e848bf18256d47fdc7108368a6e964eef03b04
3
+ metadata.gz: 8e8b3ed2906ef470b3617e60b438089f57c5b3d0e1770649e2ba1a64d413d32d
4
+ data.tar.gz: e09b6b5d455c77ea355ba617577b82a1c51e60afab2e8431e62dcf8d9e7785c6
5
5
  SHA512:
6
- metadata.gz: e15bfb65919b8b8a6112120eca273dac962ff6d6b29d890df1e9293f4321e557bdd68697c394cb6ef738a3d5bcc3a75a2f7f177494b66542c2e970c4da99e9d0
7
- data.tar.gz: 1d3570c590e7bfbda3ce5fc49396637471f48ff6fccce7235ae31adcc23c1e1ccc4a978d6bdbe9a4c1c06f06e02ed5336043267891c0b56a995b4d0199ab0d92
6
+ metadata.gz: eb3f5becd29ffc54c7746868a47b3e8841cde1566abb0b5ea97d9c4bb7768f9f85c4cf96cbd3e52b6a1724f4be0eb817ea03282a4070e5cf32a9d06fb6a3aab5
7
+ data.tar.gz: f8f03f1a45d50b92e01d39f734bdebebf94e1640c695751a3122106797d9c4d223e544050cd854cb026daa736589440666d5ccd2453b50c9a39a6df5fadccc8e
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -2,6 +2,28 @@
2
2
 
3
3
  <!-- markdownlint-configure-file { "no-duplicate-heading": { "siblings_only": true } } -->
4
4
 
5
+ ## 4.25.6
6
+
7
+ Released: 2026-04-08
8
+
9
+ ### Issues Fixed
10
+
11
+ * `node`: #253 fix `node transfer list` infinite loop with `once_only`.
12
+
13
+ ## 4.25.5
14
+
15
+ Released: 2026-03-25
16
+
17
+ ### New Features
18
+
19
+ * `faspex5`: When sending a package, recipients specified in fields `private_recipients`, `notified_on_upload`, `notified_on_download` and `notified_on_receipt` are now also expanded like field `recipients`.
20
+
21
+ ### Issues Fixed
22
+
23
+ * `config`: Fixed `preset update` with dot-path options.
24
+ * `sync`: #251 in `admin` command: Fixed database path on Windows: Use `~private-asp` instead of `.private-asp`.
25
+ * `httpgw`: #252 HTTPGW transfer showed success even when error code `403` was returned. Now raises error with message.
26
+
5
27
  ## 4.25.4
6
28
 
7
29
  Released: 2026-03-04
@@ -99,7 +121,7 @@ Released: 2026-01-21
99
121
  ### Issues Fixed
100
122
 
101
123
  * `aoc`: Restored command `admin workspace shared_folder :id list` which was since 4.11.0.
102
- * `direct`: When using `ascp4` do not set env var: `ASPERA_TEST_REDIS_DISABLE`, else it fails with: `Failed to initialize application`.
124
+ * `direct`: When using `ascp4`, do not set env var: `ASPERA_TEST_REDIS_DISABLE`, else it fails with: `Failed to initialize application`.
103
125
  * `shares`: Properly detect using `/node_api/ping` endpoint instead of `/app`.
104
126
 
105
127
  ### Breaking Changes
@@ -178,7 +200,7 @@ Released: 2025-09-30
178
200
  * `console`: Removed options `filter_from` and `filter_to`. Use standard option `query` instead.
179
201
  * `sync`: Removed option `sync_info`. Replaced with positional parameters. Streamlined command line interface. Applies to all plugins with `sync` command.
180
202
  * `async`: Removed option `sync_name`. Replaced with percent selector `%name:`.
181
- * `aoc`: `files download` using gen4 API do not require anymore to provide the containing folder in first position, and then only file names. Now, directly provide the path to all files.
203
+ * `aoc`: `files download` using gen4 API no longer requires providing the containing folder in first position, and then only file names. Now, directly provide the path to all files.
182
204
  * `logger`: Log is simplified, date is removed by default. Use `--log_format=standard` to revert to standard Ruby logger. See option `log_format` for details.
183
205
 
184
206
  ## 4.23.0
@@ -192,7 +214,7 @@ Released: 2025-08-11
192
214
 
193
215
  ### Issues Fixed
194
216
 
195
- * `server`: #209: missing home folder for transfer user shall not cause an error.
217
+ * `server`: #209: a missing home folder for the transfer user shall not cause an error.
196
218
  * `direct`: #205: `kill` blocks `cmd` on Windows.
197
219
 
198
220
  ### Breaking Changes
@@ -301,7 +323,7 @@ Released: 2025-01-21
301
323
 
302
324
  * Internal: Basic REST calls now return data directly. (no more `data` key). For advanced calls, use `call`.
303
325
  * Internal: Transfer SDK download is now a 2-step procedure: First get the YAML file from GitHub with URLs for the various platforms and versions, and then download the archive from the official IBM repository.
304
- **global**: Option `format=multi` is replaced with option `multi_table=yes`.
326
+ * **global**: Option `format=multi` is replaced with option `multi_table=yes`.
305
327
  * `faspex5`: Removed deprecated option `value` replaced with positional parameter.
306
328
 
307
329
  ## 4.19.0
@@ -908,7 +930,7 @@ Released: 2021-02-03
908
930
 
909
931
  ## 0.11.2
910
932
 
911
- * Fixes on multi-session: Progress bat and transfer spec param for "direct".
933
+ * Fixes on multi-session: Progress bar and transfer spec param for `direct`.
912
934
 
913
935
  ## 0.11.1
914
936
 
@@ -979,7 +1001,7 @@ Released: 2021-02-03
979
1001
 
980
1002
  ## 0.10.6
981
1003
 
982
- * FaspManager: Transfer spec `authentication` no more needed for local transfer to use Aspera public keys. public keys will be used if there is a token and no key or password is provided.
1004
+ * FaspManager: Transfer spec `authentication` is no longer needed for local transfer to use Aspera public keys. Public keys will be used if there is a token and no key or password is provided.
983
1005
  * Gem version requirements made more open.
984
1006
 
985
1007
  ## 0.10.5
@@ -1065,7 +1087,7 @@ Released: 2021-02-03
1065
1087
 
1066
1088
  ### New Features
1067
1089
 
1068
- * The option `value` of command `find`, to filter on name, is not optional.
1090
+ * The option `value` of command `find` to filter on name is mandatory.
1069
1091
  * `find` now also reports all types (file, folder, link).
1070
1092
  * `find` now is able to report all fields (type, size, etc...).
1071
1093
 
@@ -1095,7 +1117,7 @@ Released: 2021-02-03
1095
1117
  ### New Features
1096
1118
 
1097
1119
  * Improved wizard (prepare for AoC global client id).
1098
- * Preview generator: Added option : --skip-format=&lt;png,mp4&gt;.
1120
+ * Preview generator: Added option : `skip_format` with values `png`, `mp4`.
1099
1121
  * Removed outdated pictures from this doc.
1100
1122
 
1101
1123
  ## 0.9.19
@@ -1163,7 +1185,7 @@ Released: 2021-02-03
1163
1185
 
1164
1186
  ### New Features
1165
1187
 
1166
- * `faspex`: Use option `once_only` set to `yes` to enable cargo like function. id=NEW deprecated.
1188
+ * `faspex`: Use option `once_only` set to `yes` to enable cargo like function. `id=NEW` deprecated.
1167
1189
  * `aoc`: Share to share transfer with command `transfer`.
1168
1190
 
1169
1191
  ## 0.9.7
@@ -1172,8 +1194,8 @@ Released: 2021-02-03
1172
1194
 
1173
1195
  * Homogeneous transfer spec for `node` and [`direct`](README.md#agt_direct) transfer agents.
1174
1196
  * Preview persistency goes to unique file by default.
1175
- * Catch mxf extension in preview as video.
1176
- * Faspex: Possibility to download all packages by specifying id=ALL.
1197
+ * Catch `mxf` extension in preview as video.
1198
+ * Faspex: Possibility to download all packages by specifying `id=ALL`.
1177
1199
  * Faspex: To come: Cargo-like function to download only new packages with id=NEW.
1178
1200
 
1179
1201
  ## 0.9.6
data/CONTRIBUTING.md CHANGED
@@ -12,7 +12,7 @@ To help us diagnose and resolve the issue efficiently, please include the follow
12
12
 
13
13
  - The `ascli` version you are using:
14
14
 
15
- ```bash
15
+ ```shell
16
16
  ascli -v
17
17
  ```
18
18
 
@@ -20,7 +20,7 @@ To help us diagnose and resolve the issue efficiently, please include the follow
20
20
 
21
21
  - **Your Ruby environment details**:
22
22
 
23
- ```bash
23
+ ```shell
24
24
  ruby -v
25
25
  ```
26
26
 
@@ -32,7 +32,7 @@ We welcome contributions to improve the `aspera-cli` project!
32
32
 
33
33
  Clone the repository to initialize the development environment:
34
34
 
35
- ```bash
35
+ ```shell
36
36
  git clone https://github.com/IBM/aspera-cli.git
37
37
  cd aspera-cli
38
38
  bundle install
@@ -91,7 +91,7 @@ You can manage your Ruby installation using your preferred tool (e.g., `rbenv`,
91
91
 
92
92
  To start with a clean state and remove all installed gems:
93
93
 
94
- ```bash
94
+ ```shell
95
95
  bundle exec rake tools:clean_gems
96
96
  ```
97
97
 
@@ -109,23 +109,24 @@ The following environment variables and macros control specific build behaviors:
109
109
  | Environment variable | Contents | Description |
110
110
  |-----------------------------|------------| -------------------------------------------------------------|
111
111
  | `ASPERA_CLI_TEST_CONF_URL` | URL | URL for the configuration file containing secrets for tests. |
112
- | `ASPERA_CLI_DOC_CHECK_LINKS`| yes/no | Validates that links exist during documentation generation. |
113
- | `LOG_SECRETS` | yes/no | Toggles the logging of secrets in `rake` tasks. |
114
- | `LOG_LEVEL` | debug, ... | Sets the logging verbosity for `rake` tasks. |
112
+ | `LOG_SECRETS` | `yes`/`no` | Toggles the logging of secrets in `rake` tasks. |
113
+ | `LOG_LEVEL` | `debug`, ... | Sets the logging verbosity for `rake` tasks. |
115
114
  | `ENABLE_COVERAGE` | set/unset | Enables test coverage analysis when defined. |
116
115
  | `SIGNING_KEY` | File path | Path to the signing key used for building the gem file. |
117
116
  | `SIGNING_KEY_PEM` | PEM Value | The PEM content of the signing key. |
117
+ | `DRY_RUN` | `1` | Simulates execution without performing actual operations (git, gh commands). |
118
+ | `DEBUG` | `1` | Shows stack trace on errors during documentation generation. |
118
119
 
119
120
  These values can be set as standard environment variables or passed directly to the `rake` command.
120
121
 
121
122
  Setting `SIGNING_KEY_PEM` automatically generates a file at `$HOME/.gem/signing_key.pem` and sets the `SIGNING_KEY` variable accordingly.
122
123
 
123
124
  > [!NOTE]
124
- > `ASPERA_CLI_*` variables are typically defined in your shell profile for development, while others are intended for ad-hoc command-line use.
125
+ > `ASPERA_CLI_TEST_CONF_URL` is typically defined in your shell profile for development, while others are usually for ad-hoc command-line use.
125
126
 
126
127
  To run the CLI directly from your source directory, add the following to your shell profile (adjust the path as necessary):
127
128
 
128
- ```bash
129
+ ```shell
129
130
  dev_ascli=$HOME/github/aspera-cli
130
131
  export PATH=$dev_ascli/bin:$PATH
131
132
  export RUBYLIB=$dev_ascli/lib:$RUBYLIB
@@ -140,24 +141,28 @@ Installation instructions can be found at [IBM Plex](https://www.ibm.com/plex/).
140
141
 
141
142
  On macOS, install `lualatex` and required packages via Homebrew:
142
143
 
143
- ```bash
144
+ ```shell
144
145
  brew install texlive
145
146
  ```
146
147
 
147
148
  If using an alternative installation method, ensure the following packages are present:
148
149
 
149
- ```bash
150
+ ```shell
150
151
  tlmgr update --self
151
152
  tlmgr install fvextra selnolig lualatex-math
152
153
  ```
153
154
 
154
- - To validate URLs during generation: `ASPERA_CLI_DOC_CHECK_LINKS=1`.
155
+ - Validate URLs during generation with:
156
+
157
+ ```shell
158
+ rake doc:check_links
159
+ ```
155
160
 
156
- - To debug the generation process: `ASPERA_CLI_DOC_DEBUG=debug`.
161
+ - Debug the generation process: `DEBUG=1`.
157
162
 
158
- - To build the documentation:
163
+ - Build the documentation:
159
164
 
160
- ```bash
165
+ ```shell
161
166
  rake doc:build
162
167
  ```
163
168
 
@@ -169,14 +174,14 @@ Detailed testing information can be found in <tests/README.md>.
169
174
 
170
175
  To build an unsigned gem:
171
176
 
172
- ```bash
177
+ ```shell
173
178
  bundle install
174
179
  bundle exec rake unsigned
175
180
  ```
176
181
 
177
182
  To exclude optional gems from the installation:
178
183
 
179
- ```bash
184
+ ```shell
180
185
  bundle config set without optional
181
186
  ```
182
187
 
@@ -185,7 +190,7 @@ bundle config set without optional
185
190
  Generating a signed gem requires a **private key**, specified via the `SIGNING_KEY` environment variable.
186
191
  The gem is signed using the public certificate in `certs` and the **private key**.
187
192
 
188
- ```bash
193
+ ```shell
189
194
  bundle exec rake SIGNING_KEY=/path/to/vault/gem-private_key.pem
190
195
  ```
191
196
 
@@ -195,7 +200,7 @@ For more details, see <certs/README.md>.
195
200
 
196
201
  To update the stubs:
197
202
 
198
- ```bash
203
+ ```shell
199
204
  bundle exec rake tools:grpc
200
205
  ```
201
206
 
@@ -211,7 +216,7 @@ Refer to the [Executable build guide](build/binary/README.md).
211
216
 
212
217
  To list related `rake` tasks:
213
218
 
214
- ```bash
219
+ ```shell
215
220
  bundle exec rake -T ^binary:
216
221
  ```
217
222
 
@@ -234,17 +239,30 @@ Before a new release, ensure the following:
234
239
 
235
240
  - **Pass all tests**:
236
241
 
237
- ```bash
242
+ ```shell
238
243
  bundle exec rake test:run
239
244
  ```
240
245
 
241
246
  - **Verify container builds** (using the local gem):
242
247
 
243
- ```bash
248
+ ```shell
244
249
  bundle exec rake container:build'[local]'
245
250
  bundle exec rake container:test
246
251
  ```
247
252
 
253
+ - **Check documentation links**:
254
+
255
+ ```shell
256
+ bundle exec rake doc:check_links
257
+ ```
258
+
259
+ - **Check release procedure**:
260
+
261
+ ```shell
262
+ bundle exec rake release:run DRY_RUN=1
263
+ git restore lib/aspera/cli/version.rb CHANGELOG.md docs/README.md
264
+ ```
265
+
248
266
  ### Automated Release Process
249
267
 
250
268
  Releases are managed through the GitHub Actions UI via the **New Release on GitHub** workflow (`.github/workflows/release.yml`).
@@ -304,4 +322,4 @@ This triggers the `.github/workflows/deploy.yml` action to publish to RubyGems.
304
322
  - [rest-client](https://github.com/rest-client/rest-client)
305
323
  - [oauth2](https://github.com/oauth-xx/oauth2)
306
324
  - Integrate `thor` <http://whatisthor.com/> or another standard Ruby CLI framework.
307
- - Explore [Traveling Ruby](https://github.com/phusion/traveling-ruby) for distribution.
325
+ - Explore [Traveling Ruby](https://github.com/phusion/traveling-ruby) for distribution, or [truby Traveling Ruby](https://github.com/trubygems/traveling-ruby).
data/README.md CHANGED
@@ -5,6 +5,8 @@
5
5
  [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5861/badge)](https://bestpractices.coreinfrastructure.org/projects/5861)
6
6
  [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
7
7
 
8
+ ![Hootput the Owl](docs/mascot.svg)
9
+
8
10
  **`ascli`** is the command-line interface for IBM Aspera products.
9
11
  Use it from the terminal or in scripts to:
10
12
 
@@ -18,8 +20,8 @@ Choose what best suits you:
18
20
 
19
21
  | Resource | Link |
20
22
  | -------- | ---- |
21
- | **Online manual** | [docs/README.md](docs/README.md) |
22
- | **PDF manual** | In [releases](https://github.com/IBM/aspera-cli/releases) |
23
+ | **Online manual** | [GitHub docs/README.md](https://github.com/IBM/aspera-cli/blob/main/docs/README.md) |
24
+ | **PDF manual** | In [GitHub Releases](https://github.com/IBM/aspera-cli/releases) |
23
25
  | **RubyGems** | [rubygems.org/gems/aspera-cli](https://rubygems.org/gems/aspera-cli) |
24
26
  | **RubyDoc** | [rubydoc.info/gems/aspera-cli](https://www.rubydoc.info/gems/aspera-cli) |
25
27
  | **Docsify** | [online](https://docsify-this.net/?basePath=https://raw.githubusercontent.com/IBM/aspera-cli/main/docs&homepage=README.md&sidebar=true&browser-tab-title=Aspera%20CLI%20Manual&hide-credits=true&maxLevel=4&externalLinkTarget=_blank&image-captions=true&dark-mode=auto) |
@@ -34,7 +36,7 @@ ascli config transferd install
34
36
  ```
35
37
 
36
38
  The second command installs the **FASP** transfer engine (`ascp`).
37
- For other install methods (single executable, Docker, Chocolatey, Homebrew), see the [user manual](docs/README.md#installation).
39
+ For other install methods (single executable, Docker, Chocolatey, Homebrew), see the [user manual](https://github.com/IBM/aspera-cli/blob/main/docs/README.md#installation).
38
40
 
39
41
  **Quick check:**
40
42
 
@@ -44,13 +46,13 @@ ascli -v
44
46
 
45
47
  ## Contributing
46
48
 
47
- - **Bugs & features:** [BUGS.md](BUGS.md)
48
- - **How to contribute:** [CONTRIBUTING.md](CONTRIBUTING.md)
49
- - **Release notes:** [CHANGELOG.md](CHANGELOG.md)
49
+ - **Bugs & features:** [BUGS.md](https://github.com/IBM/aspera-cli/blob/main/BUGS.md)
50
+ - **How to contribute:** [CONTRIBUTING.md](https://github.com/IBM/aspera-cli/blob/main/CONTRIBUTING.md)
51
+ - **Release notes:** [CHANGELOG.md](https://github.com/IBM/aspera-cli/blob/main/CHANGELOG.md)
50
52
 
51
53
  Commands map to Aspera REST APIs; see the manual for options.
52
54
  For debugging, use `--log-level=debug`.
53
55
 
54
56
  ## License
55
57
 
56
- [Apache-2.0](LICENSE)
58
+ [Apache-2.0](https://github.com/IBM/aspera-cli/blob/main/LICENSE)
@@ -25,25 +25,27 @@ module Aspera
25
25
  private_constant :LISTEN_LOCAL_ADDRESS, :SELECT_AVAILABLE_PORT
26
26
 
27
27
  # Options: same as values in option `transfer_info`
28
- # @param ascp_args [Array] (Params) Optional Additional arguments to ascp
29
- # @param wss [Boolean] (Params) `true`: if both SSH and wss in ts: prefer wss
30
- # @param quiet [Boolean] (Params) By default no native `ascp` progress bar
31
- # @param monitor [Boolean] (Params) Set to `false` to eliminate management port
32
- # @param trusted_certs [Array] (Params) Optional list of files with trusted certificates (stores)
33
- # @param client_ssh_key [String] (Params) Client SSH key option (from CLIENT_SSH_KEY_OPTIONS)
34
- # @param check_ignore_cb [Proc] (Params) Callback with host,port
28
+ # (Args) : Options that influence `ascp` arguments.
29
+ #
30
+ # @param ascp_args [Array] (Args) Optional Additional arguments to ascp
31
+ # @param wss [Boolean] (Args) `true`: if both SSH and wss in ts: prefer wss
32
+ # @param quiet [Boolean] (Args) By default no native `ascp` progress bar
33
+ # @param client_ssh_key [String] (Args) Client SSH key option (from CLIENT_SSH_KEY_OPTIONS)
34
+ # @param trusted_certs [Array<String>] (Args) (WSS) Optional list of files with trusted certificates (stores)
35
+ # @param check_ignore_cb [Proc] (Args) (WSS) Callback with host,port to check if WSS connection shall ignore certificate validity
35
36
  # @param spawn_timeout_sec [Integer] Timeout for ascp spawn
36
37
  # @param spawn_delay_sec [Integer] Optional delay to start between sessions
37
38
  # @param multi_incr_udp [Boolean] Optional `true`: increment UDP port for each session
38
39
  # @param resume [Hash] Optional Resume policy
40
+ # @param monitor [Boolean] Set to `false` to eliminate management port
39
41
  # @param management_cb [Proc] callback for management events
40
42
  # @param base_options [Hash] other options for base class
41
43
  def initialize(
42
44
  ascp_args: nil,
43
45
  wss: true,
44
46
  quiet: true,
45
- trusted_certs: nil,
46
47
  client_ssh_key: nil,
48
+ trusted_certs: nil,
47
49
  check_ignore_cb: nil,
48
50
  spawn_timeout_sec: 2,
49
51
  spawn_delay_sec: 2,
@@ -22,11 +22,11 @@ module Aspera
22
22
  Dir.children(File.dirname(File.expand_path(__FILE__)))
23
23
  .select{ |file| file.end_with?(Environment::RB_EXT)}
24
24
  .map{ |file| File.basename(file, Environment::RB_EXT).to_sym}
25
- .reject{ |item| IGNORED_ITEMS.include?(item)}.each_with_object({}) do |agent_sym, hash|
26
- hash[agent_sym] = {
25
+ .reject{ |item| IGNORED_ITEMS.include?(item)}.to_h do |agent_sym|
26
+ [agent_sym, {
27
27
  long: agent_sym.to_s.capitalize,
28
28
  short: agent_sym.eql?(:direct) ? :a : agent_sym.to_s[0].to_sym
29
- }.freeze
29
+ }.freeze]
30
30
  end.freeze
31
31
  private_constant :IGNORED_ITEMS
32
32
  end
@@ -59,7 +59,7 @@ module Aspera
59
59
  ts_tags = transfer_spec['tags']
60
60
  ts_tags[Transfer::Spec::TAG_RESERVED]['xfer_retry'] ||= 150 if ts_tags.is_a?(Hash) && ts_tags[Transfer::Spec::TAG_RESERVED].is_a?(Hash)
61
61
  # Optimization in case of sending to the same node
62
- # TODO: probably remove this, as /etc/hosts shall be used for that
62
+ # TODO: probably remove this, as /etc/hosts shall be used for that on server side.
63
63
  transfer_spec['remote_host'] = '127.0.0.1' if !transfer_spec['wss_enabled'] && transfer_spec['remote_host'].eql?(URI.parse(node_api_.base_url).host)
64
64
  resp = node_api_.create('ops/transfers', transfer_spec)
65
65
  @transfer_id = resp['id']
@@ -3,6 +3,7 @@
3
3
  require 'aspera/api/aoc.rb'
4
4
  module Aspera
5
5
  module Api
6
+ # Aspera License Entitlement Engine API client
6
7
  class Alee < Aspera::Rest
7
8
  def initialize(entitlement_id, customer_id, api_domain: AoC::SAAS_DOMAIN_PROD, version: 'v1')
8
9
  super(
@@ -7,11 +7,15 @@ require 'aspera/hash_ext'
7
7
  require 'aspera/data_repository'
8
8
  require 'aspera/transfer/spec'
9
9
  require 'aspera/api/node'
10
+ require 'aspera/rest_list'
10
11
  require 'base64'
11
12
 
12
13
  module Aspera
13
14
  module Api
15
+ # Aspera on Cloud API client
14
16
  class AoC < Rest
17
+ include RestList
18
+
15
19
  PRODUCT_NAME = 'Aspera on Cloud'
16
20
  # use default workspace if it is set, else none
17
21
  DEFAULT_WORKSPACE = ''
@@ -144,7 +148,7 @@ module Aspera
144
148
 
145
149
  # Call `block` with same query using paging and response information.
146
150
  # Block must return a 2 element `Array` with data and http response
147
- # @param query [Hash] Additionnal query parameters
151
+ # @param query [Hash] Additional query parameters
148
152
  # @return [Hash] Items and total number of items
149
153
  # @option return [Array<Hash>] :items The list of items
150
154
  # @option return [Integer] :total The total number of items
@@ -153,8 +157,8 @@ module Aspera
153
157
  Aspera.assert(block_given?)
154
158
  # set default large page if user does not specify own parameters. AoC Caps to 1000 anyway
155
159
  query['per_page'] = 1000 unless query.key?('per_page')
156
- max_items = query.delete(Rest::MAX_ITEMS)
157
- max_pages = query.delete(Rest::MAX_PAGES)
160
+ max_items = query.delete(RestList::MAX_ITEMS)
161
+ max_pages = query.delete(RestList::MAX_PAGES)
158
162
  item_list = []
159
163
  total_count = nil
160
164
  current_page = query['page']
@@ -209,7 +213,7 @@ module Aspera
209
213
  when 'upload' then %w[mkdir write]
210
214
  when Array
211
215
  Aspera.assert_array_all(levels, String){'access_levels'}
212
- levels.each{ |level| Aspera.assert_value(level, Node::ACCESS_LEVELS){'access_level'}}
216
+ levels.each{ |level| Aspera.assert_values(level, Node::ACCESS_LEVELS){'access_level'}}
213
217
  levels
214
218
  else Aspera.error_unexpected_value(levels){"access_levels must be a list of #{Node::ACCESS_LEVELS.join(', ')} or one of edit, preview, download, upload"}
215
219
  end
@@ -492,7 +496,7 @@ module Aspera
492
496
  # in that case, the name is resolved and replaced with {type: , id: }
493
497
  # @param package_data [Hash] The whole package creation payload
494
498
  # @param rcpt_lst_field [String] The field in structure, i.e. recipients or bcc_recipients
495
- # @param new_user_option [Hash] Additionnal fields for contact creation
499
+ # @param new_user_option [Hash] Additional fields for contact creation
496
500
  # @return nil, `package_data` is modified
497
501
  def resolve_package_recipients(package_data, rcpt_lst_field, new_user_option)
498
502
  return unless package_data.key?(rcpt_lst_field)
@@ -510,7 +514,7 @@ module Aspera
510
514
  # email: user, else dropbox
511
515
  entity_type = short_recipient_info.include?('@') ? 'contacts' : 'dropboxes'
512
516
  begin
513
- full_recipient_info = lookup_by_name(entity_type, short_recipient_info, query: {'current_workspace_id' => ws_id})
517
+ full_recipient_info = lookup_by_name(entity_type, short_recipient_info, query: {'workspace_id' => ws_id})
514
518
  rescue EntityNotFound
515
519
  # dropboxes cannot be created on the fly
516
520
  Aspera.assert_values(entity_type, 'contacts', type: Error){"No such shared inbox in workspace #{ws_id}"}
@@ -5,7 +5,7 @@ require 'aspera/rest'
5
5
 
6
6
  module Aspera
7
7
  module Api
8
- # ATS API without authentication
8
+ # Aspera Transfer Service API client without authentication
9
9
  class Ats < Aspera::Rest
10
10
  SERVICE_BASE_URL = 'https://ats.aspera.io'
11
11
  # currently supported clouds
@@ -7,6 +7,7 @@ require 'xmlsimple'
7
7
 
8
8
  module Aspera
9
9
  module Api
10
+ # Cloud Object Storage Node API Client
10
11
  class CosNode < Node
11
12
  IBM_CLOUD_TOKEN_URL = 'https://iam.cloud.ibm.com/identity'
12
13
  TOKEN_FIELD = 'delegated_refresh_token'
@@ -2,10 +2,11 @@
2
2
 
3
3
  require 'aspera/rest'
4
4
  require 'aspera/oauth/base'
5
+ require 'aspera/rest_list'
5
6
  require 'digest'
6
7
 
7
8
  module Aspera
8
- # Implement OAuth for Faspex public link
9
+ # OAuth for Faspex public link
9
10
  class FaspexPubLink < OAuth::Base
10
11
  class << self
11
12
  attr_accessor :additional_info
@@ -55,14 +56,14 @@ module Aspera
55
56
  end
56
57
  OAuth::Factory.instance.register_token_creator(FaspexPubLink)
57
58
  module Api
59
+ # Aspera Faspex 5 API Client
58
60
  class Faspex < Aspera::Rest
61
+ include RestList
62
+
59
63
  # endpoint for authentication API
60
64
  PATH_AUTH = 'auth'
61
65
  PATH_API_V5 = 'api/v5'
62
66
  PATH_HEALTH = 'configuration/ping'
63
- private_constant :PATH_AUTH,
64
- :PATH_API_V5,
65
- :PATH_HEALTH
66
67
  RECIPIENT_TYPES = %w[user workgroup external_user distribution_list shared_inbox].freeze
67
68
  PACKAGE_TERMINATED = %w[completed failed].freeze
68
69
  # list of supported mailbox types (to list packages)
@@ -148,6 +149,7 @@ module Aspera
148
149
  def initialize(
149
150
  url:,
150
151
  auth:,
152
+ root: PATH_API_V5,
151
153
  password: nil,
152
154
  client_id: nil,
153
155
  client_secret: nil,
@@ -161,23 +163,23 @@ module Aspera
161
163
  super(**
162
164
  case auth
163
165
  when :public_link
164
- # Get URL of final redirect of public link
165
- redir_url = Rest.new(base_url: url, redirect_max: 3).call(operation: 'GET', ret: :resp).uri.to_s
166
- Log.dump(:redir_url, redir_url, level: :trace1)
167
- # get context from query
168
- encoded_context = Rest.query_to_h(URI.parse(redir_url).query)['context']
166
+ # Get URL of final redirect of provided public link
167
+ final_url = Rest.new(base_url: url, redirect_max: 3).call(operation: 'GET', ret: :resp).uri.to_s
168
+ Log.dump(:final_url, final_url, level: :trace1)
169
+ # Get context from query
170
+ encoded_context = Rest.query_to_h(URI.parse(final_url).query)['context']
169
171
  raise ParameterError, 'Bad faspex5 public link, missing context in query' if encoded_context.nil?
170
172
  # public link information (contains passcode and allowed usage)
171
173
  @pub_link_context = JSON.parse(Base64.decode64(encoded_context))
172
174
  Log.dump(:pub_link_context, @pub_link_context, level: :trace1)
173
175
  # Get the base url, i.e. .../aspera/faspex
174
- base_url = redir_url.gsub(%r{/public/.*}, '').gsub(/\?.*/, '')
176
+ base_url = final_url.gsub(%r{/public/.*}, '').gsub(/\?.*/, '')
175
177
  # Get web UI client_id and redirect_uri
176
178
  # TODO: change this for something more reliable
177
179
  config = JSON.parse(Rest.new(base_url: "#{base_url}/config.js", redirect_max: 3).call(operation: 'GET').sub(/^[^=]+=/, '').gsub(/([a-z_]+):/, '"\1":').delete("\n ").tr("'", '"')).symbolize_keys
178
- Log.dump(:configjs, config)
180
+ Log.dump(:config_js, config)
179
181
  {
180
- base_url: "#{base_url}/#{PATH_API_V5}",
182
+ base_url: "#{base_url}/#{root}",
181
183
  auth: {
182
184
  type: :oauth2,
183
185
  base_url: "#{base_url}/#{PATH_AUTH}",
@@ -194,7 +196,7 @@ module Aspera
194
196
  Aspera.assert(password, type: ParameterError){'Missing password'}
195
197
  # the password here is the token copied directly from browser in developer mode
196
198
  {
197
- base_url: "#{url}/#{PATH_API_V5}",
199
+ base_url: "#{url}/#{root}",
198
200
  headers: {'Authorization' => password}
199
201
  }
200
202
  when :web
@@ -202,7 +204,7 @@ module Aspera
202
204
  Aspera.assert(redirect_uri, type: ParameterError){'Missing redirect_uri'}
203
205
  # opens a browser and ask user to auth using web
204
206
  {
205
- base_url: "#{url}/#{PATH_API_V5}",
207
+ base_url: "#{url}/#{root}",
206
208
  auth: {
207
209
  type: :oauth2,
208
210
  base_url: "#{url}/#{PATH_AUTH}",
@@ -217,7 +219,7 @@ module Aspera
217
219
  Aspera.assert(client_id, type: ParameterError){'Missing client_id'}
218
220
  Aspera.assert(private_key, type: ParameterError){'Missing private_key'}
219
221
  {
220
- base_url: "#{url}/#{PATH_API_V5}",
222
+ base_url: "#{url}/#{root}",
221
223
  auth: {
222
224
  type: :oauth2,
223
225
  base_url: "#{url}/#{PATH_AUTH}",
@@ -238,10 +240,6 @@ module Aspera
238
240
  end
239
241
  )
240
242
  end
241
-
242
- def auth_api
243
- Rest.new(**params, base_url: base_url.sub(PATH_API_V5, PATH_AUTH))
244
- end
245
243
  end
246
244
  end
247
245
  end