Skip to content

Commit

Permalink
add faspex5 invitations
Browse files Browse the repository at this point in the history
  • Loading branch information
laurent-martin committed Feb 20, 2024
1 parent b720010 commit 183f283
Show file tree
Hide file tree
Showing 9 changed files with 166 additions and 83 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* 4.17.0

* New Features:
* `faspex5`: Support public and private invitations.
* Issues Fixed:
* `aoc`: #135 `exclude_dropbox_packages` query option can be overridden
* Breaking Changes:
Expand Down
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3476,7 +3476,7 @@ OPTIONS:
COMMAND: faspex5
SUBCOMMANDS: admin bearer_token gateway health packages postprocessing shared_folders user version
SUBCOMMANDS: admin bearer_token gateway health invitations packages postprocessing shared_folders user version
OPTIONS:
--url=VALUE URL of application, e.g. https://faspex.example.com/aspera/faspex
--username=VALUE Username to log in
Expand Down Expand Up @@ -4539,6 +4539,8 @@ To list packages in a shared inbox, the query has to be specified with the the s
Additional parameters can be specified, as supported by the API (to find out available filters, consult the API definition, or use the web interface in developer mode).
The current workspace is added unless specified in the query.

> **Note:** By default, `exclude_dropbox_packages` is set to true for user packages, and to false for shared inbox packages. This can be overridden in the query.
Using shared inbox name:

```bash
Expand Down Expand Up @@ -4753,7 +4755,7 @@ aoc automation workflow create @json:'{"name":"test_workflow"}'
aoc automation workflow delete wf_id
aoc automation workflow list
aoc automation workflow list --query=@json:'{"show_org_workflows":"true"}' --scope=admin:all
aoc automation workflow list --select=@json:'{"name":"test_workflow"}' --fields=id --format=csv --display=data
aoc automation workflow list --select=@json:'{"name":"test_workflow"}' --fields=id --format=csv --display=data --output=test
aoc bearer_token --display=data --scope=user:all
aoc files bearer /
aoc files bearer_token_node / --cache-tokens=no
Expand Down Expand Up @@ -5479,7 +5481,7 @@ node access_key do my_ak_name show %id:1
node access_key do my_ak_name show /testfile1
node access_key do my_ak_name upload 'faux:///testfile1?1k' --default_ports=no
node access_key do self permission %id:root_id create @json:'{"access_type":"user","access_id":"666"}'
node access_key do self show / --fields=id
node access_key do self show / --fields=id --output=root_id
node access_key list
node access_key set_bearer_key self @file:my_private_key
node api_details
Expand All @@ -5490,7 +5492,7 @@ node async list
node async show 1
node async show ALL
node basic_token
node bearer_token @file:my_private_key @json:'{"user_id":"666"}'
node bearer_token @file:my_private_key @json:'{"user_id":"666"}' --output=bearer_666
node browse / --log-level=trace2
node delete @list:,my_upload_folder/a_folder,my_upload_folder/tdlink,my_upload_folder/a_file
node delete my_upload_folder/test_file.bin
Expand Down Expand Up @@ -5707,6 +5709,8 @@ faspex5 admin smtp test my_email_external
faspex5 bearer_token
faspex5 gateway --pid-file=pid_f5_fxgw https://localhost:12346/aspera/faspex &
faspex5 health
faspex5 invitation list
faspex5 invitations create @json:'{"email_address":"[email protected]"}'
faspex5 packages list --box=my_shared_box_name
faspex5 packages list --box=my_workgroup --group-type=workgroups
faspex5 packages list --query=@json:'{"mailbox":"inbox","state":["released"]}'
Expand Down Expand Up @@ -5937,6 +5941,14 @@ To initialize, and skip all current package so that next time `ALL` is used, onl
ascli faspex5 packages receive INIT --once-only=yes
```

### Faspex 5: Invitations

There are two types of invitations of package submission: public or private.

Public invitations are for external users, provide just the email address.

Private invitations are for internal users, provide the user or shared inbox identifier through field `recipient_name`.

### Faspex 5: Faspex 4-style postprocessing

