safe-t-rest 0.0.4 → 0.0.5
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 +23 -0
- data/lib/safe-t-rest.rb +55 -47
- data/safe-t-rest.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b8190532e352f035b2b321f98e7ba83aac7f94c
|
4
|
+
data.tar.gz: 9e50cfc6e396ea5d9e0f094f4b059c32c68db29a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94ff331dda6f0bde22a8d25d5a32aab612c02f2249c17ec04e268c9f9a210e09ccf3c89f0c1fa087fe8ba51ef3c6af693ec04506fac926989a257ca878eb0644
|
7
|
+
data.tar.gz: 56b10c2c05b2ec61964e343c619e843deb90067ac0adeb72271783579e4f8593f3ba280581233e6da10b9972806df4cbefe38d8d7f02dee06b0d237bbf9cb40d
|
data/README.md
CHANGED
@@ -33,4 +33,27 @@ client.guid = 'my_packge_GUID.123123'
|
|
33
33
|
```ruby
|
34
34
|
puts client.getAppsProcessState
|
35
35
|
puts client.getPackageFileList
|
36
|
+
```
|
37
|
+
|
38
|
+
* Safe Share
|
39
|
+
```ruby
|
40
|
+
args = {
|
41
|
+
:files => 'file.txt', # name of file to share
|
42
|
+
:recipients => 'alexander.dan@safe-t.com', # Email address of the one you want to share with
|
43
|
+
:sender_name => 'Bar Hofesh',
|
44
|
+
:sender_address => 'bar.hofesh@safe-t.com',
|
45
|
+
:subject => 'Testing Ruby API', # Email Subject
|
46
|
+
:message => 'This is a Test message, just checking the Ruby API using REST', # Email body message
|
47
|
+
:message_encryption_level => '0', # 0 = high, 1 = normal, 2 = low
|
48
|
+
:delivery_method => '0',
|
49
|
+
:mobile_recipient => '',
|
50
|
+
:return_receipt => true, # get back a notification when the file was downloaded
|
51
|
+
:safe_reply => true, # send an safe reply invitation
|
52
|
+
:max_downloads => '3', # maximum number of allowed downloads
|
53
|
+
:package_expiry => '1440', # in minutes
|
54
|
+
:folder_path => '', # empty means root folder
|
55
|
+
:root_folder_id => '417' # My Storage ID
|
56
|
+
}
|
57
|
+
|
58
|
+
client.iSafeShareFile(args)
|
36
59
|
```
|
data/lib/safe-t-rest.rb
CHANGED
@@ -1,74 +1,82 @@
|
|
1
1
|
require 'rest-client'
|
2
|
-
require 'base64'
|
3
2
|
|
4
|
-
|
5
3
|
class SafeTRest
|
6
4
|
attr_accessor(:extenstion_id, :username, :password, :url, :role_id, :guid)
|
7
5
|
|
8
6
|
def getAppsProcessState
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
7
|
+
RestClient::Request.execute(
|
8
|
+
:method => :post,
|
9
|
+
:url => @url,
|
10
|
+
:headers => {
|
11
|
+
:servletRequestID => 'MethodRequest',
|
12
|
+
:BusinessLogic => "{Username:'', Password:'', RoleID: '#{@role_id}', ExtensionID: '#{@extenstion_id}', GetAppsProcessState: ['#{@guid}', false]}"
|
13
|
+
}
|
16
14
|
)
|
17
15
|
end
|
18
16
|
|
19
17
|
def getPackageFileList
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
18
|
+
RestClient::Request.execute(
|
19
|
+
:method => :post,
|
20
|
+
:url => @url,
|
21
|
+
:headers => {
|
22
|
+
:servletRequestID => 'MethodRequest',
|
23
|
+
:BusinessLogic => "{Username:'', Password:'', RoleID: '#{@role_id}', ExtensionID: '#{@extenstion_id}', GetPackageFileList: ['#{@guid}']}"
|
24
|
+
}
|
27
25
|
)
|
28
26
|
end
|
29
27
|
|
30
28
|
def iVerifyUserAccount
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
)
|
39
|
-
return [a[0], Base64.decode64(a[1])].join(':')
|
29
|
+
RestClient::Request.execute(
|
30
|
+
:method => :post,
|
31
|
+
:url => @url,
|
32
|
+
:headers => {
|
33
|
+
:servletRequestID => 'MethodRequest',
|
34
|
+
:BusinessLogic => "{Username:'', Password:'', RoleID: '#{@role_id}', ExtensionID: '#{@extenstion_id}', iVerifyUserAccount: ['#{@username}', '#{@password}', true]}"
|
35
|
+
}
|
36
|
+
)
|
40
37
|
end
|
41
38
|
|
42
39
|
def iGetHistory(days)
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
40
|
+
RestClient::Request.execute(
|
41
|
+
:method => :post,
|
42
|
+
:url => @url,
|
43
|
+
:headers => {
|
44
|
+
:servletRequestID => 'MethodRequest',
|
45
|
+
:BusinessLogic => "{Username:'', Password:'', RoleID: '#{@role_id}', ExtensionID: '#{@extenstion_id}', iGetHistory: ['#{@username}', '#{@password}', #{days}]}"
|
46
|
+
}
|
50
47
|
)
|
51
48
|
end
|
52
49
|
|
53
50
|
def iUserAccountAddressList
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
51
|
+
RestClient::Request.execute(
|
52
|
+
:method => :post,
|
53
|
+
:url => @url,
|
54
|
+
:headers => {
|
55
|
+
:servletRequestID => 'MethodRequest',
|
56
|
+
:BusinessLogic => "{Username:'', Password:'', RoleID: '#{@role_id}', ExtensionID: '#{@extenstion_id}', iUserAccountAddressList: ['#{@username}', '#{@password}']}"
|
57
|
+
}
|
58
|
+
)
|
59
|
+
end
|
60
|
+
|
61
|
+
def iGetFolderList(path)
|
62
|
+
RestClient::Request.execute(
|
63
|
+
:method => :post,
|
64
|
+
:url => @url,
|
65
|
+
:headers => {
|
66
|
+
:servletRequestID => 'MethodRequest',
|
67
|
+
:BusinessLogic => "{Username:'', Password:'', RoleID: '#{@role_id}', ExtensionID: '#{@extenstion_id}', iGetFolderList: ['#{@username}', '#{@password}', #{false}, #{true}, '#{path}', 417]}"
|
68
|
+
}
|
61
69
|
)
|
62
70
|
end
|
63
71
|
|
64
|
-
def
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
+
def iSafeShareFile(args)
|
73
|
+
RestClient::Request.execute(
|
74
|
+
:method => :post,
|
75
|
+
:url => @url,
|
76
|
+
:headers => {
|
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
|
+
}
|
72
80
|
)
|
73
81
|
end
|
74
82
|
|
data/safe-t-rest.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: safe-t-rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bar Hofesh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|