bucket_client 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/.gitlab-ci.yml +70 -0
- data/.idea/bucket_client.iml +105 -0
- data/.idea/encodings.xml +4 -0
- data/.idea/misc.xml +7 -0
- data/.idea/modules.xml +8 -0
- data/.idea/runConfigurations/Integration_Test.xml +37 -0
- data/.idea/runConfigurations/Unit_Test.xml +37 -0
- data/.rspec +3 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +114 -0
- data/LICENSE.txt +21 -0
- data/README.md +870 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/bucket_client.gemspec +46 -0
- data/integration/aws_blob_spec.rb +134 -0
- data/integration/aws_bucket_spec.rb +145 -0
- data/integration/azure_blob_spec.rb +132 -0
- data/integration/azure_bucket_spec.rb +132 -0
- data/integration/dev_blob_spec.rb +131 -0
- data/integration/dev_bucket_spec.rb +140 -0
- data/integration/do_blob_spec.rb +134 -0
- data/integration/do_bucket_spec.rb +144 -0
- data/integration/gcp_blob_spec.rb +132 -0
- data/integration/gcp_bucket_spec.rb +132 -0
- data/integration/img.jpg +0 -0
- data/lib/bucket_client.rb +66 -0
- data/lib/bucket_client/aws/aws_bucket.rb +85 -0
- data/lib/bucket_client/aws/aws_client.rb +195 -0
- data/lib/bucket_client/aws/aws_http_client.rb +32 -0
- data/lib/bucket_client/aws/aws_policy_factory.rb +26 -0
- data/lib/bucket_client/aws4_request_signer.rb +133 -0
- data/lib/bucket_client/azure/azure_bucket.rb +83 -0
- data/lib/bucket_client/azure/azure_client.rb +197 -0
- data/lib/bucket_client/bucket.rb +388 -0
- data/lib/bucket_client/bucket_operation_exception.rb +8 -0
- data/lib/bucket_client/client.rb +408 -0
- data/lib/bucket_client/dev/local_bucket.rb +84 -0
- data/lib/bucket_client/dev/local_client.rb +148 -0
- data/lib/bucket_client/digital_ocean/digital_ocean_acl_factory.rb +39 -0
- data/lib/bucket_client/digital_ocean/digital_ocean_bucket.rb +81 -0
- data/lib/bucket_client/digital_ocean/digital_ocean_client.rb +275 -0
- data/lib/bucket_client/digital_ocean/digital_ocean_http_client.rb +31 -0
- data/lib/bucket_client/gcp/gcp_bucket.rb +79 -0
- data/lib/bucket_client/gcp/gcp_client.rb +171 -0
- data/lib/bucket_client/operation_result.rb +33 -0
- data/lib/bucket_client/version.rb +3 -0
- metadata +246 -0
@@ -0,0 +1,144 @@
|
|
1
|
+
require "bucket_client/digital_ocean/digital_ocean_bucket"
|
2
|
+
require "bucket_client/digital_ocean/digital_ocean_client"
|
3
|
+
require "kirin_http"
|
4
|
+
|
5
|
+
describe BucketClient::DigitalOceanClient do
|
6
|
+
|
7
|
+
http = KirinHttp::BasicClient.new
|
8
|
+
id = ENV["DO_ID"]
|
9
|
+
secret = ENV["DO_SECRET"]
|
10
|
+
region = ENV["DO_REGION"]
|
11
|
+
client = BucketClient::DigitalOceanClient.new(http, id, secret, region)
|
12
|
+
key = "kirin-bucket-client-client-integration"
|
13
|
+
|
14
|
+
|
15
|
+
before(:all) {client.delete_bucket_if_exist key}
|
16
|
+
after(:all) {client.delete_bucket_if_exist key}
|
17
|
+
|
18
|
+
describe 'exist_bucket' do
|
19
|
+
it 'should return false' do
|
20
|
+
expect(client.exist_bucket key).to be_falsey
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
describe 'delete_bucket_if_exist' do
|
25
|
+
it 'should be successful' do
|
26
|
+
result = client.delete_bucket_if_exist key
|
27
|
+
expect(result.code).to eq 204
|
28
|
+
expect(result.success).to be_truthy
|
29
|
+
expect(result.message).to eq "Bucket already deleted"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
describe 'delete_bucket' do
|
34
|
+
it 'should fail as bucket does not exist' do
|
35
|
+
result = client.delete_bucket key
|
36
|
+
expect(result.code).to eq 404
|
37
|
+
expect(result.success).to be_falsey
|
38
|
+
expect(result.value).to be_nil
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
describe "set_read_policy" do
|
43
|
+
it 'should fail as bucket does not exist' do
|
44
|
+
result = client.set_read_policy key, :public
|
45
|
+
expect(result.code).to eq 404
|
46
|
+
expect(result.success).to be_falsey
|
47
|
+
expect(result.value).to be_nil
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
describe "set_get_cors" do
|
52
|
+
it 'should fail as bucket does notexist' do
|
53
|
+
result = client.set_get_cors key, ["*"]
|
54
|
+
expect(result.code).to eq 404
|
55
|
+
expect(result.success).to be_falsey
|
56
|
+
expect(result.value).to be_nil
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
describe "get_bucket!" do
|
61
|
+
it 'should generate unsafe bucket with correct key' do
|
62
|
+
bucket = client.get_bucket! key
|
63
|
+
expect(bucket.key).to eq key
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
describe "put_bucket" do
|
68
|
+
it 'should create new bucket' do
|
69
|
+
result = client.put_bucket key
|
70
|
+
expect(result.code).to eq 200
|
71
|
+
expect(result.success).to be_truthy
|
72
|
+
expect(result.value.key).to eq key
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
describe 'create_bucket' do
|
77
|
+
it 'should fail creating a new bucket because it already exist' do
|
78
|
+
|
79
|
+
expect(client.exist_bucket key).to be_truthy
|
80
|
+
result = client.create_bucket key
|
81
|
+
expect(result.code).to eq 409
|
82
|
+
expect(result.success).to be_falsey
|
83
|
+
expect(result.value).to be_nil
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
describe 'delete_bucket' do
|
88
|
+
it 'should succeed deleting a new bucket' do
|
89
|
+
result = client.delete_bucket key
|
90
|
+
expect(result.code).to eq 204
|
91
|
+
expect(result.success).to be_truthy
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
describe "create_bucket" do
|
96
|
+
it 'should succeed at creating a new bucket' do
|
97
|
+
result = client.create_bucket key
|
98
|
+
expect(result.code).to eq 200
|
99
|
+
expect(result.success).to be_truthy
|
100
|
+
expect(result.value.key).to eq key
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
describe 'put_bucket' do
|
105
|
+
it 'should not fail even if bucket already exist' do
|
106
|
+
result = client.put_bucket key
|
107
|
+
expect(result.code).to eq 200
|
108
|
+
expect(result.success).to be_truthy
|
109
|
+
expect(result.value.key).to eq key
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
describe "set_read_policy" do
|
114
|
+
it 'should fail if access is neither :public or :private' do
|
115
|
+
expect {client.set_read_policy key, :protected}.to raise_error(ArgumentError, "Read Policy not accepted")
|
116
|
+
end
|
117
|
+
it 'should succeed' do
|
118
|
+
result = client.set_read_policy key, :public
|
119
|
+
expect(result.code).to eq 200
|
120
|
+
expect(result.success).to be_truthy
|
121
|
+
expect(result.value).to be_nil
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
describe "set_get_cors" do
|
126
|
+
it 'should should succeed' do
|
127
|
+
result = client.set_get_cors key, ["*"]
|
128
|
+
expect(result.code).to eq 200
|
129
|
+
expect(result.success).to be_truthy
|
130
|
+
expect(result.value).to be_nil
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
describe "delete_bucket_if_exist" do
|
135
|
+
it 'should remove existing bucket' do
|
136
|
+
result = client.delete_bucket_if_exist key
|
137
|
+
expect(result.code).to eq 204
|
138
|
+
expect(result.success).to be_truthy
|
139
|
+
expect(result.value).to be_nil
|
140
|
+
expect(client.exist_bucket key).to be_falsey
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
end
|
@@ -0,0 +1,132 @@
|
|
1
|
+
require "bucket_client/digital_ocean/digital_ocean_bucket"
|
2
|
+
require "bucket_client/digital_ocean/digital_ocean_client"
|
3
|
+
require "kirin_http"
|
4
|
+
|
5
|
+
describe BucketClient::GCPBucket do
|
6
|
+
id = ENV["GOOGLE_ID"]
|
7
|
+
secret = JSON.parse(ENV["GOOGLE_KEY"])
|
8
|
+
client = BucketClient::GCPClient.new(id, secret)
|
9
|
+
key = "kirin-bucket-client-bucket-integration"
|
10
|
+
file = "img.jpg"
|
11
|
+
bin = IO.binread "./integration/#{file}"
|
12
|
+
before(:all) {client.put_bucket key}
|
13
|
+
after(:all) {
|
14
|
+
bucket = client.get_bucket key
|
15
|
+
bucket.delete_blob_if_exist file
|
16
|
+
client.delete_bucket_if_exist key
|
17
|
+
}
|
18
|
+
|
19
|
+
|
20
|
+
describe 'Blob Behaviour' do
|
21
|
+
bucket = client.get_bucket! key
|
22
|
+
describe 'exist_blob' do
|
23
|
+
it 'should return false as blob does not exist' do
|
24
|
+
expect(bucket.exist_blob file).to be_falsey
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe 'delete_blob_if_exist' do
|
29
|
+
it 'should succeed' do
|
30
|
+
result = bucket.delete_blob_if_exist file
|
31
|
+
expect(result.code).to eq 204
|
32
|
+
expect(result.success).to be_truthy
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe 'delete_blob' do
|
37
|
+
it 'should fail as blob does not exist' do
|
38
|
+
result = bucket.delete_blob file
|
39
|
+
expect(result.success).to be_falsey
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
describe 'update_blob' do
|
44
|
+
it 'should fail as blob does not exist' do
|
45
|
+
result = bucket.update_blob bin, file
|
46
|
+
expect(result.success).to be_falsey
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
describe 'get_blob' do
|
51
|
+
it 'should fail as blob does not exist' do
|
52
|
+
result = bucket.get_blob file
|
53
|
+
expect(result.success).to be_falsey
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
describe "put_blob" do
|
58
|
+
it 'should succeed' do
|
59
|
+
result = bucket.put_blob bin, file
|
60
|
+
expect(result.success).to be_truthy
|
61
|
+
expect(result.value).to eq "https://storage.googleapis.com/#{key}/#{file}"
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
describe 'exist_blob' do
|
66
|
+
it 'should exist' do
|
67
|
+
expect(bucket.exist_blob file).to be_truthy
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
describe "create_blob" do
|
72
|
+
it 'should fail as blob already exist' do
|
73
|
+
result = bucket.create_blob bin, file
|
74
|
+
expect(result.success).to be_falsey
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
describe "get_blob" do
|
79
|
+
it 'should obtain the binary of the blob' do
|
80
|
+
result = bucket.get_blob file
|
81
|
+
expect(result.success).to be_truthy
|
82
|
+
expect(result.value).to eq bin
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
describe "delete_blob" do
|
87
|
+
it 'should pass as blob exist' do
|
88
|
+
result = bucket.delete_blob file
|
89
|
+
expect(result.success).to be_truthy
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
describe "create_blob" do
|
94
|
+
it 'should work as blob does not exist' do
|
95
|
+
result = bucket.create_blob bin, file
|
96
|
+
expect(result.success).to be_truthy
|
97
|
+
expect(result.value).to eq "https://storage.googleapis.com/#{key}/#{file}"
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
describe "update_blob" do
|
102
|
+
it 'should work as blob exist' do
|
103
|
+
result = bucket.update_blob bin, file
|
104
|
+
expect(result.success).to be_truthy
|
105
|
+
expect(result.value).to eq "https://storage.googleapis.com/#{key}/#{file}"
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
describe "put_blob" do
|
110
|
+
it 'should work as blob exist' do
|
111
|
+
result = bucket.put_blob bin, file
|
112
|
+
expect(result.success).to be_truthy
|
113
|
+
expect(result.value).to eq "https://storage.googleapis.com/#{key}/#{file}"
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
describe "delete_blob_if_exist" do
|
118
|
+
it 'should delete blob' do
|
119
|
+
result = bucket.delete_blob_if_exist file
|
120
|
+
expect(result.success).to be_truthy
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
describe "exist_blob" do
|
125
|
+
it 'should no longer exist' do
|
126
|
+
expect(bucket.exist_blob file).to be_falsey
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
end
|
131
|
+
|
132
|
+
end
|
@@ -0,0 +1,132 @@
|
|
1
|
+
require "bucket_client/azure/azure_bucket"
|
2
|
+
require "bucket_client/azure/azure_client"
|
3
|
+
require "json"
|
4
|
+
|
5
|
+
describe BucketClient::GCPClient do
|
6
|
+
|
7
|
+
id = ENV["GOOGLE_ID"]
|
8
|
+
secret = JSON.parse(ENV["GOOGLE_KEY"])
|
9
|
+
client = BucketClient::GCPClient.new(id, secret)
|
10
|
+
key = "kirin-bucket-client-client"
|
11
|
+
|
12
|
+
before(:all) {client.delete_bucket_if_exist key}
|
13
|
+
after(:all) {client.delete_bucket_if_exist key}
|
14
|
+
|
15
|
+
describe 'exist_bucket' do
|
16
|
+
it 'should return false' do
|
17
|
+
expect(client.exist_bucket key).to be_falsey
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
describe 'delete_bucket_if_exist' do
|
22
|
+
it 'should be successful' do
|
23
|
+
result = client.delete_bucket_if_exist key
|
24
|
+
expect(result.code).to eq 200
|
25
|
+
expect(result.success).to be_truthy
|
26
|
+
expect(result.message).to eq "Bucket already deleted"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'delete_bucket' do
|
31
|
+
it 'should fail as bucket does not exist' do
|
32
|
+
result = client.delete_bucket key
|
33
|
+
expect(result.code).to eq 404
|
34
|
+
expect(result.success).to be_falsey
|
35
|
+
expect(result.value).to be_nil
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
describe "set_read_policy" do
|
40
|
+
it 'should fail as bucket does not exist' do
|
41
|
+
result = client.set_read_policy key, :public
|
42
|
+
expect(result.code).to eq 400
|
43
|
+
expect(result.success).to be_falsey
|
44
|
+
expect(result.value).to be_nil
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
describe "get_bucket!" do
|
49
|
+
it 'should generate unsafe bucket with correct key' do
|
50
|
+
bucket = client.get_bucket! key
|
51
|
+
expect(bucket.key).to eq key
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
describe "put_bucket" do
|
56
|
+
it 'should create new bucket' do
|
57
|
+
result = client.put_bucket key
|
58
|
+
expect(result.code).to eq 200
|
59
|
+
expect(result.success).to be_truthy
|
60
|
+
expect(result.value.key).to eq key
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
describe 'create_bucket' do
|
65
|
+
it 'should fail creating a new bucket because it already exist' do
|
66
|
+
|
67
|
+
expect(client.exist_bucket key).to be_truthy
|
68
|
+
result = client.create_bucket key
|
69
|
+
expect(result.code).to eq 400
|
70
|
+
expect(result.success).to be_falsey
|
71
|
+
expect(result.value).to be_nil
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
describe 'delete_bucket' do
|
76
|
+
it 'should succeed deleting a new bucket' do
|
77
|
+
result = client.delete_bucket key
|
78
|
+
expect(result.code).to eq 204
|
79
|
+
expect(result.success).to be_truthy
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
describe "create_bucket" do
|
84
|
+
it 'should succeed at creating a new bucket' do
|
85
|
+
result = client.create_bucket key
|
86
|
+
expect(result.code).to eq 200
|
87
|
+
expect(result.success).to be_truthy
|
88
|
+
expect(result.value.key).to eq key
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
describe 'put_bucket' do
|
93
|
+
it 'should not fail even if bucket already exist' do
|
94
|
+
result = client.put_bucket key
|
95
|
+
expect(result.code).to eq 200
|
96
|
+
expect(result.success).to be_truthy
|
97
|
+
expect(result.value.key).to eq key
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
describe "set_read_policy" do
|
102
|
+
it 'should fail if access is neither :public or :private' do
|
103
|
+
expect {client.set_read_policy key, :protected}.to raise_error(ArgumentError, "Read Policy not accepted")
|
104
|
+
end
|
105
|
+
it 'should succeed' do
|
106
|
+
result = client.set_read_policy key, :public
|
107
|
+
expect(result.code).to eq 200
|
108
|
+
expect(result.success).to be_truthy
|
109
|
+
expect(result.value).to be_nil
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
describe "set_get_cors" do
|
114
|
+
it 'should should succeed' do
|
115
|
+
result = client.set_get_cors key, ["*"]
|
116
|
+
expect(result.code).to eq 200
|
117
|
+
expect(result.success).to be_truthy
|
118
|
+
expect(result.value).to be_nil
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
describe "delete_bucket_if_exist" do
|
123
|
+
it 'should remove existing bucket' do
|
124
|
+
result = client.delete_bucket_if_exist key
|
125
|
+
expect(result.code).to eq 204
|
126
|
+
expect(result.success).to be_truthy
|
127
|
+
expect(result.value).to be_nil
|
128
|
+
expect(client.exist_bucket key).to be_falsey
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
end
|
data/integration/img.jpg
ADDED
Binary file
|
@@ -0,0 +1,66 @@
|
|
1
|
+
require "bucket_client/version"
|
2
|
+
require "bucket_client/operation_result"
|
3
|
+
require "bucket_client/bucket_operation_exception"
|
4
|
+
require "bucket_client/bucket"
|
5
|
+
require "bucket_client/client"
|
6
|
+
require "bucket_client/aws/aws_client"
|
7
|
+
require "bucket_client/digital_ocean/digital_ocean_client"
|
8
|
+
require "bucket_client/azure/azure_client"
|
9
|
+
require "bucket_client/gcp/gcp_client"
|
10
|
+
require "bucket_client/dev/local_client"
|
11
|
+
require "kirin_http"
|
12
|
+
|
13
|
+
module BucketClient
|
14
|
+
|
15
|
+
# @param [Symbol] type the type of client to generate. Accepts
|
16
|
+
# :local for local,
|
17
|
+
# :aws for AWS S3 Bucket
|
18
|
+
# :azure for Azure Blob Storage
|
19
|
+
# :spaces for DigitalOcean Spaces
|
20
|
+
# :gcp for Google Cloud Platform Storage Account
|
21
|
+
# @param [String] id The id for the client. Only applicable to :aws, :azure, :spaces and :gcp
|
22
|
+
# For GCP, this is your project id
|
23
|
+
# For AWS, this is your access ID
|
24
|
+
# For Digital Ocean spaces, this is your access ID
|
25
|
+
# For Azure, this is your account name for your blob storage account
|
26
|
+
# @param [String or Hash] secret The secret for the client. Only applicable to :aws, :azure, :spaces and :gcp
|
27
|
+
# For GCP, this can either be a path to your secret.json, or it can be the JSON serialized as a hash.
|
28
|
+
# For AWS, this is your secret key
|
29
|
+
# For Digital Ocean spaces, this is your secret key
|
30
|
+
# For Azure, this is your secret key
|
31
|
+
# @param [String] region The region of your bucket. Only applicable to :aws and :spaces
|
32
|
+
# For AWS, this is your region string. eg: ap-southeast-1
|
33
|
+
# For Digital Ocean Spaces, this is your region string. ep: sgp1
|
34
|
+
# @param [String] path The local path for mocking a bucket (using disk). Only applicable to :local
|
35
|
+
# @param [String] principal The public path of the bucket. Will use value of "path" if not provided. Only applicable to :local
|
36
|
+
# @return [BucketClient::Client]
|
37
|
+
def BucketClient.generate(type: :local, id: nil, secret: nil, region: nil, path: nil, principal: nil)
|
38
|
+
http = KirinHttp::BasicClient.new
|
39
|
+
case type
|
40
|
+
when :local
|
41
|
+
raise ArgumentError.new("Path not provided") if path.nil?
|
42
|
+
LocalClient.new(path, principal)
|
43
|
+
when :aws
|
44
|
+
raise ArgumentError.new("id not provided") if id.nil?
|
45
|
+
raise ArgumentError.new("secreted not provided") if secret.nil?
|
46
|
+
raise ArgumentError.new("region not provided") if region.nil?
|
47
|
+
AWSClient.new(http, id, secret, region)
|
48
|
+
when :azure
|
49
|
+
raise ArgumentError.new("account name/id not provided") if id.nil?
|
50
|
+
raise ArgumentError.new("secret not provided") if secret.nil?
|
51
|
+
AzureClient.new(id, secret)
|
52
|
+
when :spaces
|
53
|
+
raise ArgumentError.new("id not provided") if id.nil?
|
54
|
+
raise ArgumentError.new("secreted not provided") if secret.nil?
|
55
|
+
raise ArgumentError.new("region not provided") if region.nil?
|
56
|
+
DigitalOceanClient.new(http, id, secret, region)
|
57
|
+
when :gcp
|
58
|
+
raise ArgumentError.new("project id not provided") if id.nil?
|
59
|
+
raise ArgumentError.new("secret not provided") if secret.nil?
|
60
|
+
GCPClient.new(id, secret)
|
61
|
+
else
|
62
|
+
raise ArgumentError.new("Unknown Client type: " + type.to_s)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|