`ascli` provides command `postprocessing` in plugin `faspex5` to emulate Faspex 4 postprocessing.
Expand Down
6 changes: 4 additions & 2 deletions aspera-cli.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ Gem::Specification.new do |spec|
# see also Aspera::Cli::RUBY_CURRENT_MINIMUM_VERSION
spec.required_ruby_version = '>= 2.6'
# dependency gems for runtime
spec.add_runtime_dependency('base64', '~> 0.2.0')
spec.add_runtime_dependency('bigdecimal', '~> 3.1', '>= 3.1.6')
# if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('3.0.0')
# spec.add_runtime_dependency('base64', '~> 0.2.0')
# spec.add_runtime_dependency('bigdecimal', '~> 3.1', '>= 3.1.6')
# end
spec.add_runtime_dependency('blankslate', '~> 3.1')
spec.add_runtime_dependency('csv', '~> 3.0')
spec.add_runtime_dependency('execjs', '~> 2.0')
Expand Down
74 changes: 45 additions & 29 deletions docs/Manual.html

Large diffs are not rendered by default.

Binary file modified docs/Manual.pdf
Binary file not shown.
8 changes: 8 additions & 0 deletions docs/README.erb.md
Original file line number Diff line number Diff line change
Expand Up @@ -5222,6 +5222,14 @@ To initialize, and skip all current package so that next time `ALL` is used, onl
<%=cmd%> faspex5 packages receive INIT --once-only=yes
```
### Faspex 5: Invitations
There are two types of invitations of package submission: public or private.
Public invitations are for external users, provide just the email address.
Private invitations are for internal users, provide the user or shared inbox identifier through field `recipient_name`.
### Faspex 5: Faspex 4-style postprocessing
<%=tool%> provides command `postprocessing` in plugin `faspex5` to emulate Faspex 4 postprocessing.
Expand Down
5 changes: 3 additions & 2 deletions docs/test_env.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ cli_default:
- https://127.0.0.1:9092
- https://localhost:9093
- https://127.0.0.1:9093
- https://my_local_server:9093
- https://ifconfig.me
- https://localhost:12345
- https://localhost:12346
Expand Down Expand Up @@ -161,14 +162,14 @@ tst_ats:
tst_bss:
password: your value here
preview_ak:
url: http://localhost:9091
url: http://my_local_server:9091
username: my_user
password: your value here
mimemagic: false
ts:
ssh_port: 22
tst_node_preview:
url: http://localhost:9091
url: http://my_local_server:9091
username: my_user
password: your value here
tst_cos:
Expand Down
17 changes: 16 additions & 1 deletion lib/aspera/cli/plugins/faspex5.rb
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ def package_action
end # case package
end

ACTIONS = %i[health version user bearer_token packages shared_folders admin gateway postprocessing].freeze
ACTIONS = %i[health version user bearer_token packages shared_folders admin gateway postprocessing invitations].freeze

def execute_action
command = options.get_next_command(ACTIONS)
Expand Down Expand Up @@ -637,6 +637,21 @@ def execute_action
return { type: :single_object, data: result }
end
end
when :invitations
invitation_endpoint = 'invitations'
invitation_command = options.get_next_command(%i[resend].concat(Plugin::ALL_OPS))
case invitation_command
when :create
return do_bulk_operation(command: invitation_command, descr: 'data') do |params|
invitation_endpoint = params.key?('recipient_name') ? 'public_invitations' : 'invitations'
@api_v5.create(invitation_endpoint, params)[:data]
end
when :resend
@api_v5.create("#{invitation_endpoint}/#{instance_identifier}/resend")
return Main.result_status('Invitation resent')
else
return entity_command(invitation_command, @api_v5, invitation_endpoint, item_list_key: invitation_endpoint, display_fields: %w[id public recipient_type recipient_name email_address])
end
when :gateway
require 'aspera/faspex_gw'
url = value_create_modify(command: command, description: 'listening url (e.g. https://localhost:12345)', type: String)
Expand Down
Loading

0 comments on commit 183f283

Please sign in to comment.