oso-cloud 0.2.0 → 0.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f79239f03cdcaddbb6a8c9800b4c83a5d28b4acccd3cae2875a9585306c1531e
4
- data.tar.gz: 59764d372207e4beda482bddf6f4489573a640d61ba9d064d2644931ffe6dde0
3
+ metadata.gz: 062aa3d76c978722bbc9242d4a7c594eb0feb62146559dcc9a07b3d24f81f5c2
4
+ data.tar.gz: 8f5afb67fd4e4242c35c7808df00b0bf0bbcd9fcd83257d3a34f218a33625070
5
5
  SHA512:
6
- metadata.gz: f68bf249055cf164b296a945a3149e0b4328f6da4843105b9455c9e864dd87d7b25374cb8cc2d3c76f971368b9944bd72784e15f36564ba5f9ed89ca538f955e
7
- data.tar.gz: be9850f671f35bc24f64061b9975e92aba2c66d5c6ce9c4b33bbf2027c4e4cba7b7e62bef2f82d1057b1ed15763022d51d32d8200397629050145e271520bc45
6
+ metadata.gz: bd87423b50e294bbf5ea4761a9287fd9a885b94a803ba8a51f56b428197b1bb37612828e7e58c8124e140ff6a0173d7f5614b6eb86141e6a2aeb4affa705ac83
7
+ data.tar.gz: b3b1bfd172c4adcd344b2531875d1337cf0a34b3ccd12d0536a1c419a51c1a333ff2363f9d7ca9ab686f468de25bc0696ae2cae60bee2bfcc7ae59e83a956abc
data/.gitignore CHANGED
@@ -1,3 +1,2 @@
1
- Gemfile.lock
2
1
  .bundle
3
2
  vendor
data/Gemfile.lock ADDED
@@ -0,0 +1,19 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ oso-cloud (0.3.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ rake (12.3.3)
10
+
11
+ PLATFORMS
12
+ ruby
13
+
14
+ DEPENDENCIES
15
+ oso-cloud!
16
+ rake (~> 12.0)
17
+
18
+ BUNDLED WITH
19
+ 2.1.4
data/lib/oso/client.rb CHANGED
@@ -78,22 +78,26 @@ module Oso
78
78
 
79
79
  private
80
80
 
81
- def auth()
82
- {"Authorization" => "Basic %s" % @api_key}
81
+ def headers()
82
+ {
83
+ "Authorization" => "Basic %s" % @api_key,
84
+ "User-Agent" => "Oso Cloud (ruby)",
85
+ "Accept": "application/json"
86
+ }
83
87
  end
84
88
 
85
89
  def get(path)
86
- result = Net::HTTP.get(URI("#{@url}/api/#{path}"), auth)
90
+ result = Net::HTTP.get(URI("#{@url}/api/#{path}"), headers)
87
91
  handle_result result
88
92
  end
89
93
 
90
94
  def post(path, params)
91
- result = Net::HTTP.post(URI("#{@url}/api/#{path}"), params.to_json, auth)
95
+ result = Net::HTTP.post(URI("#{@url}/api/#{path}"), params.to_json, headers)
92
96
  handle_result result
93
97
  end
94
98
 
95
99
  def delete(path, params)
96
- result = Net::HTTP.delete(URI("#{@url}/api/#{path}"), params.to_json, auth)
100
+ result = Net::HTTP.delete(URI("#{@url}/api/#{path}"), params.to_json, headers)
97
101
  handle_result result
98
102
  end
99
103
 
data/lib/oso/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Oso
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.3.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oso-cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oso Security, Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-01 00:00:00.000000000 Z
11
+ date: 2022-05-13 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -19,6 +19,7 @@ extra_rdoc_files: []
19
19
  files:
20
20
  - ".gitignore"
21
21
  - Gemfile
22
+ - Gemfile.lock
22
23
  - README.md
23
24
  - Rakefile
24
25
  - bin/console
@@ -44,7 +45,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
44
45
  - !ruby/object:Gem::Version
45
46
  version: '0'
46
47
  requirements: []
47
- rubygems_version: 3.1.2
48
+ rubygems_version: 3.1.6
48
49
  signing_key:
49
50
  specification_version: 4
50
51
  summary: Oso authorization library.