qtc-sdk 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/qtc/cli/mar/commands.rb +1 -0
- data/lib/qtc/cli/mar/domains.rb +1 -1
- data/lib/qtc/cli/mar/ssl_certificates.rb +6 -0
- data/lib/qtc/version.rb +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: 7105501ddfca3f84d36b975f6dc0821896d83d78
|
4
|
+
data.tar.gz: 40e4c99eba27e7c10d1dd90f1dee000cfb8dd93c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba02ba20431b6ac342905ae498174311b93d61035114b4a563d00b7d21289c10e7fcbeffe6bf3d41819bb07369ff4b8755e497400905f14c0eb2a5511dc525aa
|
7
|
+
data.tar.gz: e0d26d20d10298046186bc9bd1496307f49d40d0e224c015f16521946ce780300ef432322a3bd0d380d6863bc7efa895327faeba80fbc5501ec375683b2cbcf8
|
data/lib/qtc/cli/mar/commands.rb
CHANGED
@@ -130,6 +130,7 @@ command 'mar ssl:add' do |c|
|
|
130
130
|
c.option '--remote REMOTE', String, 'Git remote to use, eg "staging"'
|
131
131
|
c.option '--key PATH', String, 'Path to private key file'
|
132
132
|
c.option '--cert PATH', String, 'Path to certificate file'
|
133
|
+
c.option '--chain PATH', String, 'Path to certificate chain file'
|
133
134
|
c.action do |args, options|
|
134
135
|
raise ArgumentError.new("--key is required") unless options.key
|
135
136
|
raise ArgumentError.new("--cert is required") unless options.cert
|
data/lib/qtc/cli/mar/domains.rb
CHANGED
@@ -30,7 +30,7 @@ module Qtc
|
|
30
30
|
instance_data = instance_info(instance_id)
|
31
31
|
if instance_data
|
32
32
|
token = instance_data['authorizations'][0]['access_token']
|
33
|
-
client.delete("/apps/#{instance_id}/domains/#{name}", nil,
|
33
|
+
client.delete("/apps/#{instance_id}/domains/#{name}", nil, {}, {'Authorization' => "Bearer #{token}"})
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|
@@ -9,6 +9,9 @@ module Qtc
|
|
9
9
|
def create(options)
|
10
10
|
raise ArgumentError.new("--key=#{options.key} is not a file") unless File.exists?(File.expand_path(options.key))
|
11
11
|
raise ArgumentError.new("--cert=#{options.cert} is not a file") unless File.exists?(File.expand_path(options.cert))
|
12
|
+
unless options.chain.nil?
|
13
|
+
raise ArgumentError.new("--chain=#{options.chain} is not a file") unless File.exists?(File.expand_path(options.chain))
|
14
|
+
end
|
12
15
|
|
13
16
|
instance_id = resolve_instance_id(options)
|
14
17
|
instance_data = instance_info(instance_id)
|
@@ -19,6 +22,9 @@ module Qtc
|
|
19
22
|
privateKey: File.read(File.expand_path(options.key)),
|
20
23
|
certificateBody: File.read(File.expand_path(options.cert))
|
21
24
|
}
|
25
|
+
unless options.chain.nil?
|
26
|
+
data[:certificateChain] = File.read(File.expand_path(options.chain))
|
27
|
+
end
|
22
28
|
client.post("/apps/#{instance_id}/ssl_certificate", data, {}, {'Authorization' => "Bearer #{token}"})
|
23
29
|
end
|
24
30
|
end
|
data/lib/qtc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qtc-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jari Kolehmainen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|