files.com 1.1.4 → 1.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_VERSION +1 -1
- data/docs/group.md +33 -1
- data/docs/site.md +2 -0
- data/lib/files.com/errors.rb +10 -9
- data/lib/files.com/models/group.rb +48 -0
- data/lib/files.com/models/site.rb +1 -0
- data/lib/files.com/version.rb +1 -1
- data/spec/lib/api_client_spec.rb +35 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d204d36cb4681395bf61b23e0c9d73d33827e4c04211334b7cd0b57633f5029
|
4
|
+
data.tar.gz: ab71996f578fcb8249c2d2d36888d3202889a6793cb5a90242012627e8845943
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbb4c50ed59def6332dac58512c5732dc0beab6f19d2d9e87355736566321af92d55b33667461430d8a3d0c0337b40b73bffc8d5fdd076f967061ff2a9874511
|
7
|
+
data.tar.gz: 02c8ebf097990aa18dc3d05be9e97011a385b95611f752979b46641f852b1429716358b8853583355a58a9a58619788eb590a2c04de5c6c5f5af79fc55c714b9
|
data/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.6
|
data/docs/group.md
CHANGED
@@ -9,7 +9,11 @@
|
|
9
9
|
"admin_ids": "1",
|
10
10
|
"notes": "example",
|
11
11
|
"user_ids": "1",
|
12
|
-
"usernames": "example"
|
12
|
+
"usernames": "example",
|
13
|
+
"ftp_permission": true,
|
14
|
+
"sftp_permission": true,
|
15
|
+
"dav_permission": true,
|
16
|
+
"restapi_permission": true
|
13
17
|
}
|
14
18
|
```
|
15
19
|
|
@@ -19,6 +23,10 @@
|
|
19
23
|
* `notes` (string): Notes about this group
|
20
24
|
* `user_ids` (string): Comma-delimited list of user IDs who belong to this group (separated by commas)
|
21
25
|
* `usernames` (string): Comma-delimited list of usernames who belong to this group (separated by commas)
|
26
|
+
* `ftp_permission` (boolean): If true, users in this group can use FTP to login. This will override a false value of `ftp_permission` on the user level.
|
27
|
+
* `sftp_permission` (boolean): If true, users in this group can use SFTP to login. This will override a false value of `sftp_permission` on the user level.
|
28
|
+
* `dav_permission` (boolean): If true, users in this group can use WebDAV to login. This will override a false value of `dav_permission` on the user level.
|
29
|
+
* `restapi_permission` (boolean): If true, users in this group can use the REST API to login. This will override a false value of `restapi_permission` on the user level.
|
22
30
|
|
23
31
|
|
24
32
|
---
|
@@ -63,6 +71,10 @@ Files::Group.create(
|
|
63
71
|
notes: "example",
|
64
72
|
user_ids: "1",
|
65
73
|
admin_ids: "1",
|
74
|
+
ftp_permission: true,
|
75
|
+
sftp_permission: true,
|
76
|
+
dav_permission: true,
|
77
|
+
restapi_permission: true,
|
66
78
|
name: "name"
|
67
79
|
)
|
68
80
|
```
|
@@ -72,6 +84,10 @@ Files::Group.create(
|
|
72
84
|
* `notes` (string): Group notes.
|
73
85
|
* `user_ids` (string): A list of user ids. If sent as a string, should be comma-delimited.
|
74
86
|
* `admin_ids` (string): A list of group admin user ids. If sent as a string, should be comma-delimited.
|
87
|
+
* `ftp_permission` (boolean): If true, users in this group can use FTP to login. This will override a false value of `ftp_permission` on the user level.
|
88
|
+
* `sftp_permission` (boolean): If true, users in this group can use SFTP to login. This will override a false value of `sftp_permission` on the user level.
|
89
|
+
* `dav_permission` (boolean): If true, users in this group can use WebDAV to login. This will override a false value of `dav_permission` on the user level.
|
90
|
+
* `restapi_permission` (boolean): If true, users in this group can use the REST API to login. This will override a false value of `restapi_permission` on the user level.
|
75
91
|
* `name` (string): Required - Group name.
|
76
92
|
|
77
93
|
|
@@ -84,6 +100,10 @@ Files::Group.update(id,
|
|
84
100
|
notes: "example",
|
85
101
|
user_ids: "1",
|
86
102
|
admin_ids: "1",
|
103
|
+
ftp_permission: true,
|
104
|
+
sftp_permission: true,
|
105
|
+
dav_permission: true,
|
106
|
+
restapi_permission: true,
|
87
107
|
name: "owners"
|
88
108
|
)
|
89
109
|
```
|
@@ -94,6 +114,10 @@ Files::Group.update(id,
|
|
94
114
|
* `notes` (string): Group notes.
|
95
115
|
* `user_ids` (string): A list of user ids. If sent as a string, should be comma-delimited.
|
96
116
|
* `admin_ids` (string): A list of group admin user ids. If sent as a string, should be comma-delimited.
|
117
|
+
* `ftp_permission` (boolean): If true, users in this group can use FTP to login. This will override a false value of `ftp_permission` on the user level.
|
118
|
+
* `sftp_permission` (boolean): If true, users in this group can use SFTP to login. This will override a false value of `sftp_permission` on the user level.
|
119
|
+
* `dav_permission` (boolean): If true, users in this group can use WebDAV to login. This will override a false value of `dav_permission` on the user level.
|
120
|
+
* `restapi_permission` (boolean): If true, users in this group can use the REST API to login. This will override a false value of `restapi_permission` on the user level.
|
97
121
|
* `name` (string): Group name.
|
98
122
|
|
99
123
|
|
@@ -121,6 +145,10 @@ group.update(
|
|
121
145
|
notes: "example",
|
122
146
|
user_ids: "1",
|
123
147
|
admin_ids: "1",
|
148
|
+
ftp_permission: true,
|
149
|
+
sftp_permission: true,
|
150
|
+
dav_permission: true,
|
151
|
+
restapi_permission: true,
|
124
152
|
name: "owners"
|
125
153
|
)
|
126
154
|
```
|
@@ -131,6 +159,10 @@ group.update(
|
|
131
159
|
* `notes` (string): Group notes.
|
132
160
|
* `user_ids` (string): A list of user ids. If sent as a string, should be comma-delimited.
|
133
161
|
* `admin_ids` (string): A list of group admin user ids. If sent as a string, should be comma-delimited.
|
162
|
+
* `ftp_permission` (boolean): If true, users in this group can use FTP to login. This will override a false value of `ftp_permission` on the user level.
|
163
|
+
* `sftp_permission` (boolean): If true, users in this group can use SFTP to login. This will override a false value of `sftp_permission` on the user level.
|
164
|
+
* `dav_permission` (boolean): If true, users in this group can use WebDAV to login. This will override a false value of `dav_permission` on the user level.
|
165
|
+
* `restapi_permission` (boolean): If true, users in this group can use the REST API to login. This will override a false value of `restapi_permission` on the user level.
|
134
166
|
* `name` (string): Group name.
|
135
167
|
|
136
168
|
|
data/docs/site.md
CHANGED
@@ -486,6 +486,7 @@ Files::Site.update(
|
|
486
486
|
sftp_enabled: true,
|
487
487
|
sftp_host_key_type: "default",
|
488
488
|
active_sftp_host_key_id: 1,
|
489
|
+
protocol_access_groups_only: true,
|
489
490
|
bundle_watermark_value: {"key":"example value"},
|
490
491
|
group_admins_can_set_user_password: true,
|
491
492
|
bundle_recipient_blacklist_free_email_domains: true,
|
@@ -624,6 +625,7 @@ Files::Site.update(
|
|
624
625
|
* `sftp_enabled` (boolean): Is SFTP enabled?
|
625
626
|
* `sftp_host_key_type` (string): Sftp Host Key Type
|
626
627
|
* `active_sftp_host_key_id` (int64): Id of the currently selected custom SFTP Host Key
|
628
|
+
* `protocol_access_groups_only` (boolean): If `true`, protocol access permissions on users will be ignored, and only protocol access permissions set on Groups will be honored. Make sure that your current user is a member of a group with API permission when changing this value to avoid locking yourself out of your site.
|
627
629
|
* `bundle_watermark_value` (object): Preview watermark settings applied to all bundle items. Uses the same keys as Behavior.value
|
628
630
|
* `group_admins_can_set_user_password` (boolean): Allow group admins set password authentication method
|
629
631
|
* `bundle_recipient_blacklist_free_email_domains` (boolean): Disallow free email domains for Bundle/Inbox recipients?
|
data/lib/files.com/errors.rb
CHANGED
@@ -28,17 +28,18 @@ module Files
|
|
28
28
|
class NotImplementedError < Error; end
|
29
29
|
|
30
30
|
class APIError < Error
|
31
|
-
attr_reader :detail, :error, :errors, :http_code, :instance, :model_errors, :title, :type
|
31
|
+
attr_reader :detail, :error, :errors, :http_code, :instance, :model_errors, :title, :type, :data
|
32
32
|
|
33
33
|
def initialize(message = nil, **kwargs)
|
34
|
-
@detail = kwargs.dig(:json_body,
|
35
|
-
@error = kwargs.dig(:json_body,
|
36
|
-
@errors = kwargs.dig(:json_body,
|
37
|
-
@http_code = kwargs.dig(:json_body, 'http-code')
|
38
|
-
@instance = kwargs.dig(:json_body,
|
39
|
-
@model_errors = kwargs.dig(:json_body,
|
40
|
-
@title = kwargs.dig(:json_body,
|
41
|
-
@type = kwargs.dig(:json_body,
|
34
|
+
@detail = kwargs.dig(:json_body, :detail)
|
35
|
+
@error = kwargs.dig(:json_body, :error)
|
36
|
+
@errors = kwargs.dig(:json_body, :errors)
|
37
|
+
@http_code = kwargs.dig(:json_body, :'http-code')
|
38
|
+
@instance = kwargs.dig(:json_body, :instance)
|
39
|
+
@model_errors = kwargs.dig(:json_body, :model_errors)
|
40
|
+
@title = kwargs.dig(:json_body, :title)
|
41
|
+
@type = kwargs.dig(:json_body, :type)
|
42
|
+
@data = kwargs.dig(:json_body, :data)
|
42
43
|
|
43
44
|
super(message, **kwargs)
|
44
45
|
end
|
@@ -63,10 +63,50 @@ module Files
|
|
63
63
|
@attributes[:usernames] = value
|
64
64
|
end
|
65
65
|
|
66
|
+
# boolean - If true, users in this group can use FTP to login. This will override a false value of `ftp_permission` on the user level.
|
67
|
+
def ftp_permission
|
68
|
+
@attributes[:ftp_permission]
|
69
|
+
end
|
70
|
+
|
71
|
+
def ftp_permission=(value)
|
72
|
+
@attributes[:ftp_permission] = value
|
73
|
+
end
|
74
|
+
|
75
|
+
# boolean - If true, users in this group can use SFTP to login. This will override a false value of `sftp_permission` on the user level.
|
76
|
+
def sftp_permission
|
77
|
+
@attributes[:sftp_permission]
|
78
|
+
end
|
79
|
+
|
80
|
+
def sftp_permission=(value)
|
81
|
+
@attributes[:sftp_permission] = value
|
82
|
+
end
|
83
|
+
|
84
|
+
# boolean - If true, users in this group can use WebDAV to login. This will override a false value of `dav_permission` on the user level.
|
85
|
+
def dav_permission
|
86
|
+
@attributes[:dav_permission]
|
87
|
+
end
|
88
|
+
|
89
|
+
def dav_permission=(value)
|
90
|
+
@attributes[:dav_permission] = value
|
91
|
+
end
|
92
|
+
|
93
|
+
# boolean - If true, users in this group can use the REST API to login. This will override a false value of `restapi_permission` on the user level.
|
94
|
+
def restapi_permission
|
95
|
+
@attributes[:restapi_permission]
|
96
|
+
end
|
97
|
+
|
98
|
+
def restapi_permission=(value)
|
99
|
+
@attributes[:restapi_permission] = value
|
100
|
+
end
|
101
|
+
|
66
102
|
# Parameters:
|
67
103
|
# notes - string - Group notes.
|
68
104
|
# user_ids - string - A list of user ids. If sent as a string, should be comma-delimited.
|
69
105
|
# admin_ids - string - A list of group admin user ids. If sent as a string, should be comma-delimited.
|
106
|
+
# ftp_permission - boolean - If true, users in this group can use FTP to login. This will override a false value of `ftp_permission` on the user level.
|
107
|
+
# sftp_permission - boolean - If true, users in this group can use SFTP to login. This will override a false value of `sftp_permission` on the user level.
|
108
|
+
# dav_permission - boolean - If true, users in this group can use WebDAV to login. This will override a false value of `dav_permission` on the user level.
|
109
|
+
# restapi_permission - boolean - If true, users in this group can use the REST API to login. This will override a false value of `restapi_permission` on the user level.
|
70
110
|
# name - string - Group name.
|
71
111
|
def update(params = {})
|
72
112
|
params ||= {}
|
@@ -152,6 +192,10 @@ module Files
|
|
152
192
|
# notes - string - Group notes.
|
153
193
|
# user_ids - string - A list of user ids. If sent as a string, should be comma-delimited.
|
154
194
|
# admin_ids - string - A list of group admin user ids. If sent as a string, should be comma-delimited.
|
195
|
+
# ftp_permission - boolean - If true, users in this group can use FTP to login. This will override a false value of `ftp_permission` on the user level.
|
196
|
+
# sftp_permission - boolean - If true, users in this group can use SFTP to login. This will override a false value of `sftp_permission` on the user level.
|
197
|
+
# dav_permission - boolean - If true, users in this group can use WebDAV to login. This will override a false value of `dav_permission` on the user level.
|
198
|
+
# restapi_permission - boolean - If true, users in this group can use the REST API to login. This will override a false value of `restapi_permission` on the user level.
|
155
199
|
# name (required) - string - Group name.
|
156
200
|
def self.create(params = {}, options = {})
|
157
201
|
raise InvalidParameterError.new("Bad parameter: notes must be an String") if params[:notes] and !params[:notes].is_a?(String)
|
@@ -168,6 +212,10 @@ module Files
|
|
168
212
|
# notes - string - Group notes.
|
169
213
|
# user_ids - string - A list of user ids. If sent as a string, should be comma-delimited.
|
170
214
|
# admin_ids - string - A list of group admin user ids. If sent as a string, should be comma-delimited.
|
215
|
+
# ftp_permission - boolean - If true, users in this group can use FTP to login. This will override a false value of `ftp_permission` on the user level.
|
216
|
+
# sftp_permission - boolean - If true, users in this group can use SFTP to login. This will override a false value of `sftp_permission` on the user level.
|
217
|
+
# dav_permission - boolean - If true, users in this group can use WebDAV to login. This will override a false value of `dav_permission` on the user level.
|
218
|
+
# restapi_permission - boolean - If true, users in this group can use the REST API to login. This will override a false value of `restapi_permission` on the user level.
|
171
219
|
# name - string - Group name.
|
172
220
|
def self.update(id, params = {}, options = {})
|
173
221
|
params ||= {}
|
@@ -851,6 +851,7 @@ module Files
|
|
851
851
|
# sftp_enabled - boolean - Is SFTP enabled?
|
852
852
|
# sftp_host_key_type - string - Sftp Host Key Type
|
853
853
|
# active_sftp_host_key_id - int64 - Id of the currently selected custom SFTP Host Key
|
854
|
+
# protocol_access_groups_only - boolean - If `true`, protocol access permissions on users will be ignored, and only protocol access permissions set on Groups will be honored. Make sure that your current user is a member of a group with API permission when changing this value to avoid locking yourself out of your site.
|
854
855
|
# bundle_watermark_value - object - Preview watermark settings applied to all bundle items. Uses the same keys as Behavior.value
|
855
856
|
# group_admins_can_set_user_password - boolean - Allow group admins set password authentication method
|
856
857
|
# bundle_recipient_blacklist_free_email_domains - boolean - Disallow free email domains for Bundle/Inbox recipients?
|
data/lib/files.com/version.rb
CHANGED
data/spec/lib/api_client_spec.rb
CHANGED
@@ -53,12 +53,24 @@ RSpec.describe Files::ApiClient do
|
|
53
53
|
type: "bad-request/request-param-path-cannot-have-trailing-whitespace"
|
54
54
|
}
|
55
55
|
}
|
56
|
+
let(:bad_region_request_with_data) {
|
57
|
+
{
|
58
|
+
error: "You have connected to a URL that has different security settings than those required for your site.",
|
59
|
+
'http-code': 403,
|
60
|
+
title: "Lockout Region Mismatch",
|
61
|
+
type: "not-authenticated/lockout-region-mismatch",
|
62
|
+
data: {
|
63
|
+
host: "test.host"
|
64
|
+
}
|
65
|
+
}
|
66
|
+
}
|
56
67
|
let(:bad_request_without_data) {
|
57
68
|
{
|
58
69
|
error: 'Bad Request'
|
59
70
|
}
|
60
71
|
}
|
61
72
|
let(:mock_good_response) { { status: 400, headers: {}, body: bad_request_with_data.to_json } }
|
73
|
+
let(:mock_good_region_response) { { status: 403, headers: {}, body: bad_region_request_with_data.to_json } }
|
62
74
|
let(:mock_response_without_type) { { status: 400, headers: {}, body: bad_request_without_data.to_json } }
|
63
75
|
let(:mock_empty_response) { { status: 400, headers: {}, body: '' } }
|
64
76
|
|
@@ -66,7 +78,14 @@ RSpec.describe Files::ApiClient do
|
|
66
78
|
allow(subject).to receive(:log_request).and_raise(Faraday::BadRequestError.new('', mock_good_response))
|
67
79
|
expect {
|
68
80
|
subject.execute_request_with_rescues(1, context) { 'empty block' }
|
69
|
-
}.to raise_error
|
81
|
+
}.to raise_error do |error|
|
82
|
+
expect(error).to be_a(Files::RequestParamPathCannotHaveTrailingWhitespaceError)
|
83
|
+
expect(error.message).to eq bad_request_with_data[:error]
|
84
|
+
expect(error.title).to eq "Request Param Path Cannot Have Trailing Whitespace"
|
85
|
+
expect(error.type).to eq "bad-request/request-param-path-cannot-have-trailing-whitespace"
|
86
|
+
expect(error.http_code).to eq 400
|
87
|
+
expect(error.data).to be_nil
|
88
|
+
end
|
70
89
|
end
|
71
90
|
|
72
91
|
it "throws generic bad request error when no type" do
|
@@ -82,5 +101,20 @@ RSpec.describe Files::ApiClient do
|
|
82
101
|
subject.execute_request_with_rescues(1, context) { 'empty block' }
|
83
102
|
}.to raise_error(Files::APIConnectionError)
|
84
103
|
end
|
104
|
+
|
105
|
+
it "handles region lockout error response" do
|
106
|
+
allow(subject).to receive(:log_request).and_raise(Faraday::BadRequestError.new('', mock_good_region_response))
|
107
|
+
expect {
|
108
|
+
subject.execute_request_with_rescues(1, context) { 'empty block' }
|
109
|
+
}.to raise_error do |error|
|
110
|
+
expect(error).to be_a(Files::LockoutRegionMismatchError)
|
111
|
+
expect(error.message).to eq bad_region_request_with_data[:error]
|
112
|
+
expect(error.title).to eq "Lockout Region Mismatch"
|
113
|
+
expect(error.type).to eq "not-authenticated/lockout-region-mismatch"
|
114
|
+
expect(error.http_code).to eq 403
|
115
|
+
expect(error.data).to have_key(:host)
|
116
|
+
expect(error.data[:host]).to eq "test.host"
|
117
|
+
end
|
118
|
+
end
|
85
119
|
end
|
86
120
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: files.com
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- files.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|