diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 2247e36276a..9a6be941035 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: true + # frozen_string_literal: true require 'feature_flipper' require 'aes_256_cbc_encryptor' diff --git a/config/betamocks/services_config.yml b/config/betamocks/services_config.yml index 0c8d6f0e546..313946d08ff 100644 --- a/config/betamocks/services_config.yml +++ b/config/betamocks/services_config.yml @@ -883,3 +883,15 @@ - :method: :get :path: "/demographics/demographics/v1/*/*" :file_path: "vet360/demographics/default" + + +# VA Profile Military Personnel +- :name: "VA Profile Military Service History" + :base_uri: <%= "#{URI(Settings.vet360.url).host}:#{URI(Settings.vet360.url).port}" %> + :endpoints: + - :method: :post + :path: "/profile-service/profile/v3/2.16.840.1.113883.3.42.10001.100001.12/*" + :file_path: "va_profile/military_personnel" + :cache_multiple_responses: + :uid_location: "url" + :uid_locator: "\/profile-service/profile/v3/2.16.840.1.113883.3.42.10001.100001.12/(.+)" \ No newline at end of file diff --git a/config/settings.yml b/config/settings.yml index 4de2c223a2f..232418f2a27 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -72,7 +72,7 @@ sign_in: jwt_old_encode_key: 'spec/fixtures/sign_in/privatekey_old.pem' cookies_secure: false info_cookie_domain: localhost - auto_uplevel: true + auto_uplevel: false mock_auth_url: http://localhost:3000/mocked_authentication/profiles mock_redirect_uri: http://localhost:3000/v0/sign_in/callback mockdata_sync_api_key: ~ @@ -241,27 +241,28 @@ bip: # Settings for VAProfile vet360: + prefill: true url: "https://int.vet360.va.gov" contact_information: - cache_enabled: false + cache_enabled: true enabled: true timeout: 30 - mock: false + mock: true demographics: - cache_enabled: false + cache_enabled: true enabled: true timeout: 30 mock: true military_personnel: - cache_enabled: false + cache_enabled: true enabled: true timeout: 30 - mock: false + mock: true veteran_status: cache_enabled: true enabled: true timeout: 30 - mock: false + mock: true address_validation: hostname: "sandbox-api.va.gov" api_key: "" diff --git a/db/schema.rb b/db/schema.rb index 8ef34f9a216..ecc8baf07c8 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -606,6 +606,7 @@ t.datetime "updated_at", null: false t.datetime "flagged_value_updated_at" t.index ["ip_address", "representative_id", "flag_type", "flagged_value_updated_at"], name: "index_unique_constraint_fields", unique: true + t.index ["ip_address", "representative_id", "flag_type"], name: "index_unique_flagged_veteran_representative", unique: true end create_table "flipper_features", force: :cascade do |t| diff --git a/lib/sign_in/idme/configuration.rb b/lib/sign_in/idme/configuration.rb index e88cbca71f1..a42dde15b2b 100644 --- a/lib/sign_in/idme/configuration.rb +++ b/lib/sign_in/idme/configuration.rb @@ -83,7 +83,7 @@ def ssl_cert end def log_credential - false + true end def sign_up_operation diff --git a/lib/sign_in/logingov/configuration.rb b/lib/sign_in/logingov/configuration.rb index c8432edefb2..da0ac278928 100644 --- a/lib/sign_in/logingov/configuration.rb +++ b/lib/sign_in/logingov/configuration.rb @@ -87,7 +87,7 @@ def ssl_cert end def log_credential - false + true end def service_name diff --git a/spec/models/form_profile_spec.rb b/spec/models/form_profile_spec.rb index f6c9d2ddac8..ca67b7161fd 100644 --- a/spec/models/form_profile_spec.rb +++ b/spec/models/form_profile_spec.rb @@ -1077,10 +1077,6 @@ def self.test_pciu_us_phone(primary, expected) end describe '#prefill_form' do - def can_prefill_vaprofile(yes) - expect(user).to receive(:authorize).at_least(:once).with(:va_profile, :access?).and_return(yes) - end - def strip_required(schema) new_schema = {} @@ -1349,7 +1345,6 @@ def expect_prefilled(form_id) it 'returns default values' do VCR.use_cassette('va_profile/military_personnel/post_read_service_history_404', allow_playback_repeats: true, match_requests_on: %i[method body]) do - can_prefill_vaprofile(true) output = form_profile.send(:initialize_military_information).attributes.transform_keys(&:to_s) expect(output['currently_active_duty']).to eq(false) expect(output['currently_active_duty_hash']).to eq({ yes: false }) @@ -1400,7 +1395,6 @@ def expect_prefilled(form_id) context 'with military information data', skip_va_profile: true do context 'with va profile prefill on' do before do - VAProfile::Configuration::SETTINGS.prefill = true v22_1990_expected['email'] = VAProfileRedis::ContactInformation.for_user(user).email.email_address v22_1990_expected['homePhone'] = '3035551234' @@ -1414,10 +1408,6 @@ def expect_prefilled(form_id) } end - after do - VAProfile::Configuration::SETTINGS.prefill = false - end - it 'prefills 1990' do VCR.use_cassette('va_profile/military_personnel/service_history_200_many_episodes', allow_playback_repeats: true, match_requests_on: %i[uri method body]) do @@ -1443,7 +1433,6 @@ def expect_prefilled(form_id) context 'with VA Profile and ppiu prefill for 0994' do before do - can_prefill_vaprofile(true) expect(user).to receive(:authorize).with(:ppiu, :access?).and_return(true).at_least(:once) expect(user).to receive(:authorize).with(:evss, :access?).and_return(true).at_least(:once) v22_0994_expected['bankAccount'] = { @@ -1479,7 +1468,6 @@ def expect_prefilled(form_id) context 'with VA Profile prefill for 10203' do before do - can_prefill_vaprofile(true) expect(user).to receive(:authorize).with(:evss, :access?).and_return(true).at_least(:once) end @@ -1493,7 +1481,6 @@ def expect_prefilled(form_id) context 'with VA Profile and GiBillStatus prefill for 10203' do before do - can_prefill_vaprofile(true) expect(user).to receive(:authorize).with(:evss, :access?).and_return(true).at_least(:once) v22_10203_expected['remainingEntitlement'] = { 'months' => 0, @@ -1522,12 +1509,10 @@ def expect_prefilled(form_id) end end end + end context 'with a user that can prefill VA Profile' do - before do - can_prefill_vaprofile(true) - end context 'with a user with no vet360_id' do before do @@ -1603,17 +1588,12 @@ def expect_prefilled(form_id) context 'without ppiu' do context 'when Vet360 prefill is enabled' do before do - VAProfile::Configuration::SETTINGS.prefill = true # TODO: - is this missing in the failures above? expected_veteran_info = v21_526_ez_expected['veteran'] expected_veteran_info['emailAddress'] = VAProfileRedis::ContactInformation.for_user(user).email.email_address expected_veteran_info['primaryPhone'] = '3035551234' end - after do - VAProfile::Configuration::SETTINGS.prefill = false - end - it 'returns prefilled 21-526EZ' do Flipper.disable(ApiProviderFactory::FEATURE_TOGGLE_RATED_DISABILITIES_FOREGROUND) expect(user).to receive(:authorize).with(:ppiu, :access?).and_return(true).at_least(:once)