safe-t-rest 0.0.5 → 0.0.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.
- checksums.yaml +4 -4
- data/README.md +14 -1
- data/lib/safe-t-rest.rb +24 -14
- data/safe-t-rest.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d08e7baf5ddf74931e910c0acd141994a79b977
|
4
|
+
data.tar.gz: b31fd0992d99d45a19b98dafdc1316d1988cff87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33252e36960ad4317d852183567c5d28f47720fb4ae38e178f7ef8cf850b0a727f26b10e29bd225f235a5002d868f8a58f0ae62cd40eedef7cd64c2dccbc4924
|
7
|
+
data.tar.gz: 28482841d04a6c0a7acf9ddbff8d6e917be6f31a963ee87a0b9b8c0902071ae5970a22c59e3b029476a80c8a8c9b7a20cb5c624c9c3730f1895827eed4942a8d
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# safe-t-rest
|
2
|
-
A ruby gem for Safe-T Box
|
2
|
+
A ruby gem for Safe-T Box REST API
|
3
3
|
|
4
4
|
Basic usage:
|
5
5
|
================
|
@@ -32,6 +32,7 @@ client.guid = 'my_packge_GUID.123123'
|
|
32
32
|
* Send requests
|
33
33
|
```ruby
|
34
34
|
puts client.getAppsProcessState
|
35
|
+
|
35
36
|
puts client.getPackageFileList
|
36
37
|
```
|
37
38
|
|
@@ -56,4 +57,16 @@ args = {
|
|
56
57
|
}
|
57
58
|
|
58
59
|
client.iSafeShareFile(args)
|
60
|
+
```
|
61
|
+
|
62
|
+
* File Upload
|
63
|
+
```ruby
|
64
|
+
args = {
|
65
|
+
:file_base64 => 'V29ya2luZyA6KQo=', # the file as a base64 string Base64.encode64(File.read(file))
|
66
|
+
:file_name => 'file.txt', # the name of the file
|
67
|
+
:folder_path => '', # empty means root folder
|
68
|
+
:root_folder_id => 417 # My Storage ID
|
69
|
+
}
|
70
|
+
|
71
|
+
client.iFileUpload(args)
|
59
72
|
```
|
data/lib/safe-t-rest.rb
CHANGED
@@ -8,8 +8,8 @@ class SafeTRest
|
|
8
8
|
:method => :post,
|
9
9
|
:url => @url,
|
10
10
|
:headers => {
|
11
|
-
|
12
|
-
|
11
|
+
:servletRequestID => 'MethodRequest',
|
12
|
+
:BusinessLogic => "{Username:'', Password:'', RoleID: '#{@role_id}', ExtensionID: '#{@extenstion_id}', GetAppsProcessState: ['#{@guid}', false]}"
|
13
13
|
}
|
14
14
|
)
|
15
15
|
end
|
@@ -19,8 +19,8 @@ class SafeTRest
|
|
19
19
|
:method => :post,
|
20
20
|
:url => @url,
|
21
21
|
:headers => {
|
22
|
-
|
23
|
-
|
22
|
+
:servletRequestID => 'MethodRequest',
|
23
|
+
:BusinessLogic => "{Username:'', Password:'', RoleID: '#{@role_id}', ExtensionID: '#{@extenstion_id}', GetPackageFileList: ['#{@guid}']}"
|
24
24
|
}
|
25
25
|
)
|
26
26
|
end
|
@@ -30,8 +30,8 @@ class SafeTRest
|
|
30
30
|
:method => :post,
|
31
31
|
:url => @url,
|
32
32
|
:headers => {
|
33
|
-
|
34
|
-
|
33
|
+
:servletRequestID => 'MethodRequest',
|
34
|
+
:BusinessLogic => "{Username:'', Password:'', RoleID: '#{@role_id}', ExtensionID: '#{@extenstion_id}', iVerifyUserAccount: ['#{@username}', '#{@password}', true]}"
|
35
35
|
}
|
36
36
|
)
|
37
37
|
end
|
@@ -41,8 +41,8 @@ class SafeTRest
|
|
41
41
|
:method => :post,
|
42
42
|
:url => @url,
|
43
43
|
:headers => {
|
44
|
-
|
45
|
-
|
44
|
+
:servletRequestID => 'MethodRequest',
|
45
|
+
:BusinessLogic => "{Username:'', Password:'', RoleID: '#{@role_id}', ExtensionID: '#{@extenstion_id}', iGetHistory: ['#{@username}', '#{@password}', #{days}]}"
|
46
46
|
}
|
47
47
|
)
|
48
48
|
end
|
@@ -52,8 +52,8 @@ class SafeTRest
|
|
52
52
|
:method => :post,
|
53
53
|
:url => @url,
|
54
54
|
:headers => {
|
55
|
-
|
56
|
-
|
55
|
+
:servletRequestID => 'MethodRequest',
|
56
|
+
:BusinessLogic => "{Username:'', Password:'', RoleID: '#{@role_id}', ExtensionID: '#{@extenstion_id}', iUserAccountAddressList: ['#{@username}', '#{@password}']}"
|
57
57
|
}
|
58
58
|
)
|
59
59
|
end
|
@@ -63,8 +63,8 @@ class SafeTRest
|
|
63
63
|
:method => :post,
|
64
64
|
:url => @url,
|
65
65
|
:headers => {
|
66
|
-
|
67
|
-
|
66
|
+
:servletRequestID => 'MethodRequest',
|
67
|
+
:BusinessLogic => "{Username:'', Password:'', RoleID: '#{@role_id}', ExtensionID: '#{@extenstion_id}', iGetFolderList: ['#{@username}', '#{@password}', #{false}, #{true}, '#{path}', 417]}"
|
68
68
|
}
|
69
69
|
)
|
70
70
|
end
|
@@ -74,11 +74,21 @@ class SafeTRest
|
|
74
74
|
:method => :post,
|
75
75
|
:url => @url,
|
76
76
|
:headers => {
|
77
|
-
|
78
|
-
|
77
|
+
:servletRequestID => 'MethodRequest',
|
78
|
+
:BusinessLogic => "{Username:'', Password:'', RoleID: '#{@role_id}', ExtensionID: '#{@extenstion_id}', iSafeShareFile: ['#{@username}', '#{@password}', '#{args[:files]}', '#{args[:recipients]}', '#{args[:sender_name]}', '#{args[:sender_address]}', '#{args[:subject]}', '#{args[:message]}', #{args[:message_encryption_level]}, #{args[:delivery_method]}, '#{args[:mobile_recipient]}', #{args[:return_receipt]}, #{args[:safe_reply]}, #{args[:max_downloads]}, #{args[:package_expiry]}, '#{args[:folder_path]}', #{args[:root_folder_id]}]}"
|
79
79
|
}
|
80
80
|
)
|
81
81
|
end
|
82
82
|
|
83
|
+
def iFileUpload(args)
|
84
|
+
RestClient::Request.execute(
|
85
|
+
:method => :post,
|
86
|
+
:url => @url,
|
87
|
+
:headers => {
|
88
|
+
:servletRequestID => 'MethodRequest',
|
89
|
+
:BusinessLogic => "{Username:'', Password:'', RoleID: '#{@role_id}', ExtensionID: '#{@extenstion_id}', iFileUpload: ['#{@username}', '#{@password}', '#{args[:file_base64]}', '#{args[:file_name]}', '#{args[:folder_path]}', #{args[:root_folder_id]}]}"
|
90
|
+
}
|
91
|
+
)
|
92
|
+
end
|
83
93
|
|
84
94
|
end
|
data/safe-t-rest.gemspec
CHANGED