gitlab_config 0.3.2 → 0.4.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 +4 -4
- data/lib/gitlab_config/configuration.rb +1 -1
- data/lib/gitlab_config/source/s3.rb +18 -3
- data/lib/gitlab_config/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad58d1f4364fab9f0a1e4a5f2968f05823ab9786
|
4
|
+
data.tar.gz: 5101fbc33845cc39a5b2e1ae7638d3ac2e7f1522
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94da9bec314957fcef85cdebdb2f599e6bb2240e375579a4a8552708da041ed5df59dda04f3d4904311efa0adb5d49de513bcbf6852a6eb39989a79a5ea714f7
|
7
|
+
data.tar.gz: 68d4dc9fc4a52c2363d29d9ba8bb8f95761eabedb4443ca43dd506faa4e77c6c1a86431b2beefac691d4fb15725ad36349626009682c7837816f99980f72953b
|
@@ -9,8 +9,11 @@ module GitlabConfig
|
|
9
9
|
|
10
10
|
attr_reader :region, :iam
|
11
11
|
|
12
|
-
def initialize(
|
13
|
-
@region
|
12
|
+
def initialize(config)
|
13
|
+
@region = config.fetch(:region)
|
14
|
+
@iam = config.fetch(:iam, nil)
|
15
|
+
@role_arn = config.fetch(:arn, nil)
|
16
|
+
@role_session = config.fetch(:session, nil)
|
14
17
|
end
|
15
18
|
|
16
19
|
# Get configuration will download the file read it
|
@@ -30,7 +33,19 @@ module GitlabConfig
|
|
30
33
|
end
|
31
34
|
|
32
35
|
def credentials
|
33
|
-
|
36
|
+
unless @role_arn.nil?
|
37
|
+
return Aws::AssumeRoleCredentials.new(
|
38
|
+
client: Aws::STS::Client.new,
|
39
|
+
role_arn: @role_arn,
|
40
|
+
role_session_name: @role_session
|
41
|
+
)
|
42
|
+
end
|
43
|
+
|
44
|
+
unless @iam.nil?
|
45
|
+
return Aws::Credentials.new(@iam.key, @iam.secret)
|
46
|
+
end
|
47
|
+
|
48
|
+
raise 'AWS credentials not available'
|
34
49
|
end
|
35
50
|
|
36
51
|
end
|