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/services/debt_transaction_log | code_files/vets-api-private/app/services/debt_transaction_log/summary_builders/dispute_summary_builder.rb | # frozen_string_literal: true
class DebtTransactionLog::SummaryBuilders::DisputeSummaryBuilder
def self.build(submission)
file_count = submission.respond_to?(:files) && submission.files&.attached? ? submission.files.count : 0
{
debt_types: submission.public_metadata&.dig('debt_types') || [],
dis... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/hca/overrides_parser.rb | # frozen_string_literal: true
module HCA
class OverridesParser
STATE_OVERRIDES = {
'MEX' => {
'aguascalientes' => 'AGS.',
'baja-california-norte' => 'B.C.',
'baja-california-sur' => 'B.C.S.',
'campeche' => 'CAM.',
'chiapas' => 'CHIS.',
'chihuahua' => 'CHIH.',... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/identity/errors.rb | # frozen_string_literal: true
module Identity
module Errors
class CernerProvisionerError < StandardError; end
end
end
|
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/identity/cerner_provisioner.rb | # frozen_string_literal: true
require 'map/sign_up/service'
module Identity
class CernerProvisioner
include ActiveModel::Validations
COOKIE_NAME = 'CERNER_CONSENT'
COOKIE_VALUE = 'ACCEPTED'
COOKIE_PATH = '/'
COOKIE_EXPIRATION = 2.minutes
COOKIE_DOMAIN = '.va.gov'
attr_reader :icn, :sou... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/base_assertion_validator.rb | # frozen_string_literal: true
module SignIn
class BaseAssertionValidator
private
def decode_assertion!(assertion)
payload, _header = JWT.decode(assertion, nil, true, jwt_decode_options, &method(:jwt_keyfinder))
payload.deep_symbolize_keys
rescue JWT::InvalidAudError, JWT::InvalidIatError, JW... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/errors.rb | # frozen_string_literal: true
module SignIn
module Errors
class StandardError < StandardError
attr_reader :code
def initialize(message:, code: Constants::ErrorCode::INVALID_REQUEST)
@code = code
super(message)
end
end
class AccessDeniedError < StandardError; end
cl... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/service_account_access_token_jwt_decoder.rb | # frozen_string_literal: true
module SignIn
class ServiceAccountAccessTokenJwtDecoder
attr_reader :service_account_access_token_jwt
def initialize(service_account_access_token_jwt:)
@service_account_access_token_jwt = service_account_access_token_jwt
end
def perform(with_validation: true)
... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/token_exchanger.rb | # frozen_string_literal: true
module SignIn
class TokenExchanger
include ActiveModel::Validations
attr_reader :subject_token, :subject_token_type, :actor_token, :actor_token_type, :client_id
validate :validate_subject_token!,
:validate_subject_token_type!,
:validate_actor_toke... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/user_info_generator.rb | # frozen_string_literal: true
module SignIn
class UserInfoGenerator
attr_reader :user
def initialize(user:)
@user = user
end
def perform
SignIn::UserInfo.new(sub:, ial:, aal:, csp_type:, csp_uuid:, email:, full_name:, birth_date:, ssn:, gender:,
address_street... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/access_token_audience_generator.rb | # frozen_string_literal: true
module SignIn
class AccessTokenAudienceGenerator
SHARED_SESSION_CLIENT_IDS_CACHE_KEY = 'sis_shared_sessions_client_ids'
def initialize(client_config:)
@client_config = client_config
end
def perform
generate_audience
end
private
attr_reader :cl... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/service_account_access_token_jwt_encoder.rb | # frozen_string_literal: true
module SignIn
class ServiceAccountAccessTokenJwtEncoder
attr_reader :service_account_access_token
def initialize(service_account_access_token:)
@service_account_access_token = service_account_access_token
end
def perform
jwt_encode_service_account_access_to... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/refresh_token_decryptor.rb | # frozen_string_literal: true
module SignIn
class RefreshTokenDecryptor
attr_reader :encrypted_refresh_token
def initialize(encrypted_refresh_token:)
@encrypted_refresh_token = encrypted_refresh_token
end
def perform
decrypted_component = get_decrypted_component
validate_token!(de... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/logout_redirect_generator.rb | # frozen_string_literal: true
require 'sign_in/logingov/service'
module SignIn
class LogoutRedirectGenerator
attr_reader :credential_type, :client_config
def initialize(client_config:, credential_type: nil)
@credential_type = credential_type
@client_config = client_config
end
def perfo... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/credential_level_creator.rb | # frozen_string_literal: true
module SignIn
class CredentialLevelCreator
attr_reader :requested_acr,
:type,
:logingov_acr,
:verified_at,
:mhv_assurance,
:dslogon_assurance,
:level_of_assurance,
:creden... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/authentication_service_retriever.rb | # frozen_string_literal: true
require 'sign_in/logingov/service'
require 'sign_in/idme/service'
require 'credential/service'
module SignIn
class AuthenticationServiceRetriever
attr_reader :type, :client_config
def initialize(type:, client_config: nil)
@type = type
@client_config = client_config... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/client_assertion_validator.rb | # frozen_string_literal: true
module SignIn
class ClientAssertionValidator < BaseAssertionValidator
attr_reader :client_assertion, :client_assertion_type, :client_config, :decoded_assertion
def initialize(client_assertion:, client_assertion_type:, client_config:)
super()
@client_assertion = clie... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/code_validator.rb | # frozen_string_literal: true
module SignIn
class CodeValidator
attr_reader :code, :code_verifier, :client_assertion, :client_assertion_type
def initialize(code:, code_verifier:, client_assertion:, client_assertion_type:)
@code = code
@code_verifier = code_verifier
@client_assertion = clie... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/session_revoker.rb | # frozen_string_literal: true
require 'sign_in/logger'
module SignIn
class SessionRevoker
attr_reader :access_token, :refresh_token, :anti_csrf_token, :session, :device_secret
def initialize(anti_csrf_token:, access_token: nil, refresh_token: nil, device_secret: nil)
@refresh_token = refresh_token
... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/access_token_jwt_encoder.rb | # frozen_string_literal: true
module SignIn
class AccessTokenJwtEncoder
attr_reader :access_token
def initialize(access_token:)
@access_token = access_token
end
def perform
jwt_encode_access_token
end
private
def payload
{
iss: Constants::AccessToken::ISSUER,... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/token_serializer.rb | # frozen_string_literal: true
module SignIn
class TokenSerializer
attr_reader :session_container, :cookies
def initialize(session_container:, cookies:)
@session_container = session_container
@cookies = cookies
end
def perform
if cookie_authentication_client?
set_cookies
... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/state_payload_verifier.rb | # frozen_string_literal: true
module SignIn
class StatePayloadVerifier
attr_reader :state_payload
def initialize(state_payload:)
@state_payload = state_payload
end
def perform
validate_state_code
end
private
def state_code
@state_code ||= StateCode.find(state_payload... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/state_payload_jwt_decoder.rb | # frozen_string_literal: true
module SignIn
class StatePayloadJwtDecoder
attr_reader :state_payload_jwt
def initialize(state_payload_jwt:)
@state_payload_jwt = state_payload_jwt
end
def perform
create_state_payload
end
private
def create_state_payload
StatePayload.ne... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/logger.rb | # frozen_string_literal: true
require 'sign_in/constants/auth'
module SignIn
class Logger
attr_reader :prefix
def initialize(prefix:)
@prefix = prefix
end
def info(message, context = {})
Rails.logger.info("[SignInService] [#{prefix}] #{message}", context)
end
end
end
|
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/session_refresher.rb | # frozen_string_literal: true
module SignIn
class SessionRefresher
attr_reader :refresh_token, :anti_csrf_token, :session
def initialize(refresh_token:, anti_csrf_token:)
@refresh_token = refresh_token
@anti_csrf_token = anti_csrf_token
end
def perform
find_valid_oauth_session
... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/session_creator.rb | # frozen_string_literal: true
module SignIn
class SessionCreator
attr_reader :validated_credential
def initialize(validated_credential:)
@validated_credential = validated_credential
end
def perform
validate_credential_lock
validate_terms_of_use
SessionContainer.new(session: ... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/user_code_map_creator.rb | # frozen_string_literal: true
module SignIn
class UserCodeMapCreator
attr_reader :state_payload,
:idme_uuid,
:logingov_uuid,
:credential_email,
:all_credential_emails,
:verified_icn,
:edipi,
:mhv_crede... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/redirect_url_generator.rb | # frozen_string_literal: true
module SignIn
class RedirectUrlGenerator
attr_reader :redirect_uri, :params_hash, :terms_code, :terms_redirect_uri
def initialize(redirect_uri:, terms_redirect_uri: nil, terms_code: nil, params_hash: {})
@redirect_uri = redirect_uri
@terms_redirect_uri = terms_redir... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/refresh_token_encryptor.rb | # frozen_string_literal: true
module SignIn
class RefreshTokenEncryptor
attr_reader :refresh_token, :version, :nonce
def initialize(refresh_token:)
@refresh_token = refresh_token
validate_input
@version = refresh_token.version
@nonce = refresh_token.nonce
end
def perform
... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/assertion_validator.rb | # frozen_string_literal: true
module SignIn
class AssertionValidator < BaseAssertionValidator
attr_reader :assertion, :decoded_assertion, :service_account_config
def initialize(assertion:)
super()
@assertion = assertion
end
def perform
@decoded_assertion = decode_assertion!(assert... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/token_params_validator.rb | # frozen_string_literal: true
module SignIn
class TokenParamsValidator
include ActiveModel::Validations
attr_reader :grant_type, :code, :code_verifier, :client_assertion, :client_assertion_type, :assertion,
:subject_token, :subject_token_type, :actor_token, :actor_token_type, :client_id
... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/session_spawner.rb | # frozen_string_literal: true
module SignIn
class SessionSpawner
include ActiveModel::Validations
attr_reader :credential_email,
:user_verification,
:user_attributes,
:client_config,
:hashed_device_secret,
:refresh_creation
... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/openid_connect_certificates_presenter.rb | # frozen_string_literal: true
module SignIn
class OpenidConnectCertificatesPresenter
def perform
{
keys: public_keys_jwk
}
end
private
def public_keys_jwk
public_keys.map do |public_key|
JWT::JWK.new(public_key, { alg: 'RS256', use: 'sig' }).export
end
en... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/attribute_validator.rb | # frozen_string_literal: true
module SignIn
class AttributeValidator
def initialize(user_attributes:)
@user_attributes = user_attributes
end
def perform
return unless verified_credential?
validate_credential_attributes
if mhv_auth?
validate_mhv_mpi_record
valida... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/acr_translator.rb | # frozen_string_literal: true
module SignIn
class AcrTranslator
attr_reader :acr, :type, :uplevel
def initialize(acr:, type:, uplevel: false)
@acr = acr
@type = type
@uplevel = uplevel
end
def perform
{ acr: translate_acr, acr_comparison: translate_acr_comparison }.compact
... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/state_payload_jwt_encoder.rb | # frozen_string_literal: true
module SignIn
class StatePayloadJwtEncoder
attr_reader :acr, :client_config, :type, :code_challenge, :code_challenge_method, :client_state, :scope
# rubocop:disable Metrics/ParameterLists
def initialize(code_challenge:, code_challenge_method:, acr:, client_config:, type:, s... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/revoke_sessions_for_user.rb | # frozen_string_literal: true
module SignIn
class RevokeSessionsForUser
attr_reader :user_account, :sessions
def initialize(user_account:)
@user_account = user_account
end
def perform
delete_sessions!
end
private
def delete_sessions!
OAuthSession.where(user_account:)... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/access_token_jwt_decoder.rb | # frozen_string_literal: true
module SignIn
class AccessTokenJwtDecoder
attr_reader :access_token_jwt
def initialize(access_token_jwt:)
@access_token_jwt = access_token_jwt
end
def perform(with_validation: true)
decoded_token = jwt_decode_access_token(with_validation)
AccessToken.... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/user_loader.rb | # frozen_string_literal: true
module SignIn
class UserLoader
CERNER_ELIGIBLE_COOKIE_NAME = 'CERNER_ELIGIBLE'
attr_reader :access_token, :request_ip, :cookies
def initialize(access_token:, request_ip:, cookies:)
@access_token = access_token
@request_ip = request_ip
@cookies = cookies
... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/sign_in/token_response_generator.rb | # frozen_string_literal: true
module SignIn
class TokenResponseGenerator
attr_reader :grant_type, :code, :code_verifier, :client_assertion, :client_assertion_type, :assertion,
:subject_token, :subject_token_type, :actor_token, :actor_token_type, :client_id, :cookies,
:request_attr... |
0 | code_files/vets-api-private/app/services/sign_in | code_files/vets-api-private/app/services/sign_in/auth_sso/session_validator.rb | # frozen_string_literal: true
module SignIn
module AuthSSO
class SessionValidator
def initialize(access_token:, client_id:)
@access_token = access_token
@client_id = client_id
end
def perform
validate_session!
validate_client_configs!
validate_credential... |
0 | code_files/vets-api-private/app/services/sign_in | code_files/vets-api-private/app/services/sign_in/constants/error_code.rb | # frozen_string_literal: true
module SignIn
module Constants
module ErrorCode
IDME_VERIFICATION_DENIED = '001'
GENERIC_EXTERNAL_ISSUE = '007'
LOGINGOV_VERIFICATION_DENIED = '009'
MULTIPLE_MHV_IEN = '101'
MULTIPLE_EDIPI = '102'
MULTIPLE_CORP_ID = '106'
MPI_LOCKED_ACCOUNT ... |
0 | code_files/vets-api-private/app/services/sign_in | code_files/vets-api-private/app/services/sign_in/constants/statsd.rb | # frozen_string_literal: true
module SignIn
module Constants
module Statsd
STATSD_SIS_AUTHORIZE_SUCCESS = 'api.sis.auth.success'
STATSD_SIS_AUTHORIZE_FAILURE = 'api.sis.auth.failure'
STATSD_SIS_AUTHORIZE_SSO_SUCCESS = 'api.sis.auth_sso.success'
STATSD_SIS_AUTHORIZE_SSO_FAILURE = 'api.sis.... |
0 | code_files/vets-api-private/app/services/sign_in | code_files/vets-api-private/app/services/sign_in/constants/refresh_token.rb | # frozen_string_literal: true
module SignIn
module Constants
module RefreshToken
ENCRYPTED_ARRAY = [
ENCRYPTED_POSITION = 0,
NONCE_POSITION = 1,
VERSION_POSITION = 2
].freeze
VERSION_LIST = [
CURRENT_VERSION = 'V0'
].freeze
VALIDITY_LENGTHS = [VALID... |
0 | code_files/vets-api-private/app/services/sign_in | code_files/vets-api-private/app/services/sign_in/constants/urn.rb | # frozen_string_literal: true
module SignIn
module Constants
module Urn
ACCESS_TOKEN = 'urn:ietf:params:oauth:token-type:access_token'
DEVICE_SECRET = 'urn:x-oath:params:oauth:token-type:device-secret'
JWT_BEARER_CLIENT_AUTHENTICATION = 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer'
... |
0 | code_files/vets-api-private/app/services/sign_in | code_files/vets-api-private/app/services/sign_in/constants/service_account_access_token.rb | # frozen_string_literal: true
module SignIn
module Constants
module ServiceAccountAccessToken
ISSUER = 'va.gov sign in'
JWT_ENCODE_ALGORITHM = 'RS256'
USER_ATTRIBUTES = %w[icn type credential_id participant_id].freeze
VALIDITY_LENGTHS = [VALIDITY_LENGTH_SHORT_MINUTES = 5.minutes, VALIDITY... |
0 | code_files/vets-api-private/app/services/sign_in | code_files/vets-api-private/app/services/sign_in/constants/auth.rb | # frozen_string_literal: true
module SignIn
module Constants
module Auth
ACCESS_TOKEN_COOKIE_NAME = 'vagov_access_token'
ACCESS_DENIED = 'access_denied'
ACR_VALUES = [LOA1 = 'loa1', LOA3 = 'loa3', IAL1 = 'ial1', IAL2 = 'ial2',
MIN = 'min'].freeze
ACR_TRANSLATIONS = [ID... |
0 | code_files/vets-api-private/app/services/sign_in | code_files/vets-api-private/app/services/sign_in/constants/access_token.rb | # frozen_string_literal: true
module SignIn
module Constants
module AccessToken
VALIDITY_LENGTHS = [VALIDITY_LENGTH_SHORT_MINUTES = 5.minutes, VALIDITY_LENGTH_LONG_MINUTES = 30.minutes].freeze
JWT_ENCODE_ALGORITHM = 'RS256'
VERSION_LIST = [
CURRENT_VERSION = 'V0'
].freeze
... |
0 | code_files/vets-api-private/app/services/sign_in | code_files/vets-api-private/app/services/sign_in/logingov/risc_event_handler.rb | # frozen_string_literal: true
require 'sign_in/logingov/risc_event'
module SignIn
module Logingov
class RiscEventHandler
STATSD_KEY = 'api.sign_in.logingov.risc_event'
attr_reader :payload
def initialize(payload:)
@payload = payload.deep_symbolize_keys
end
def perform
... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/claim_fast_tracking/flash_picker.rb | # frozen_string_literal: true
module ClaimFastTracking
class FlashPicker
DEFAULT_FUZZY_TOLERANCE = 0.2
MIN_FUZZY_MATCH_LENGTH = 6
MIN_LENGTH_RATIO = 0.9
ALS_DC = 8017
ALS_PARTIAL_MATCH_TERMS = [
'amyotrophic lateral sclerosis',
'(als)'
].freeze
ALS_MATCH_TERMS = (ALS_PARTIAL_... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/claim_fast_tracking/diagnostic_codes_for_metrics.rb | # frozen_string_literal: true
module ClaimFastTracking
module DiagnosticCodesForMetrics
include DiagnosticCodes
DC = [
LIMITED_MOTION_OF_WRIST,
LIMITATION_OF_MOTION_OF_INDEX_OR_LONG_FINGER,
LIMITATION_OF_EXTENSION_OF_THE_THIGH,
FLATFOOT_ACQUIRED,
HALLUX_VALGUS_UNILATERAL,
... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/claim_fast_tracking/max_rating_annotator.rb | # frozen_string_literal: true
require 'disability_max_ratings/client'
module ClaimFastTracking
class MaxRatingAnnotator
EXCLUDED_DIGESTIVE_CODES = [7318, 7319, 7327, 7336, 7346].freeze
def self.annotate_disabilities(rated_disabilities_response)
return if rated_disabilities_response.rated_disabilities... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/claim_fast_tracking/constants.rb | # frozen_string_literal: true
module ClaimFastTracking
class Constants
DISABILITIES = {
hypertension: {
code: 7101,
label: 'hypertension'
},
asthma: {
code: 6602,
label: 'asthma'
}
}.freeze
DISABILITIES_BY_CODE = DISABILITIES.to_h { |k, v| [v[:code... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/claim_fast_tracking/max_cfi_metrics.rb | # frozen_string_literal: true
module ClaimFastTracking
class MaxCfiMetrics
attr_reader :form, :form_data, :metadata
MAX_CFI_STATSD_KEY_PREFIX = 'api.max_cfi'
# Triggers any relevant StatsD metrics calls whenever a 526EZ InProgressForm is updated with
# a new params hash. The params[:metadata] hash ... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/claim_fast_tracking/diagnostic_codes.rb | # frozen_string_literal: true
module ClaimFastTracking
module DiagnosticCodes
LIMITED_MOTION_OF_WRIST = 5215
LIMITATION_OF_MOTION_OF_INDEX_OR_LONG_FINGER = 5229
LIMITATION_OF_EXTENSION_OF_THE_THIGH = 5251
FLATFOOT_ACQUIRED = 5276
HALLUX_VALGUS_UNILATERAL = 5280
TINNITUS = 6260
ASTHMA = 66... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/form1010_ezr_attachments/file_type_validator.rb | # frozen_string_literal: true
require 'form1010_ezr/service'
module Form1010EzrAttachments
class FileTypeValidator
def initialize(file)
@file = file
end
# This method was created because there's an issue on the frontend where a user can manually 'change' a
# file's extension via its name in o... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/bgs/dependent_service.rb | # frozen_string_literal: true
require 'claims_evidence_api/uploader'
require 'dependents/monitor'
module BGS
class DependentService
attr_reader :first_name,
:middle_name,
:last_name,
:ssn,
:birth_date,
:common_name,
... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/bgs/dependent_v2_service.rb | # frozen_string_literal: true
require 'claims_evidence_api/uploader'
require 'dependents/monitor'
require 'vets/shared_logging'
module BGS
class DependentV2Service
include Vets::SharedLogging
attr_reader :first_name,
:middle_name,
:last_name,
:ssn,
... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/bgs/awards_service.rb | # frozen_string_literal: true
require 'vets/shared_logging'
module BGS
class AwardsService
include Vets::SharedLogging
attr_reader :participant_id, :ssn, :common_name, :email, :icn
def initialize(user)
@participant_id = user.participant_id
@ssn = user.ssn
@common_name = user.common_n... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/bgs/dependents_veteran_identifiers.md | # Additional notes on get_form_hash_686c()
The purpose of this readme is to add some context and information to `app/services/bgs/dependent_v2_service.rb` and specifically to get_form_hash_686c() The main concern is around the identifiers used in `get_form_hash_686c()`. As noted in the comments in code, the SSN real... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/bgs/uploaded_document_service.rb | # frozen_string_literal: true
require 'vets/shared_logging'
module BGS
class UploadedDocumentService
include Vets::SharedLogging
attr_reader :participant_id, :ssn, :common_name, :email, :icn
def initialize(user)
@participant_id = user.participant_id
@common_name = user.common_name
@e... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/bgs/constants.rb | # frozen_string_literal: true
module BGS
module Constants
EXTERNAL_KEY_MAX_LENGTH = 39
SENTRY_REPORTING_TEAM = 'vfs-ebenefits'
end
end
|
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/bgs/payment_service.rb | # frozen_string_literal: true
require 'bgs/monitor'
module BGS
class PaymentService
attr_reader :common_name, :email, :icn
def initialize(user)
@common_name = user.common_name
@email = user.email
@icn = user.icn
end
def payment_history(person)
response = service.payment_inf... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/bgs/dependency_verification_service.rb | # frozen_string_literal: true
require 'bgs/monitor'
module BGS
class DependencyVerificationService
attr_reader :participant_id, :ssn, :common_name, :email, :icn, :user_uuid
def initialize(user)
@participant_id = user.participant_id
@ssn = user.ssn
@common_name = user.common_name
@em... |
0 | code_files/vets-api-private/app/services/bgs | code_files/vets-api-private/app/services/bgs/people/response.rb | # frozen_string_literal: true
module BGS
module People
class Response
attr_reader :response, :status
def initialize(response, status: :ok)
@response = response
@status = status
end
def participant_id
return if response.blank?
response[:ptcpnt_id]
e... |
0 | code_files/vets-api-private/app/services/bgs | code_files/vets-api-private/app/services/bgs/people/request.rb | # frozen_string_literal: true
module BGS
# The People module provides Redis-backed caching for BGS (Benefits Gateway Service)
# person lookups. It wraps remote calls to BGS and caches responses to minimize
# repeated network requests for the same participant identifiers.
#
# This module contains classes that... |
0 | code_files/vets-api-private/app/services/bgs | code_files/vets-api-private/app/services/bgs/people/service.rb | # frozen_string_literal: true
require 'vets/shared_logging'
module BGS
module People
class Service
class VAFileNumberNotFound < StandardError; end
include Vets::SharedLogging
attr_reader :ssn,
:participant_id,
:common_name,
:email,
... |
0 | code_files/vets-api-private/app/services/mhv | code_files/vets-api-private/app/services/mhv/user_account/creator.rb | # frozen_string_literal: true
require 'mhv/account_creation/service'
module MHV
module UserAccount
class Creator
attr_reader :user_verification, :break_cache, :from_cache_only
def initialize(user_verification:, break_cache: false, from_cache_only: false)
@user_verification = user_verificati... |
0 | code_files/vets-api-private/app/services/mhv | code_files/vets-api-private/app/services/mhv/user_account/errors.rb | # frozen_string_literal: true
module MHV
module UserAccount
module Errors
class UserAccountError < StandardError
def as_json
message.split(',').map { |m| { title: class_name, detail: m.strip } }
end
private
def class_name
self.class.name.demodulize.unde... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/users/scaffold.rb | # frozen_string_literal: true
module Users
# Struct class serving as the pre-serialized object that is passed to the UserSerializer
# during the '/v0/user' endpoint call.
#
# Note that with Struct's, parameter order matters. Namely having `errors` first
# and `status` second.
#
# rubocop:disable Style/S... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/users/exception_handler.rb | # frozen_string_literal: true
require 'common/exceptions'
require 'common/client/concerns/service_status'
require 'mpi/errors/errors'
require 'va_profile/veteran_status/va_profile_error'
module Users
class ExceptionHandler
include Common::Client::Concerns::ServiceStatus
attr_reader :error, :service
# @... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/users/profile.rb | # frozen_string_literal: true
require 'common/exceptions'
require 'common/client/concerns/service_status'
require 'mhv/oh_facilities_helper/service'
module Users
class Profile
include Common::Client::Concerns::ServiceStatus
HTTP_OK = 200
HTTP_SOME_ERRORS = 296
attr_reader :user, :scaffold, :oh_fac... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/users/form_526_user_identifiers_status_service.rb | # frozen_string_literal: true
# For a given user, checks for the presence of certain identifiers required by Form526
# Returns a mapping of the identifier name to a boolean indicating whether we have that information for a user or not
module Users
class Form526UserIdentifiersStatusService
FORM526_REQUIRED_IDENTI... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/users/services.rb | # frozen_string_literal: true
require 'backend_services'
module Users
class Services
attr_reader :user
def initialize(user)
@user = user
@list = auth_free_services
end
# Checks if the initialized user has authorization to access any of the
# below services. Returns an array of ser... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/form1010cg/auditor.rb | # frozen_string_literal: true
module Form1010cg
class Auditor
attr_reader :logger
STATSD_KEY_PREFIX = 'api.form1010cg'
LOGGER_PREFIX = 'Form 10-10CG'
LOGGER_FILTER_KEYS = [:veteran_name].freeze
METRICS = lambda do
submission_prefix = "#{STATSD_KEY_PREFIX}.submission"
proces... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/form1010cg/service.rb | # frozen_string_literal: true
# This service manages the interactions between CaregiversAssistanceClaim, CARMA, and Form1010cg::Submission.
require 'carma/client/mule_soft_client'
require 'carma/models/submission'
require 'carma/models/attachments'
require 'mpi/service'
module Form1010cg
class Service
extend F... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/terms_of_use/errors.rb | # frozen_string_literal: true
module TermsOfUse
module Errors
class AcceptorError < StandardError; end
class DeclinerError < StandardError; end
end
end
|
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/terms_of_use/logger.rb | # frozen_string_literal: true
module TermsOfUse
class Logger
STATSD_PREFIX = 'api.terms_of_use_agreements'
def initialize(terms_of_use_agreement:)
@terms_of_use_agreement = terms_of_use_agreement
end
def perform
log_terms_of_use_agreement
increment_terms_of_use_agreement_statsd
... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/terms_of_use/decliner.rb | # frozen_string_literal: true
require 'terms_of_use/exceptions'
require 'sidekiq/attr_package'
module TermsOfUse
class Decliner
include ActiveModel::Validations
attr_reader :user_account, :icn, :version
validates :user_account, :icn, :version, presence: true
def initialize(user_account:, version:... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/terms_of_use/acceptor.rb | # frozen_string_literal: true
require 'terms_of_use/exceptions'
require 'sidekiq/attr_package'
module TermsOfUse
class Acceptor
include ActiveModel::Validations
attr_reader :user_account, :icn, :version, :sync
validates :user_account, :icn, :version, presence: true
def initialize(user_account:, v... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/login/errors.rb | # frozen_string_literal: true
module Login
module Errors
class UserVerificationNotCreatedError < StandardError; end
class UnknownLoginTypeError < StandardError; end
end
end
|
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/login/user_acceptable_verified_credential_updater_logger.rb | # frozen_string_literal: true
module Login
class UserAcceptableVerifiedCredentialUpdaterLogger
STATSD_KEY_PREFIX = 'api.user_avc_updater'
LOG_MESSAGE = '[UserAcceptableVerifiedCredentialUpdater] - User AVC Updated'
FROM_TYPES = [MHV_TYPE = 'mhv', DSLOGON_TYPE = 'dslogon', IDME_TYPE = 'idme', LOGINGOV_TYP... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/login/after_login_actions.rb | # frozen_string_literal: true
require 'login/errors'
module Login
class AfterLoginActions
attr_reader :current_user, :skip_mhv_account_creation
def initialize(user, skip_mhv_account_creation)
@current_user = user
@skip_mhv_account_creation = skip_mhv_account_creation
end
def perform
... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/login/user_credential_email_updater.rb | # frozen_string_literal: true
module Login
class UserCredentialEmailUpdater
def initialize(credential_email:, user_verification:)
@credential_email = credential_email
@user_verification = user_verification
end
def perform
return unless user_verification && credential_email
updat... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/login/user_verifier.rb | # frozen_string_literal: true
module Login
class UserVerifier
def initialize(login_type:, # rubocop:disable Metrics/ParameterLists
auth_broker:,
mhv_uuid:,
idme_uuid:,
dslogon_uuid:,
logingov_uuid:,
... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/login/user_acceptable_verified_credential_updater.rb | # frozen_string_literal: true
module Login
class UserAcceptableVerifiedCredentialUpdater
def initialize(user_account:)
@user_account = user_account
end
def perform
return unless user_account&.verified?
update_user_acceptable_verified_credential
end
private
attr_reader :u... |
0 | code_files/vets-api-private/app/services | code_files/vets-api-private/app/services/user_audit/logger.rb | # frozen_string_literal: true
module UserAudit
class Logger < SemanticLogger::Logger
def initialize
super('UserAudit', 'info', /UserAudit/)
end
UserAction.statuses.each_key do |status|
define_method(status) do |*args, **kwargs|
kwargs[:status] = status
info(*args, **kwargs)
... |
0 | code_files/vets-api-private/app/services/user_audit | code_files/vets-api-private/app/services/user_audit/appenders/base.rb | # frozen_string_literal: true
module UserAudit
module Appenders
class Base < SemanticLogger::Subscriber
REQUIRED_PAYLOAD_KEYS = %i[status event user_verification].freeze
def initialize(filter: /UserAudit/, level: :info, **args, &)
super(filter:, level:, **args, &)
end
def log(lo... |
0 | code_files/vets-api-private/app/services/user_audit | code_files/vets-api-private/app/services/user_audit/appenders/user_action_appender.rb | # frozen_string_literal: true
module UserAudit
module Appenders
class UserActionAppender < Base
private
def append_log
user_action = UserAction.create!(
user_action_event:,
acting_user_verification:,
subject_user_verification:,
status:,
actin... |
0 | code_files/vets-api-private/app/services/user_audit | code_files/vets-api-private/app/services/user_audit/appenders/audit_log_appender.rb | # frozen_string_literal: true
module UserAudit
module Appenders
class AuditLogAppender < Base
private
def append_log
audit_log = Audit::Log.create!(
subject_user_identifier:,
subject_user_identifier_type:,
acting_user_identifier:,
acting_user_identifie... |
0 | code_files/vets-api-private/app | code_files/vets-api-private/app/concerns/retriable_concern.rb | # frozen_string_literal: true
require 'retriable'
module RetriableConcern
extend ActiveSupport::Concern
def with_retries(block_name, tries: 3, base_interval: 1, &block)
attempts = 0
result = Retriable.retriable(tries:, base_interval:) do |attempt|
attempts = attempt
Rails.logger.warn("Retryi... |
0 | code_files/vets-api-private | code_files/vets-api-private/bin/prod | #!/usr/bin/env bash
# bin/prod - Run Vets API in production mode locally
# Usage: bin/prod [command]
#
# If no command is provided, defaults to 'rails server -e production'
# Examples:
# bin/prod # Starts the rails server in production mode
# bin/prod console # Starts the rails console in production mo... |
0 | code_files/vets-api-private | code_files/vets-api-private/bin/lint | #!/usr/bin/env ruby
# frozen_string_literal: true
require_relative 'lib/vets-api/commands/lint'
require 'rake'
VALID_OPTIONS = ['--dry', '--only-rubocop', '--only-brakeman'].freeze
def help_message
puts <<~HELP
Usage:
bin/lint [options] [files|folders]
Options:
--help, -h Display hel... |
0 | code_files/vets-api-private | code_files/vets-api-private/bin/docker | #!/usr/bin/env sh
# Function to display the help message
display_help() {
echo "Usage: bin/docker [COMMAND]"
echo
echo "Commands:"
echo " clean Prunes unused Docker objects and rebuilds the images"
echo " rebuild Stops running containers and builds the images without cache"
echo " build ... |
0 | code_files/vets-api-private | code_files/vets-api-private/bin/test | #!/usr/bin/env ruby
# frozen_string_literal: true
require_relative 'lib/vets-api/commands/test'
require 'rake'
VALID_OPTIONS = ['--parallel', '--coverage', '--log'].freeze
# rubocop:disable Metrics/MethodLength
def help_message
puts <<~HELP
Usage:
bin/test [options] [files|folders]
Options:
--h... |
0 | code_files/vets-api-private | code_files/vets-api-private/bin/merge_imagemagick_policy | require 'nokogiri'
original_policy_path = '/etc/ImageMagick-6/policy.xml'
new_policy_path = '/app/config/imagemagick/policies/new-policy.xml'
policy1 = Nokogiri::XML(File.read(original_policy_path)) { |config| config.default_xml.noblanks }
policy2 = Nokogiri::XML(File.read(new_policy_path)) { |config| config.default_... |
0 | code_files/vets-api-private | code_files/vets-api-private/bin/git_blame | #!/bin/bash
echo "| Filename | Author 1 | Author 2 | Author 3 | Timestamp 1 | Timestamp 2 | Timestamp 3 |" > git_blame_report.md
echo "|----------|----------|----------|----------|-------------|-------------|-------------|" >> git_blame_report.md
for filename in $(git ls-files)
do
# Extract the three most recent au... |
0 | code_files/vets-api-private | code_files/vets-api-private/bin/rake | #!/usr/bin/env ruby
# frozen_string_literal: true
require_relative '../config/boot'
require 'rake'
Rake.application.run
|
0 | code_files/vets-api-private | code_files/vets-api-private/bin/setup | #!/usr/bin/env ruby
# frozen_string_literal: true
require_relative 'lib/vets-api/commands/setup'
require 'rake'
def help_message
puts <<~HELP
** A setup (.e.g., native) is required and must be the first argument **
Usage:
bin/setup [setup]
Options:
--help, -h Display help messag... |
0 | code_files/vets-api-private | code_files/vets-api-private/bin/local-openresty | #!/usr/bin/env bash
# bin/local-openresty - Boot an OpenResty container as a reverse proxy for Vets API
#
# Usage:
# bin/local-openresty [options]
#
# Options:
# --port PORT Host port to bind OpenResty (default: 80)
# --traefik-port PORT Port where Traefik is running (default: 8081)
# --version VE... |
0 | code_files/vets-api-private | code_files/vets-api-private/bin/info | #!/usr/bin/env ruby
# frozen_string_literal: true
require_relative '../config/boot'
require_relative 'lib/vets-api/commands/info'
require 'rails'
if ARGV.include?('--help') || ARGV.include?('-h')
puts <<~HELP
Usage:
bin/info [option]
Options:
--help, -h Display help message for 'info'... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.