index
int64
0
0
repo_id
stringclasses
829 values
file_path
stringlengths
34
254
content
stringlengths
6
5.38M
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/v0/efolder_controller.rb
# frozen_string_literal: true require 'efolder/service' module V0 class EfolderController < ApplicationController service_tag 'deprecated' def index render(json: service.list_documents) end def show send_data( service.get_document(params[:id]), type: 'application/pdf', ...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/v0/search_typeahead_controller.rb
# frozen_string_literal: true require 'search_typeahead/service' module V0 class SearchTypeaheadController < ApplicationController include ActionView::Helpers::SanitizeHelper service_tag 'search' skip_before_action :authenticate skip_before_action :verify_authenticity_token # gets suggestions ...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/v0/backend_statuses_controller.rb
# frozen_string_literal: true require 'lighthouse/benefits_education/service' require 'backend_services' module V0 class BackendStatusesController < ApplicationController service_tag 'maintenance-windows' skip_before_action :authenticate def index options = { params: { maintenance_windows: } } ...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/v0/in_progress_forms_controller.rb
# frozen_string_literal: true module V0 class InProgressFormsController < ApplicationController include IgnoreNotFound service_tag 'save-in-progress' def index # the keys of metadata shouldn't be deeply transformed, which might corrupt some keys # see https://github.com/department-of-veteran...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/v0/onsite_notifications_controller.rb
# frozen_string_literal: true module V0 class OnsiteNotificationsController < ApplicationController service_tag 'on-site-notifications' BEARER_PATTERN = /^Bearer / skip_before_action :verify_authenticity_token, only: [:create] skip_before_action :authenticate, only: [:create] skip_after_action :...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/v0/form212680_controller.rb
# frozen_string_literal: true module V0 class Form212680Controller < ApplicationController include RetriableConcern service_tag 'form-21-2680' skip_before_action :authenticate before_action :load_user before_action :check_feature_enabled def create claim = saved_claim_class.new(form: f...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/v0/gi_bill_feedbacks_controller.rb
# frozen_string_literal: true module V0 class GIBillFeedbacksController < ApplicationController service_tag 'gibill-feedback' skip_before_action(:authenticate) before_action :load_user, only: :create def show gi_bill_feedback = GIBillFeedback.find(params[:id]) render json: GIBillFeedback...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/v0/user_actions_controller.rb
# frozen_string_literal: true module V0 class UserActionsController < ApplicationController service_tag 'identity' before_action :set_query_date_range, only: [:index] def index page = params[:page].presence || 1 per_page = params[:per_page].presence || 10 subject_user_verification = c...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/v0/appeals_controller.rb
# frozen_string_literal: true module V0 class AppealsController < AppealsBaseController service_tag 'appeal-status' def index appeals_response = appeals_service.get_appeals(current_user) render json: appeals_response.body end end end
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/v0/csrf_token_controller.rb
# frozen_string_literal: true class V0::CsrfTokenController < ApplicationController service_tag 'csrf-token' skip_before_action :authenticate def index; end end
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/v0/forms_controller.rb
# frozen_string_literal: true require 'forms/client' module V0 class FormsController < ApplicationController include ActionView::Helpers::SanitizeHelper service_tag 'find-a-form' skip_before_action :authenticate def index response = Forms::Client.new(params[:query]).get_all render json...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/v0/mpi_users_controller.rb
# frozen_string_literal: true module V0 # Formerly MviUsersController class MPIUsersController < ApplicationController service_tag 'identity' before_action { authorize :mpi, :access_add_person_proxy? } before_action :validate_form! before_action :validate_user_ids! ALLOWED_FORM_IDS = ['21-0966...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/v0/education_benefits_claims_controller.rb
# frozen_string_literal: true module V0 class EducationBenefitsClaimsController < ApplicationController service_tag 'education-forms' skip_before_action(:authenticate) before_action :load_user def create claim = SavedClaim::EducationBenefits.form_class(form_type).new(education_benefits_claim_p...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/v0/id_card_announcement_subscription_controller.rb
# frozen_string_literal: true module V0 class IdCardAnnouncementSubscriptionController < ApplicationController service_tag 'deprecated' skip_before_action :authenticate def create @subscription = IdCardAnnouncementSubscription.find_or_create_by(filtered_params) if @subscription.valid? ...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/chatbot/token_controller.rb
# frozen_string_literal: true require 'erb' module V0 module Chatbot class TokenController < ApplicationController service_tag 'chatbot' skip_before_action :authenticate before_action :load_user rescue_from 'V0::Chatbot::TokenController::ServiceException', with: :service_exception_handl...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/chatbot/claim_status_controller.rb
# frozen_string_literal: true require 'date' require 'concurrent' require 'chatbot/report_to_cxi' require 'lighthouse/benefits_claims/service' require 'vets/shared_logging' module V0 module Chatbot class ClaimStatusController < SignIn::ServiceAccountApplicationController include IgnoreNotFound inclu...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/chatbot/users_controller.rb
# frozen_string_literal: true module V0 module Chatbot class UsersController < SignIn::ServiceAccountApplicationController service_tag 'identity' before_action :authenticate_one_time_code def show raise Common::Client::Errors::ClientError unless @icn render json: { icn: @icn,...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/contact_us/inquiries_controller.rb
# frozen_string_literal: true module V0 module ContactUs class InquiriesController < ApplicationController service_tag 'deprecated' skip_before_action :authenticate, only: :create def index return not_implemented unless Flipper.enabled?(:get_help_messages) render json: STUB_R...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/gids/zipcode_rates_controller.rb
# frozen_string_literal: true module V0 module GIDS class ZipcodeRatesController < GIDSController def show render json: service.get_zipcode_rate_v0(scrubbed_params) end end end end
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/gids/institution_programs_controller.rb
# frozen_string_literal: true module V0 module GIDS class InstitutionProgramsController < GIDSController def autocomplete render json: service.get_institution_program_autocomplete_suggestions_v0(scrubbed_params) end def search render json: service.get_institution_program_search...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/gids/institutions_controller.rb
# frozen_string_literal: true module V0 module GIDS class InstitutionsController < GIDSController def autocomplete render json: service.get_institution_autocomplete_suggestions_v0(scrubbed_params) end def search render json: service.get_institution_search_results_v0(scrubbed_pa...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/gids/calculator_constants_controller.rb
# frozen_string_literal: true module V0 module GIDS class CalculatorConstantsController < GIDSController def index render json: service.get_calculator_constants_v0(scrubbed_params) end end end end
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/gids/yellow_ribbon_programs_controller.rb
# frozen_string_literal: true module V0 module GIDS class YellowRibbonProgramsController < GIDSController def index render json: service.get_yellow_ribbon_programs_v0(scrubbed_params) end end end end
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/preneeds/preneed_attachments_controller.rb
# frozen_string_literal: true module V0 module Preneeds class PreneedAttachmentsController < PreneedsController include FormAttachmentCreate skip_before_action(:authenticate, raise: false) FORM_ATTACHMENT_MODEL = ::Preneeds::PreneedAttachment private def serializer_klass ...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/preneeds/burial_forms_controller.rb
# frozen_string_literal: true require 'vets/shared_logging' module V0 module Preneeds class BurialFormsController < PreneedsController include Vets::SharedLogging FORM = '40-10007' def create @form = ::Preneeds::BurialForm.new(burial_form_params) validate!(Common::HashHelpers...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/preneeds/cemeteries_controller.rb
# frozen_string_literal: true module V0 module Preneeds class CemeteriesController < PreneedsController def index resource = client.get_cemeteries render json: CemeterySerializer.new(resource.records) end end end end
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/user/mhv_user_accounts_controller.rb
# frozen_string_literal: true module V0 module User class MHVUserAccountsController < ApplicationController service_tag 'identity' rescue_from MHV::UserAccount::Errors::UserAccountError, with: :render_mhv_account_errors def show authorize MHVUserAccount mhv_user_account = MHV::...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/mdot/supplies_controller.rb
# frozen_string_literal: true module V0 module MDOT class SuppliesController < ApplicationController service_tag 'medical-supply-reordering' def create render(json: client.submit_order(supply_params)) end private def address_params %i[ street s...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/profile/payment_history_controller.rb
# frozen_string_literal: true module V0 module Profile class PaymentHistoryController < ApplicationController service_tag 'payment-history' before_action { authorize :bgs, :access? } def index payment_history = PaymentHistory.new(payments: adapter.payments, return_payments: adapter.ret...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/profile/direct_deposits_controller.rb
# frozen_string_literal: true require 'lighthouse/service_exception' require 'lighthouse/direct_deposit/client' require 'lighthouse/direct_deposit/error_parser' require 'lighthouse/direct_deposit/payment_account' module V0 module Profile class DirectDepositsController < ApplicationController service_tag '...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/profile/valid_va_file_numbers_controller.rb
# frozen_string_literal: true module V0 module Profile class ValidVAFileNumbersController < ApplicationController service_tag 'profile' before_action { authorize :bgs, :access? } def show response = BGS::People::Request.new.find_person_by_participant_id(user: current_user) val...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/profile/full_names_controller.rb
# frozen_string_literal: true module V0 module Profile class FullNamesController < ApplicationController service_tag 'profile' # Fetches the full name details for the current user. # Namely their first/middle/last name, and suffix. # # @return [Response] Sample response.body: ...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/profile/preferred_names_controller.rb
# frozen_string_literal: true require 'va_profile/demographics/service' module V0 module Profile class PreferredNamesController < ApplicationController service_tag 'profile' before_action { authorize :demographics, :access? } before_action { authorize :mpi, :queryable? } after_action :in...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/profile/connected_applications_controller.rb
# frozen_string_literal: true module V0 module Profile class ConnectedApplicationsController < ApplicationController include IgnoreNotFound service_tag 'profile' def index render json: apps_from_grants end def destroy icn = @current_user.icn client_id = con...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/profile/permissions_controller.rb
# frozen_string_literal: true module V0 module Profile class PermissionsController < ApplicationController include Vet360::Writeable service_tag 'profile' before_action { authorize :vet360, :access? } after_action :invalidate_cache def create write_to_vet360_and_render_tra...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/profile/vet_verification_statuses_controller.rb
# frozen_string_literal: true module V0 module Profile class VetVerificationStatusesController < ApplicationController service_tag 'profile' before_action { authorize :lighthouse, :access_vet_status? } def show response = service.get_vet_verification_status(@current_user.icn) r...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/profile/personal_informations_controller.rb
# frozen_string_literal: true require 'va_profile/demographics/service' module V0 module Profile class PersonalInformationsController < ApplicationController service_tag 'profile' before_action { authorize :demographics, :access? } before_action { authorize :mpi, :queryable? } # Fetches...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/profile/email_addresses_controller.rb
# frozen_string_literal: true module V0 module Profile class EmailAddressesController < ApplicationController include Vet360::Writeable service_tag 'profile' before_action { authorize :va_profile, :access_to_v2? } after_action :invalidate_cache def create write_to_vet360_a...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/profile/military_occupations_controller.rb
# frozen_string_literal: true require 'va_profile/profile/v3/service' module V0 module Profile class MilitaryOccupationsController < ApplicationController service_tag 'military-info' before_action :controller_enabled? before_action { authorize :vet360, :military_access? } def show ...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/profile/gender_identities_controller.rb
# frozen_string_literal: true require 'va_profile/demographics/service' module V0 module Profile class GenderIdentitiesController < ApplicationController service_tag 'profile' before_action { authorize :demographics, :access? } before_action { authorize :mpi, :queryable? } def update ...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/profile/scheduling_preferences_controller.rb
# frozen_string_literal: true # Controller for managing user scheduling preferences in VA.gov profile. # This controller is still under development, with stubbed transaction responses gated # behind the profile_scheduling_preferences feature flag. module V0 module Profile class SchedulingPreferencesController <...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/profile/contacts_controller.rb
# frozen_string_literal: true require 'va_profile/profile/v3/service' module V0 module Profile class ContactsController < ApplicationController service_tag 'profile' before_action { authorize :vet360, :access? } # GET /v0/profile/contacts def index @start_ms = current_time_ms ...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/profile/transactions_controller.rb
# frozen_string_literal: true require 'va_profile/contact_information/v2/service' module V0 module Profile class TransactionsController < ApplicationController include Vet360::Transactionable include Vet360::Writeable service_tag 'profile' before_action { authorize :va_profile, :access_...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/profile/addresses_controller.rb
# frozen_string_literal: true module V0 module Profile class AddressesController < ApplicationController include Vet360::Writeable service_tag 'profile' before_action { authorize :va_profile, :access_to_v2? } after_action :invalidate_cache def create write_to_vet360_and_re...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/profile/telephones_controller.rb
# frozen_string_literal: true module V0 module Profile class TelephonesController < ApplicationController include Vet360::Writeable service_tag 'profile' before_action { authorize :va_profile, :access_to_v2? } after_action :invalidate_cache def create write_to_vet360_and_r...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/profile/address_validation_controller.rb
# frozen_string_literal: true require 'va_profile/models/validation_address' require 'va_profile/address_validation/v3/service' module V0 module Profile class AddressValidationController < ApplicationController service_tag 'profile' skip_before_action :authenticate, only: [:create] def creat...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/profile/service_histories_controller.rb
# frozen_string_literal: true require 'va_profile/military_personnel/service' require 'lighthouse/benefits_discovery/params' require 'lighthouse/benefits_discovery/log_eligible_benefits_job' module V0 module Profile class ServiceHistoriesController < ApplicationController service_tag 'profile' befor...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/profile/persons_controller.rb
# frozen_string_literal: true require 'va_profile/person/service' module V0 module Profile class PersonsController < ApplicationController include Vet360::Transactionable service_tag 'profile' after_action :invalidate_mpi_cache def initialize_vet360_id response = VAProfile::Per...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/profile/communication_preferences_controller.rb
# frozen_string_literal: true require 'va_profile/communication/service' module V0 module Profile class CommunicationPreferencesController < ApplicationController service_tag 'profile' before_action { authorize :vet360, :access? } before_action { authorize :communication_preferences, :access? ...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/my_va/submission_pdf_urls_controller.rb
# frozen_string_literal: true require 'forms/submission_statuses/pdf_urls' require 'faraday' module V0 module MyVA class SubmissionPdfUrlsController < ApplicationController before_action :check_flipper_flag service_tag 'form-submission-pdf' def create url = Forms::SubmissionStatuses::...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/my_va/submission_statuses_controller.rb
# frozen_string_literal: true require 'forms/submission_statuses/report' module V0 module MyVA class SubmissionStatusesController < ApplicationController service_tag 'form-submission-statuses' def show report = Forms::SubmissionStatuses::Report.new( user_account: @current_user.use...
0
code_files/vets-api-private/app/controllers/v0
code_files/vets-api-private/app/controllers/v0/form1010cg/attachments_controller.rb
# frozen_string_literal: true module V0 module Form1010cg class AttachmentsController < ApplicationController include FormAttachmentCreate service_tag 'caregiver-application' skip_before_action :authenticate, raise: false FORM_ATTACHMENT_MODEL = ::Form1010cg::Attachment private ...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/sign_in/application_controller.rb
# frozen_string_literal: true module SignIn class ApplicationController < ActionController::API include SignIn::Authentication include SignIn::Instrumentation include Pundit::Authorization include ActionController::Cookies include ExceptionHandling include Headers include ControllerLoggin...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/sign_in/client_configs_controller.rb
# frozen_string_literal: true module SignIn class ClientConfigsController < SignIn::ServiceAccountApplicationController service_tag 'identity' rescue_from ActiveRecord::RecordNotFound, with: :not_found before_action :set_client_config, only: %i[show update destroy] def index client_configs = S...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/sign_in/user_info_controller.rb
# frozen_string_literal: true module SignIn class UserInfoController < ApplicationController service_tag 'identity' def show authorize access_token, policy_class: SignIn::UserInfoPolicy user_info = SignIn::UserInfoGenerator.new(user: current_user).perform if user_info.valid? rende...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/sign_in/service_account_configs_controller.rb
# frozen_string_literal: true module SignIn class ServiceAccountConfigsController < ServiceAccountApplicationController service_tag 'identity' rescue_from ActiveRecord::RecordNotFound, with: :not_found before_action :set_service_account_config, only: %i[show update destroy] def index service_a...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/sign_in/service_account_application_controller.rb
# frozen_string_literal: true module SignIn class ServiceAccountApplicationController < ActionController::API include SignIn::Authentication include SignIn::ServiceAccountAuthentication include Pundit::Authorization include ExceptionHandling include Headers include ControllerLoggingContext ...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/sign_in/openid_connect_certificates_controller.rb
# frozen_string_literal: true module SignIn class OpenidConnectCertificatesController < SignIn::ApplicationController skip_before_action :authenticate def index render json: SignIn::OpenidConnectCertificatesPresenter.new.perform end end end
0
code_files/vets-api-private/app/controllers/sign_in
code_files/vets-api-private/app/controllers/sign_in/webhooks/logingov_controller.rb
# frozen_string_literal: true require 'sign_in/logingov/service' module SignIn module Webhooks class LogingovController < SignIn::ServiceAccountApplicationController Mime::Type.register 'application/secevent+jwt', :secevent_jwt service_tag 'identity' before_action :authenticate_service_account...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/concerns/json_api_pagination_links.rb
# frozen_string_literal: true module JsonApiPaginationLinks extend ActiveSupport::Concern private def pagination_links(collection) total_size = collection.try(:size) || collection.data.size per_page = pagination_params[:per_page].try(:to_i) || total_size current_page = pagination_params[:page].try(...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/concerns/ignore_not_found.rb
# frozen_string_literal: true module IgnoreNotFound def skip_sentry_exception_types ApplicationController::SKIP_SENTRY_EXCEPTION_TYPES + [Common::Exceptions::RecordNotFound] end end
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/concerns/controller_logging_context.rb
# frozen_string_literal: true module ControllerLoggingContext extend ActiveSupport::Concern included { before_action :set_context } private def set_context RequestStore.store['request_id'] = request.uuid RequestStore.store['additional_request_attributes'] = { 'remote_ip' => request.remote_ip, ...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/concerns/headers.rb
# frozen_string_literal: true module Headers extend ActiveSupport::Concern included { prepend_before_action :set_app_info_headers } def set_app_info_headers headers['X-Git-SHA'] = AppInfo::GIT_REVISION headers['X-GitHub-Repository'] = AppInfo::GITHUB_URL headers['Timing-Allow-Origin'] = Settings.we...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/concerns/failed_request_loggable.rb
# frozen_string_literal: true module FailedRequestLoggable extend ActiveSupport::Concern class_methods do def exception_hash(exception) hash = {} %i[ as_json attributes backtrace body errors inspect instance_values key message original_body original_status response_...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/concerns/appointment_authorization.rb
# frozen_string_literal: true module AppointmentAuthorization extend ActiveSupport::Concern protected def authorize raise_access_denied unless current_user.loa3? raise_access_denied_no_icn if current_user.icn.blank? end def authorize_with_facilities authorize raise_access_denied_no_facilit...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/concerns/form_attachment_create.rb
# frozen_string_literal: true module FormAttachmentCreate extend ActiveSupport::Concern def create debug_timestamp = Time.current.iso8601 Rails.logger.info('begin form attachment creation', { file_data_present: filtered_params[:file_data].present?, ...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/concerns/sentry_controller_logging.rb
# frozen_string_literal: true module SentryControllerLogging extend ActiveSupport::Concern included { before_action :set_sentry_tags_and_extra_context } private def set_sentry_tags_and_extra_context Sentry.set_extras(request_uuid: request.uuid) Sentry.set_user(user_context) if current_user Sentr...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/concerns/traceable.rb
# frozen_string_literal: true # Provides functionality to controllers for tagging them with specific services. # This tagging allows monitoring and tracing systems (like Datadog) to identify and group # the activities of specific controllers based on the service tags they are associated with. # # @example Setting a se...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/concerns/exception_handling.rb
# frozen_string_literal: true require 'common/exceptions' require 'common/client/errors' require 'json_schema/json_api_missing_attribute' require 'datadog' require 'vets/shared_logging' module ExceptionHandling extend ActiveSupport::Concern include Vets::SharedLogging # In addition to Common::Exceptions::Backe...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/concerns/filterable.rb
# frozen_string_literal: true module Filterable extend ActiveSupport::Concern included do before_action :validate_filter_params!, only: :index end def validate_filter_params! if params[:filter].present? return true if valid_filters? raise Common::Exceptions::InvalidFiltersSyntax, filter_...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/concerns/instrumentation.rb
# frozen_string_literal: true module Instrumentation extend ActiveSupport::Concern include SignIn::Authentication private def append_info_to_payload(payload) if @access_token.present? payload[:session] = @access_token.session_handle elsif session && session[:token] payload[:session] = Ses...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/concerns/pdf_filename_generator.rb
# frozen_string_literal: true module PdfFilenameGenerator extend ActiveSupport::Concern private # Generates a PDF filename based on form data and prefix. # # Creates a filename using the form prefix and veteran's name from the parsed form data. # If name fields are missing or empty, they are omitted from...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/concerns/authentication_and_sso_concerns.rb
# frozen_string_literal: true # This module only gets mixed in to one place, but is that cleanest way to organize everything in one place related # to this responsibility alone. module AuthenticationAndSSOConcerns # rubocop:disable Metrics/ModuleLength extend ActiveSupport::Concern include ActionController::Cookie...
0
code_files/vets-api-private/app/controllers/concerns
code_files/vets-api-private/app/controllers/concerns/sign_in/service_account_authentication.rb
# frozen_string_literal: true require 'sign_in/logger' module SignIn module ServiceAccountAuthentication extend ActiveSupport::Concern BEARER_PATTERN = /^Bearer / protected def authenticate_service_account @service_account_access_token = authenticate_service_account_access_token valid...
0
code_files/vets-api-private/app/controllers/concerns
code_files/vets-api-private/app/controllers/concerns/sign_in/authentication.rb
# frozen_string_literal: true require 'sign_in/logger' module SignIn module Authentication extend ActiveSupport::Concern BEARER_PATTERN = /^Bearer / included do before_action :authenticate end protected def authenticate @current_user = load_user_object validate_request_...
0
code_files/vets-api-private/app/controllers/concerns
code_files/vets-api-private/app/controllers/concerns/sign_in/audience_validator.rb
# frozen_string_literal: true module SignIn module AudienceValidator extend ActiveSupport::Concern included do prepend Authentication class_attribute :valid_audience # rubocop:disable ThreadSafety/ClassAndModuleAttributes end class_methods do def validates_access_token_audience(*a...
0
code_files/vets-api-private/app/controllers/concerns
code_files/vets-api-private/app/controllers/concerns/sign_in/sso_authorizable.rb
# frozen_string_literal: true module SignIn module SSOAuthorizable extend ActiveSupport::Concern included do skip_before_action :authenticate, only: :authorize_sso before_action :authenticate_authorize_sso, only: :authorize_sso end def authorize_sso validate_authorize_sso_params! ...
0
code_files/vets-api-private/app/controllers/concerns
code_files/vets-api-private/app/controllers/concerns/sign_in/instrumentation.rb
# frozen_string_literal: true module SignIn module Instrumentation extend ActiveSupport::Concern private def append_info_to_payload(payload) super payload[:session] = session if @access_token.present? payload[:user_uuid] = current_user.uuid if current_user.present? end def se...
0
code_files/vets-api-private/app/controllers/concerns
code_files/vets-api-private/app/controllers/concerns/evss/authorizeable.rb
# frozen_string_literal: true module EVSS module Authorizeable extend ActiveSupport::Concern def authorize_evss! unless EVSSPolicy.new(@current_user, :evss).access? raise Common::Exceptions::Forbidden.new(detail: error_detail, source: 'EVSS') end end private def error_detai...
0
code_files/vets-api-private/app/controllers/concerns
code_files/vets-api-private/app/controllers/concerns/vet360/transactionable.rb
# frozen_string_literal: true require 'common/exceptions/record_not_found' require 'va_profile/contact_information/v2/service' module Vet360 module Transactionable extend ActiveSupport::Concern def check_transaction_status! transaction = AsyncTransaction::VAProfile::Base.refresh_transaction_status( ...
0
code_files/vets-api-private/app/controllers/concerns
code_files/vets-api-private/app/controllers/concerns/vet360/writeable.rb
# frozen_string_literal: true require 'common/exceptions/validation_errors' require 'va_profile/contact_information/v2/service' module Vet360 module Writeable extend ActiveSupport::Concern PROFILE_AUDIT_LOG_TYPES = { email: :update_email_address, address: :update_mailing_add...
0
code_files/vets-api-private/app/controllers
code_files/vets-api-private/app/controllers/sts/terms_of_use_controller.rb
# frozen_string_literal: true require 'mhv/account_creation/configuration' module Sts class TermsOfUseController < SignIn::ServiceAccountApplicationController service_tag 'identity' before_action :set_current_terms_of_use_agreement, only: %i[current_status] def current_status Rails.logger.info('[...
0
code_files/vets-api-private/app
code_files/vets-api-private/app/helpers/parameter_filter_helper.rb
# frozen_string_literal: true # ParameterFilterHelper # # This helper provides a method to filter parameters using the lambda # defined in Rails.application.config.filter_parameters. # # Note: # When running in Rails Console, Rails.application.config.filter_parameters == [] # The filtering lambda gets reset in `consol...
0
code_files/vets-api-private/app
code_files/vets-api-private/app/services/debt_transaction_log_service.rb
# frozen_string_literal: true class DebtTransactionLogService STATS_KEY = 'api.debt_transaction_log' def self.track_dispute(submission, user) create_transaction_log( transactionable: submission, transaction_type: 'dispute', user_uuid: user.uuid, debt_identifiers: submission.debt_identi...
0
code_files/vets-api-private/app
code_files/vets-api-private/app/services/mhv_account_type_service.rb
# frozen_string_literal: true require 'bb/client' require 'vets/collection' ## # Models logic pertaining to the verification and logging of MHV accounts # # @param user [User] the user object # class MHVAccountTypeService ELIGIBLE_DATA_CLASS_COUNT_TO_ACCOUNT_LEVEL = { 32 => 'Premium', 18 => 'Advanced', ...
0
code_files/vets-api-private/app
code_files/vets-api-private/app/services/feature_toggles_service.rb
# frozen_string_literal: true class FeatureTogglesService attr_reader :current_user, :cookie_id # Initialize the service with the current user and cookie ID # # @param [User] current_user - The current authenticated user (optional) # @param [String] cookie_id - The cookie ID for anonymous users (optional) ...
0
code_files/vets-api-private/app
code_files/vets-api-private/app/services/email_verification_service.rb
# frozen_string_literal: true require 'email_verification/jwt_generator' require 'sidekiq/attr_package' class EmailVerificationService TOKEN_VALIDITY_DURATION = EmailVerification::JwtGenerator::TOKEN_VALIDITY_DURATION REDIS_EXPIRATION = (TOKEN_VALIDITY_DURATION + 10.minutes).to_i # revocation + cleanup + time ske...
0
code_files/vets-api-private/app
code_files/vets-api-private/app/services/evss_claim_service.rb
# frozen_string_literal: true require 'evss/claims_service' require 'evss/documents_service' require 'evss/auth_headers' require 'lighthouse/benefits_documents/constants' require 'lighthouse/benefits_documents/utilities/helpers' require 'vets/shared_logging' # EVSS Claims Status Tool class EVSSClaimService include ...
0
code_files/vets-api-private/app
code_files/vets-api-private/app/services/user_audit.rb
# frozen_string_literal: true module UserAudit LOG_FILTER = ->(log) { log.name != 'UserAudit' } SemanticLogger.add_appender(appender: Appenders::UserActionAppender.new, filter: LOG_FILTER) SemanticLogger.add_appender(appender: Appenders::AuditLogAppender.new, filter: LOG_FILTER) def self.logger @logger ||...
0
code_files/vets-api-private/app
code_files/vets-api-private/app/services/email_verification_callback.rb
# frozen_string_literal: true class EmailVerificationCallback def self.call(notification) tags = extract_tags(notification) base_metric = 'api.vanotify.email_verification' case notification.status when 'delivered' StatsD.increment("#{base_metric}.delivered", tags:) StatsD.increment('sile...
0
code_files/vets-api-private/app
code_files/vets-api-private/app/services/user_visn_service.rb
# frozen_string_literal: true class UserVisnService # Hardcoded pilot VISNs for MVP - easy to update as pilot expands PILOT_VISNS = %w[2 15 21].freeze CACHE_KEY_PREFIX = 'va_profile:facility_visn' def initialize(user) @user = user end def in_pilot_visn? return false unless @user.va_treatment_faci...
0
code_files/vets-api-private/app/services
code_files/vets-api-private/app/services/medical_copays/vista_account_numbers.rb
# frozen_string_literal: true module MedicalCopays ## # Object for building a list of the user's vista account numbers # # @!attribute data # @return [Hash] class VistaAccountNumbers attr_reader :data, :user ## # Builds a VistaAccountNumbers instance # # @param opts [Hash] # @ret...
0
code_files/vets-api-private/app/services
code_files/vets-api-private/app/services/medical_copays/zero_balance_statements.rb
# frozen_string_literal: true require 'lighthouse/facilities/client' module MedicalCopays ## # Object for building a list of the user's zero balance statements # # @!attribute facility_hash # @!attribute statements # @return [Array<Hash>] # class ZeroBalanceStatements attr_reader :facility_hash, :...
0
code_files/vets-api-private/app/services
code_files/vets-api-private/app/services/medical_copays/request.rb
# frozen_string_literal: true module MedicalCopays ## # An object responsible for making HTTP calls to the VBS service # # @!attribute settings # @return [Config::Options] # @!attribute host # @return (see Config::Options#host) # @!attribute service_name # @return (see Config::Options#service_n...
0
code_files/vets-api-private/app/services/medical_copays
code_files/vets-api-private/app/services/medical_copays/vbs/request_data.rb
# frozen_string_literal: true module MedicalCopays module VBS ## # Object for handling VBS request parameters # # @!attribute user # @return [User] # @!attribute edipi # @return [String] # @!attribute vha_facility_hash # @return [Hash] # @!attribute errors # @retur...
0
code_files/vets-api-private/app/services/medical_copays
code_files/vets-api-private/app/services/medical_copays/vbs/invalid_vbs_request_error.rb
# frozen_string_literal: true module MedicalCopays module VBS ## # Custom error object for handling invalid VBS request params # # @!attribute errors # @return [Array] class InvalidVBSRequestError < StandardError attr_accessor :errors def initialize(json_schema_errors) ...
0
code_files/vets-api-private/app/services/medical_copays
code_files/vets-api-private/app/services/medical_copays/vbs/response_data.rb
# frozen_string_literal: true module MedicalCopays module VBS ## # Object for handling VBS responses # # @!attribute body # @return [String] # @!attribute status # @return [Integer] class ResponseData attr_reader :body, :status STATSD_KEY_PREFIX = 'api.mcp.vbs' ...
0
code_files/vets-api-private/app/services/medical_copays
code_files/vets-api-private/app/services/medical_copays/vbs/service.rb
# frozen_string_literal: true module MedicalCopays module VBS ## # Service object for isolating dependencies in the {MedicalCopaysController} # # @!attribute request # @return [MedicalCopays::Request] # @!attribute request_data # @return [RequestData] # @!attribute response_data ...
0
code_files/vets-api-private/app/services/medical_copays
code_files/vets-api-private/app/services/medical_copays/lighthouse_integration/service.rb
# frozen_string_literal: true require 'lighthouse/healthcare_cost_and_coverage/invoice/service' require 'lighthouse/healthcare_cost_and_coverage/account/service' require 'lighthouse/healthcare_cost_and_coverage/charge_item/service' require 'lighthouse/healthcare_cost_and_coverage/encounter/service' require 'lighthouse...
0
code_files/vets-api-private/app/services/debt_transaction_log
code_files/vets-api-private/app/services/debt_transaction_log/summary_builders/waiver_summary_builder.rb
# frozen_string_literal: true class DebtTransactionLog::SummaryBuilders::WaiverSummaryBuilder def self.build(submission) { debt_type: submission.public_metadata&.dig('debt_type') || 'unknown', combined: submission.public_metadata&.dig('combined') == true, streamlined: submission.public_metadata...