idlc-sdk-core 1.1.5 → 1.2.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: 5f359eccf2136e9e844b00d631b71ba4d53bc27ea3b8867f2894278283802f06
4
- data.tar.gz: 6b700d3b4184376a94fd512ee85b360bc6d0a5f184800f01a85b899adbe28e41
3
+ metadata.gz: 6309169da0626fb1db2eae918d549a82231c13ee4ce31183643e7458053d724a
4
+ data.tar.gz: deb5f054055d3e8cfe880ad974cb9adf96e666950518b551448edbe31acea34d
5
5
  SHA512:
6
- metadata.gz: 7fcf3e008ac4ddcff58db39eadf4973e7bdb9e1534d7532e3113873de676b6e37ab103f910556fbea96567b0fc29e82a64401c1730590c9e647fa5daf143f114
7
- data.tar.gz: 93d7c9a0373f20656f86fb9b8cbc6c5f0e0661db045e348779bea60b3070650afb30164759404adc7e6aef88a1de9cf163c90f3c416bb64d4a500bf163f8069c
6
+ metadata.gz: bf573881a9a9260fec6c27909a3644f06974e58aa80d2488540d62ef5f0ac0862928ae58f78c9742ddb2a8e2d7b2134ad03cfde42c5379a0e607c49fa229056e
7
+ data.tar.gz: 8e42fd8a4f007353dee8a1a05e640ab6dd61feaf1a9663247ffa4289905234903a1749b085195cdddfd90d4eaa327edf28ad3e7056b070e1457506fee6377fcc
data/lib/idlc-sdk-core.rb CHANGED
@@ -11,21 +11,49 @@ require 'idlc-sdk-core/restclient'
11
11
  module Idlc
12
12
  # Service Definitions
13
13
  SERVICES = {
14
- 'build' => {
15
- 'endpoint' => 'build.orchestrate.imageapi.com',
16
- 'stage' => 'prod'
14
+ 'us-east-1' => {
15
+ 'build' => {
16
+ 'endpoint' => 'build.orchestrate.imageapi.com',
17
+ 'stage' => 'prod'
18
+ },
19
+ 'config' => {
20
+ 'endpoint' => 'config.orchestrate.imageapi.com',
21
+ 'stage' => 'prod'
22
+ },
23
+ 'deploy' => {
24
+ 'endpoint' => 'deploy.orchestrate.imageapi.com',
25
+ 'stage' => 'prod'
26
+ },
27
+ 'status' => {
28
+ 'endpoint' => 'status.orchestrate.imageapi.com',
29
+ 'stage' => 'prod'
30
+ },
31
+ 'auth' => {
32
+ 'endpoint' => 'auth.orchestrate.imageapi.com',
33
+ 'stage' => 'prod'
34
+ }
17
35
  },
18
- 'config' => {
19
- 'endpoint' => 'config.orchestrate.imageapi.com',
20
- 'stage' => 'prod'
21
- },
22
- 'deploy' => {
23
- 'endpoint' => 'deploy.orchestrate.imageapi.com',
24
- 'stage' => 'prod'
25
- },
26
- 'status' => {
27
- 'endpoint' => 'status.orchestrate.imageapi.com',
28
- 'stage' => 'prod'
36
+ 'us-gov-west-1' => {
37
+ 'build' => {
38
+ 'endpoint' => 'build.orchestrate-us-gov.imageapi.com',
39
+ 'stage' => 'govcloud'
40
+ },
41
+ 'config' => {
42
+ 'endpoint' => 'config.orchestrate-us-gov.imageapi.com',
43
+ 'stage' => 'govcloud'
44
+ },
45
+ 'deploy' => {
46
+ 'endpoint' => 'deploy.orchestrate-us-gov.imageapi.com',
47
+ 'stage' => 'govcloud'
48
+ },
49
+ 'status' => {
50
+ 'endpoint' => 'status.orchestrate-us-gov.imageapi.com',
51
+ 'stage' => 'govcloud'
52
+ },
53
+ 'auth' => {
54
+ 'endpoint' => 'auth.orchestrate-us-gov.imageapi.com',
55
+ 'stage' => 'govcloud'
56
+ }
29
57
  }
30
58
  }.freeze
31
59
  end
@@ -11,8 +11,10 @@ module Idlc
11
11
 
12
12
  def fetch(request)
13
13
  client = Aws::Lambda::Client.new()
14
+ region = ENV['AWS_REGION']
15
+ backend_services = Idlc::SERVICES[region]
14
16
 
15
- request[:function] = "#{request[:service]}-" + Idlc::SERVICES[request[:service]]['stage'] + "-#{request[:lambda]}"
17
+ request[:function] = "#{request[:service]}-" + backend_services[request[:service]]['stage'] + "-#{request[:lambda]}"
16
18
  request[:httpMethod] = request[:method]
17
19
 
18
20
  retries = 0
@@ -60,12 +62,13 @@ module Idlc
60
62
  @service_name = 'execute-api'
61
63
  @credentials = credentials
62
64
  @region = region
65
+ @backend_services = Idlc::SERVICES[region]
63
66
  end
64
67
 
65
68
  def fetch(request)
66
69
  request = JSON.parse(request)
67
70
 
68
- endpoint = 'https://' + Idlc::SERVICES[request['service']]['endpoint'] + '/' + Idlc::SERVICES[request['service']]['stage']
71
+ endpoint = 'https://' + @backend_services[request['service']]['endpoint'] + '/' + @backend_services[request['service']]['stage']
69
72
 
70
73
  body = ''
71
74
  body = request['body'].to_json if request['body']
@@ -1,3 +1,3 @@
1
1
  module Idlc
2
- VERSION = '1.1.5'.freeze
2
+ VERSION = '1.2.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: idlc-sdk-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Cazell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-16 00:00:00.000000000 Z
11
+ date: 2018-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler