convoy.rb 0.1.2 → 0.1.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/lib/convoy/api_operations/get.rb +2 -4
- data/lib/convoy/api_operations/list.rb +2 -4
- data/lib/convoy/api_operations/request.rb +2 -2
- data/lib/convoy/convoy_configuration.rb +2 -0
- data/lib/convoy/resources/api_key.rb +24 -0
- data/lib/convoy/resources/application.rb +0 -1
- data/lib/convoy/version.rb +1 -1
- data/lib/convoy.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 679511eb7f64dc39761bb262a3f907a542bdfe389f66ec85dd57469a45187262
|
4
|
+
data.tar.gz: 321fa270104593343a6f86ea6ac0ba06790c8abdafa47a65736824b4726814dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dad8def0b41a90ad1197b24302da1076c05c3565cd15aa9c0955fba9c8d9237c0b4bd4c4865411290c8c0163d8a4cf8fae324c638effb2cebdc6c7c3d2f23e70
|
7
|
+
data.tar.gz: 320cd16a9063ba64763525484596b7fce8970827b6cc13a99faa0f6cbd8e353735a9df756d5e02e7171e0a4ce0b264096e6b2cdd47f625ea2d6f2ac40a4bd97f
|
@@ -43,13 +43,13 @@ module Convoy
|
|
43
43
|
client.continue_timeout = 10
|
44
44
|
client.ssl_timeout = 10
|
45
45
|
|
46
|
-
|
47
|
-
client.set_debug_output $stderr
|
46
|
+
client.set_debug_output $stderr if config.debug
|
48
47
|
|
49
48
|
# Make request.
|
50
49
|
http_response = client.request(request)
|
51
50
|
@response = JSON.parse(http_response.body)
|
52
51
|
|
52
|
+
self
|
53
53
|
# TODO: Perform err checks.
|
54
54
|
end
|
55
55
|
end
|
@@ -2,6 +2,7 @@ module Convoy
|
|
2
2
|
class ConvoyConfiguration
|
3
3
|
|
4
4
|
attr_accessor :ssl
|
5
|
+
attr_accessor :debug
|
5
6
|
attr_accessor :username
|
6
7
|
attr_accessor :password
|
7
8
|
attr_accessor :base_uri
|
@@ -13,6 +14,7 @@ module Convoy
|
|
13
14
|
@base_uri = "https://cloud.getconvoy.io"
|
14
15
|
@path_version = "/v1"
|
15
16
|
@ssl = true
|
17
|
+
@debug = false
|
16
18
|
end
|
17
19
|
|
18
20
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Convoy
|
2
|
+
class ApiKey < ApiResource
|
3
|
+
include ApiOperations::Get
|
4
|
+
include ApiOperations::Save
|
5
|
+
include ApiOperations::Delete
|
6
|
+
include ApiOperations::List
|
7
|
+
extend ApiOperations::Create
|
8
|
+
|
9
|
+
def initialize(id = nil, config = Convoy.config, **kwargs)
|
10
|
+
@id = id
|
11
|
+
@data = kwargs[:data].nil? ? {} : kwargs[:data]
|
12
|
+
@params = kwargs[:params].nil? ? {} : kwargs[:params]
|
13
|
+
@config = config
|
14
|
+
end
|
15
|
+
|
16
|
+
def resource_url
|
17
|
+
if @id.nil?
|
18
|
+
return "#{@config.base_uri}/#{@config.path_version}/security/keys"
|
19
|
+
end
|
20
|
+
|
21
|
+
"#{@config.base_uri}/#{@config.path_version}/security/keys" + "/#{@id}"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/convoy/version.rb
CHANGED
data/lib/convoy.rb
CHANGED
@@ -21,6 +21,7 @@ module Convoy
|
|
21
21
|
|
22
22
|
# User configurable options
|
23
23
|
def_delegators :@config, :ssl, :ssl=
|
24
|
+
def_delegators :@config, :debug, :debug=
|
24
25
|
def_delegators :@config, :username, :username=
|
25
26
|
def_delegators :@config, :password, :password=
|
26
27
|
def_delegators :@config, :base_uri, :base_uri=
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: convoy.rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Subomi Oluwalana
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zeitwerk
|