wallix_rest_client 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d3e4e95a562ab80ce426d989ced99aa0efadf095177b1946914cbbbe7ac0ed4b
4
- data.tar.gz: '0690dfc248f66ba2d9b4fbe4614dd13014ce9bff986fec5858bc65b31e678945'
3
+ metadata.gz: b30200d7659e0acdd244cc6128627d986b3b54f55528ba1cc5cfd50c6466cf7e
4
+ data.tar.gz: 6a2919742098e026a14ba1615cbfa522b72cbb85fa382bc09c9baa60ba387a32
5
5
  SHA512:
6
- metadata.gz: ad7a02ad80141bee73a33240734a5d075cda37fac8744701674ab7b3168f1b2bd8b26c281221254795ee2e5b1e42b39139bd87696a0b3fd98e65192fc6adf98c
7
- data.tar.gz: 92c021907083e8af6a92b86cf2492fb47baaf44260bfa9c989decfb9893d1845b3f0996d0ef361fc52ef297974a49b00102334c0c5a2348d65d6c2d49b391c7f
6
+ metadata.gz: 2c99e789f85d0f06efb441782c34d6303d402e2e6d53db813cbbf14c81e6468867b31260fb8fa83d72b2384dd31e330c202aeb84e8dad56d0350752a205b7e17
7
+ data.tar.gz: d0c8d86ef10323f4b26ecc617a7f71bf09eeb74af7769ebbd3741648f4501b93e0a4ed88b110fc13e0c329ec6f3c391642b0750851439e66b35553e187807a69
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Cyberwatch SAS
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -24,7 +24,90 @@ Or install it yourself as:
24
24
 
25
25
  ## Usage
26
26
 
27
- Todo.
27
+ ### Prerequisites
28
+
29
+ - [ ] A user account to access the API + a password or key
30
+ - [ ] A group in which the user is
31
+ - [ ] A group in which **every** resources you need to access are located
32
+ - [ ] A **password checkout** authorization between the user group and the resources group
33
+
34
+ ### Configuration
35
+
36
+ The library needs to be configured using your account's password or API key, depending on which authentication mode you choose.
37
+
38
+ **Basic mode**
39
+
40
+ ```ruby
41
+ require 'wallix_rest_client'
42
+
43
+ WallixRestClient.setup do |config|
44
+ config.base_uri = 'https://wallixbastion.localdomain'
45
+ config.user = 'username'
46
+ config.secret = 'mypassword'
47
+ config.options = { auth: :basic, verify_ssl: false }
48
+ end
49
+ ```
50
+
51
+ **API Key mode**
52
+
53
+ ```ruby
54
+ require 'wallix_rest_client'
55
+
56
+ WallixRestClient.setup do |config|
57
+ config.base_uri = 'https://wallixbastion.localdomain'
58
+ config.user = 'username'
59
+ config.secret = 'myapisecretkey'
60
+ config.options = { auth: :api_key, verify_ssl: false }
61
+ end
62
+ ```
63
+
64
+ ### API Requests
65
+
66
+ **Get the target's approval request**
67
+
68
+ ```ruby
69
+ require 'wallix_rest_client'
70
+
71
+ req = WallixRestClient.get_approvals_requests_target('testaccount@domaintest')
72
+
73
+ req.code # => 200
74
+
75
+ req.body # => {
76
+ # "approval": "not_required",
77
+ # "message": "You can connect to the target without an approval request.",
78
+ # "id": "",
79
+ # "ticket": "disabled",
80
+ # "comment": "disabled"
81
+ # }
82
+ ```
83
+
84
+ **Get the target's credentials**
85
+
86
+ ```ruby
87
+ require 'wallix_rest_client'
88
+
89
+ req = WallixRestClient.get_targetpasswords_checkout('testaccount@domaintest')
90
+
91
+ req.code # => 200
92
+
93
+ # With password
94
+ req.body # => {
95
+ # "login": "testaccount",
96
+ # "password": "testpassword",
97
+ # "locked": false,
98
+ # "lock_time": null
99
+ # }
100
+
101
+ # With SSH Key
102
+ req.body # => {
103
+ # "lock_time": null,
104
+ # "locked": false,
105
+ # "ssh_key": "-----BEGIN RSA PRIVATE KEY---...",
106
+ # "login": "testaccount",
107
+ # "password": "",
108
+ # "ssh_certificate": null
109
+ # }
110
+ ```
28
111
 
29
112
  ## Development
30
113
 
@@ -76,8 +76,7 @@ module WallixRestClient
76
76
 
77
77
  # Run the HTTP request
78
78
  def run_request(path, resource, type, query_params = {}, post_params = {})
79
- uri = URI.parse([configuration.base_uri, '/api/', path, resource.to_s,
80
- build_query_params(query_params)].join(''))
79
+ uri = URI::join(configuration.base_uri, '/api/', path, resource.to_s, build_query_params(query_params))
81
80
 
82
81
  http = build_http(uri)
83
82
  request = build_request(type, uri)
@@ -1,3 +1,3 @@
1
1
  module WallixRestClient
2
- VERSION = '0.4.0'.freeze
2
+ VERSION = '0.5.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wallix_rest_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maxime Alay-Eddine
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-29 00:00:00.000000000 Z
11
+ date: 2018-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -109,6 +109,7 @@ files:
109
109
  - CODE_OF_CONDUCT.md
110
110
  - Gemfile
111
111
  - Gemfile.lock
112
+ - LICENSE.txt
112
113
  - README.md
113
114
  - Rakefile
114
115
  - bin/console