Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update identity-hostdata gem to use new namespace (LG-4231) #214

Merged
merged 2 commits into from
Mar 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ gem 'aws-sdk', require: false
gem 'bloomfilter-rb'
gem 'figaro'
gem 'health_check', '>= 3.0.0'
gem 'identity-hostdata', github: '18F/identity-hostdata', branch: 'master'
gem 'identity-hostdata', github: '18F/identity-hostdata', tag: 'v1.0.1'
gem 'identity-logging', github: '18F/identity-logging', tag: 'v0.1.0'
gem 'mini_cache'
gem 'newrelic_rpm'
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
GIT
remote: https://github.com/18F/identity-hostdata.git
revision: da013056e3a5ffcb46001a3f4fca21b80640838e
branch: master
revision: 0f8d4626709d6031acdfe0b024faefede928f8aa
tag: v1.0.1
specs:
identity-hostdata (0.4.1)
identity-hostdata (1.0.1)
aws-sdk-s3 (~> 1.8)

GIT
Expand Down
2 changes: 1 addition & 1 deletion config/newrelic.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
production:
agent_enabled: true
app_name: pivcac.<%= LoginGov::Hostdata.env %>.<%= LoginGov::Hostdata.domain %>
app_name: pivcac.<%= Identity::Hostdata.env %>.<%= Identity::Hostdata.domain %>
host: gov-collector.newrelic.com
audit_log:
enabled: false
Expand Down
10 changes: 5 additions & 5 deletions lib/deploy/activate.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'active_support/core_ext/hash/deep_merge'
require 'logger'
require 'login_gov/hostdata'
require 'identity/hostdata'
require 'yaml'

module Deploy
Expand All @@ -13,7 +13,7 @@ def initialize(logger: default_logger, s3_client: nil)
end

def run
LoginGov::Hostdata.s3(logger: logger, s3_client: s3_client).download_configs(
Identity::Hostdata.s3(logger: logger, s3_client: s3_client).download_configs(
'/%<env>s/pivcac/v1/application.yml' => env_yaml_path
)

Expand All @@ -27,14 +27,14 @@ def run
private

def download_extra_certs_from_s3
ec2_data = LoginGov::Hostdata::EC2.load
ec2_data = Identity::Hostdata::EC2.load
aws_region = ec2_data.region
aws_account_id = ec2_data.account_id

begin
LoginGov::Hostdata::S3.new(
Identity::Hostdata::S3.new(
bucket: "login-gov.secrets.#{aws_account_id}-#{aws_region}",
env: LoginGov::Hostdata.env,
env: Identity::Hostdata.env,
region: aws_region,
logger: logger,
s3_client: s3_client,
Expand Down
8 changes: 4 additions & 4 deletions spec/lib/deploy/activate_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'rails_helper'
require 'fakefs/spec_helpers'
require 'login_gov/hostdata/fake_s3_client'
require 'identity/hostdata/fake_s3_client'
require Rails.root.join('lib', 'deploy', 'activate.rb')

TRUSTED_ROOT_COUNT = 3
Expand All @@ -10,7 +10,7 @@
let(:config_dir) { Rails.root.join('config') }

around(:each) do |ex|
LoginGov::Hostdata.reset!
Identity::Hostdata.reset!

@logger = Logger.new('/dev/null')

Expand All @@ -22,7 +22,7 @@
end

let(:logger) { @logger }
let(:s3_client) { LoginGov::Hostdata::FakeS3Client.new }
let(:s3_client) { Identity::Hostdata::FakeS3Client.new }
let(:set_up_files!) {}

let(:subject) { Deploy::Activate.new(logger: logger, s3_client: s3_client) }
Expand Down Expand Up @@ -117,7 +117,7 @@
end
end

let(:s3_empty) { LoginGov::Hostdata::FakeS3Client.new }
let(:s3_empty) { Identity::Hostdata::FakeS3Client.new }
let(:notfound_subject) {
Deploy::Activate.new(logger: logger, s3_client: s3_empty) }
context 'in a deployed production environment with no extra cert bundle' do
Expand Down