safe-t-rest 0.0.1
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 +7 -0
- data/README.md +31 -0
- data/lib/safe-t-rest.rb +29 -0
- data/safe-t-rest.gemspec +20 -0
- metadata +68 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c0c483ad5a1b21c1f6163fa02633577014621a37
|
4
|
+
data.tar.gz: 3fb3ecf48818f6945a779dd301c735262087b8b8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5f2adf123135f03b8cfcb9e2a1ba502e1dd60e404f21fb203a73fce35d6436d42e7c84d29026d1763e0591bdf42b1564f508d896fe46a9702158b262cdb1d333
|
7
|
+
data.tar.gz: 33d5ec379f109537a6691ec53fe412305666b8bc0797f0e4154028f64a0d1ab8d224050cc079d5e3e2e855c3afd0ac5476fbf99efd3c9e2718e3f0e5c0872089
|
data/README.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# safe-t-rest
|
2
|
+
A ruby gem for Safe-T Box Rest integration
|
3
|
+
|
4
|
+
Basic usage:
|
5
|
+
================
|
6
|
+
|
7
|
+
* Require the gem
|
8
|
+
```ruby
|
9
|
+
require 'safe-t-rest'
|
10
|
+
```
|
11
|
+
|
12
|
+
* Initialize a new instance
|
13
|
+
```ruby
|
14
|
+
client = SafeTRest.new
|
15
|
+
```
|
16
|
+
|
17
|
+
* Configure the client
|
18
|
+
```ruby
|
19
|
+
client.url = 'https://Safe-T_Box_Site.com/ui_api/login.aspx'
|
20
|
+
client.username = 'test'
|
21
|
+
client.password = '12345'
|
22
|
+
client.extenstion_id = '435-34534-24-234-6'
|
23
|
+
client.role_id = '00006'
|
24
|
+
client.guid = 'my_packge_GUID.123123'
|
25
|
+
```
|
26
|
+
|
27
|
+
* Send requests
|
28
|
+
```ruby
|
29
|
+
puts client.getAppsProcessState
|
30
|
+
puts client.getPackageFileList
|
31
|
+
```
|
data/lib/safe-t-rest.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'rest-client'
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
class SafeTRest
|
6
|
+
attr_accessor(:extenstion_id, :username, :password, :url, :role_id, :guid)
|
7
|
+
|
8
|
+
def getAppsProcessState
|
9
|
+
a = RestClient::Request.execute(
|
10
|
+
:method => :post,
|
11
|
+
:url => @url,
|
12
|
+
:headers => {
|
13
|
+
:servletRequestID => 'MethodRequest',
|
14
|
+
:BusinessLogic => "{Username:'#{@username}', Passowrd:'#{@password}', RoleID: '#{@role_id}', ExtensionID: '#{@extenstion_id}', GetAppsProcessState: ['#{@guid}', false]}"
|
15
|
+
}
|
16
|
+
)
|
17
|
+
end
|
18
|
+
|
19
|
+
def getPackageFileList
|
20
|
+
a = RestClient::Request.execute(
|
21
|
+
:method => :post,
|
22
|
+
:url => @url,
|
23
|
+
:headers => {
|
24
|
+
:servletRequestID => 'MethodRequest',
|
25
|
+
:BusinessLogic => "{Username:'#{@username}', Passowrd:'#{@password}', RoleID: '#{@role_id}', ExtensionID: '#{@extenstion_id}', GetPackageFileList: ['#{@guid}', false]}"
|
26
|
+
}
|
27
|
+
)
|
28
|
+
end
|
29
|
+
end
|
data/safe-t-rest.gemspec
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = 'safe-t-rest'
|
3
|
+
s.version = '0.0.1'
|
4
|
+
s.date = Time.now.strftime('%Y-%m-%d')
|
5
|
+
s.summary = 'A ruby gem to interact with Safe-T Box.'
|
6
|
+
s.description = 'Ruby gem to interact with Safe-T Box rest API. '
|
7
|
+
s.authors = ['Bar Hofesh']
|
8
|
+
s.email = ['Bar.Hofesh@safe-t.com']
|
9
|
+
s.homepage = 'https://github.com/bararchy/safe-t-rest'
|
10
|
+
s.license = 'none'
|
11
|
+
|
12
|
+
s.files = Dir[
|
13
|
+
'README.md',
|
14
|
+
'Rakefile',
|
15
|
+
'lib/*.rb',
|
16
|
+
'*.gemspec'
|
17
|
+
]
|
18
|
+
|
19
|
+
s.add_dependency 'rest-client', '~> 1.7', '>= 1.7.3'
|
20
|
+
end
|
metadata
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: safe-t-rest
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Bar Hofesh
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-02-27 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rest-client
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.7'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 1.7.3
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.7'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.7.3
|
33
|
+
description: 'Ruby gem to interact with Safe-T Box rest API. '
|
34
|
+
email:
|
35
|
+
- Bar.Hofesh@safe-t.com
|
36
|
+
executables: []
|
37
|
+
extensions: []
|
38
|
+
extra_rdoc_files: []
|
39
|
+
files:
|
40
|
+
- README.md
|
41
|
+
- lib/safe-t-rest.rb
|
42
|
+
- safe-t-rest.gemspec
|
43
|
+
homepage: https://github.com/bararchy/safe-t-rest
|
44
|
+
licenses:
|
45
|
+
- none
|
46
|
+
metadata: {}
|
47
|
+
post_install_message:
|
48
|
+
rdoc_options: []
|
49
|
+
require_paths:
|
50
|
+
- lib
|
51
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
requirements: []
|
62
|
+
rubyforge_project:
|
63
|
+
rubygems_version: 2.4.5
|
64
|
+
signing_key:
|
65
|
+
specification_version: 4
|
66
|
+
summary: A ruby gem to interact with Safe-T Box.
|
67
|
+
test_files: []
|
68
|
+
has_rdoc:
|