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/lib/lighthouse | code_files/vets-api-private/lib/lighthouse/direct_deposit/payment_account.rb | # frozen_string_literal: true
module Lighthouse
module DirectDeposit
class PaymentAccount
include ActiveModel::Model
attr_accessor :name, :account_number, :routing_number
attr_writer :account_type
ACCOUNT_NUM_REGEX = /\A[a-zA-Z0-9]+\z/
ROUTING_NUM_REGEX = /\A\d{9}\z/
valida... |
0 | code_files/vets-api-private/lib/lighthouse | code_files/vets-api-private/lib/lighthouse/direct_deposit/error_parser.rb | # frozen_string_literal: true
require 'lighthouse/direct_deposit/error_response'
module Lighthouse
module DirectDeposit
class ErrorParser
def self.parse(response)
body = parse_body(response[:body])
detail = parse_detail(body)
status = parse_status(response[:status], detail)
... |
0 | code_files/vets-api-private/lib/lighthouse | code_files/vets-api-private/lib/lighthouse/direct_deposit/response.rb | # frozen_string_literal: true
module Lighthouse
module DirectDeposit
class Response
attr_accessor :status, :control_information, :payment_account, :veteran_status
def initialize(status, control_information, payment_account, veteran_status)
@status = status
@control_information = cont... |
0 | code_files/vets-api-private/lib/lighthouse | code_files/vets-api-private/lib/lighthouse/direct_deposit/payment_info_parser.rb | # frozen_string_literal: true
require 'lighthouse/direct_deposit/response'
module Lighthouse
module DirectDeposit
class PaymentInfoParser
def self.parse(response)
return if response.nil? || response.body.nil?
status = response.status
control_info = parse_control_info(response.body... |
0 | code_files/vets-api-private/lib/lighthouse | code_files/vets-api-private/lib/lighthouse/direct_deposit/client.rb | # frozen_string_literal: true
require 'common/client/base'
require 'lighthouse/direct_deposit/configuration'
require 'lighthouse/direct_deposit/payment_info_parser'
require 'lighthouse/service_exception'
module DirectDeposit
class Client < Common::Client::Base
configuration DirectDeposit::Configuration
STAT... |
0 | code_files/vets-api-private/lib/lighthouse | code_files/vets-api-private/lib/lighthouse/direct_deposit/configuration.rb | # frozen_string_literal: true
require 'common/client/configuration/rest'
require 'lighthouse/auth/client_credentials/jwt_generator'
require 'lighthouse/auth/client_credentials/service'
module DirectDeposit
##
# HTTP client configuration for the {DirectDeposit::Service},
# sets the base path, the base request he... |
0 | code_files/vets-api-private/lib/lighthouse | code_files/vets-api-private/lib/lighthouse/benefits_documents/documents_status_polling_service.rb | # frozen_string_literal: true
require 'common/client/base'
require 'lighthouse/benefits_documents/configuration'
module BenefitsDocuments
class DocumentsStatusPollingService < Common::Client::Base
configuration BenefitsDocuments::Configuration
def self.call(args)
new(args).check_documents_status
... |
0 | code_files/vets-api-private/lib/lighthouse | code_files/vets-api-private/lib/lighthouse/benefits_documents/upload_status_updater.rb | # frozen_string_literal: true
require 'lighthouse/benefits_documents/constants'
require 'lighthouse/benefits_documents/utilities/helpers'
module BenefitsDocuments
class UploadStatusUpdater
# Parses the status of a LighthouseDocumentUpload [EvidenceSubmission] submitted to Lighthouse
# using metadata from th... |
0 | code_files/vets-api-private/lib/lighthouse | code_files/vets-api-private/lib/lighthouse/benefits_documents/worker_service.rb | # frozen_string_literal: true
require 'common/client/base'
require 'lighthouse/benefits_documents/configuration'
require 'lighthouse/service_exception'
module BenefitsDocuments
class WorkerService < Common::Client::Base
configuration BenefitsDocuments::Configuration
STATSD_KEY_PREFIX = 'api.benefits_documen... |
0 | code_files/vets-api-private/lib/lighthouse | code_files/vets-api-private/lib/lighthouse/benefits_documents/constants.rb | # frozen_string_literal: true
module BenefitsDocuments
module Constants
UPLOAD_STATUS = {
CREATED: 'CREATED',
QUEUED: 'QUEUED',
PENDING: 'IN_PROGRESS',
FAILED: 'FAILED',
SUCCESS: 'SUCCESS'
}.freeze
VANOTIFY_STATUS = {
FAILED: 'FAILED',
SUCCESS: 'SUCCESS'
}.f... |
0 | code_files/vets-api-private/lib/lighthouse | code_files/vets-api-private/lib/lighthouse/benefits_documents/update_documents_status_service.rb | # frozen_string_literal: true
require 'lighthouse/benefits_documents/documents_status_polling_service'
require 'lighthouse/benefits_documents/upload_status_updater'
module BenefitsDocuments
class UpdateDocumentsStatusService
def self.call(*)
new(*).process_status_updates
end
# @param pending_evid... |
0 | code_files/vets-api-private/lib/lighthouse | code_files/vets-api-private/lib/lighthouse/benefits_documents/configuration.rb | # frozen_string_literal: true
require 'common/client/configuration/rest'
require 'faraday/multipart'
require 'lighthouse/auth/client_credentials/jwt_generator'
require 'lighthouse/auth/client_credentials/service'
module BenefitsDocuments
##
# HTTP client configuration for the {BenefitsClaims::Service},
# sets t... |
0 | code_files/vets-api-private/lib/lighthouse | code_files/vets-api-private/lib/lighthouse/benefits_documents/service.rb | # frozen_string_literal: true
require 'common/client/base'
require 'lighthouse/benefits_documents/configuration'
require 'lighthouse/service_exception'
require 'lighthouse/benefits_documents/constants'
require 'lighthouse/benefits_documents/utilities/helpers'
module BenefitsDocuments
class Service < Common::Client:... |
0 | code_files/vets-api-private/lib/lighthouse/benefits_documents | code_files/vets-api-private/lib/lighthouse/benefits_documents/utilities/helpers.rb | # frozen_string_literal: true
module BenefitsDocuments
module Utilities
module Helpers
FILENAME_EXTENSION_MATCHER = /\.\w*$/
OBFUSCATED_CHARACTER_MATCHER = /[a-zA-Z\d]/
def self.generate_obscured_file_name(original_filename)
extension = original_filename[FILENAME_EXTENSION_MATCHER]
... |
0 | code_files/vets-api-private/lib/lighthouse/benefits_documents | code_files/vets-api-private/lib/lighthouse/benefits_documents/form526/upload_supplemental_document_service.rb | # frozen_string_literal: true
require 'lighthouse/benefits_documents/worker_service'
require 'lighthouse/service_exception'
# Form 526 specific client service for the Lighthouse Benefits Documents API:
# https://dev-developer.va.gov/explore/api/benefits-documents/docs?version=current
#
# There is a similar service im... |
0 | code_files/vets-api-private/lib/lighthouse/benefits_documents | code_files/vets-api-private/lib/lighthouse/benefits_documents/form526/documents_status_polling_service.rb | # frozen_string_literal: true
require 'common/client/base'
require 'lighthouse/benefits_documents/configuration'
module BenefitsDocuments
module Form526
class DocumentsStatusPollingService < Common::Client::Base
configuration BenefitsDocuments::Configuration
def self.call(args)
new(args).ch... |
0 | code_files/vets-api-private/lib/lighthouse/benefits_documents | code_files/vets-api-private/lib/lighthouse/benefits_documents/form526/upload_status_updater.rb | # frozen_string_literal: true
module BenefitsDocuments
module Form526
class UploadStatusUpdater
# Parses the status of a Lighthouse526DocumentUpload submitted to Lighthouse
# using metadata from the Lighthouse Benefits Documents API '/uploads/status' endpoint.
# Provides methods to determine if... |
0 | code_files/vets-api-private/lib/lighthouse/benefits_documents | code_files/vets-api-private/lib/lighthouse/benefits_documents/form526/polled_document_failure_handler.rb | # frozen_string_literal: true
# Service for taking action when we poll Lighthouse for the status of
# a Lighthouse526DocumentUpload polling record. When Lighthouse marks the
# record as failed in their system, this class handles any
# post-polling actions to deal with the failure.
module BenefitsDocuments
module For... |
0 | code_files/vets-api-private/lib/lighthouse/benefits_documents | code_files/vets-api-private/lib/lighthouse/benefits_documents/form526/update_documents_status_service.rb | # frozen_string_literal: true
require 'lighthouse/benefits_documents/form526/documents_status_polling_service'
require 'lighthouse/benefits_documents/form526/upload_status_updater'
module BenefitsDocuments
module Form526
class UpdateDocumentsStatusService
# Queries the Lighthouse Benefits Documents API's ... |
0 | code_files/vets-api-private/lib/lighthouse | code_files/vets-api-private/lib/lighthouse/facilities/nearby_facility.rb | # frozen_string_literal: true
require 'vets/model'
# Model for responses from Lighthouse facilities "nearby" endpoint which
# only returns facility ID and drivetime band information, and for health
# facilities only
module Lighthouse
module Facilities
class NearbyFacility
include Vets::Model
attrib... |
0 | code_files/vets-api-private/lib/lighthouse | code_files/vets-api-private/lib/lighthouse/facilities/facility.rb | # frozen_string_literal: true
require 'vets/model'
# Facility Model
module Lighthouse
module Facilities
class Facility
include Vets::Model
attribute :access, Hash
attribute :active_status, String
attribute :address, Hash
attribute :classification, String
attribute :detailed_... |
0 | code_files/vets-api-private/lib/lighthouse | code_files/vets-api-private/lib/lighthouse/facilities/response.rb | # frozen_string_literal: true
require 'vets/model'
require_relative 'facility'
module Lighthouse
module Facilities
class Response
include Vets::Model
attribute :body, String
attribute :current_page, Integer
attribute :data, Hash, array: true
attribute :links, Hash
attribute ... |
0 | code_files/vets-api-private/lib/lighthouse | code_files/vets-api-private/lib/lighthouse/facilities/client.rb | # frozen_string_literal: true
require 'common/client/base'
require_relative 'nearby_response'
require_relative 'response'
require_relative 'configuration'
module Lighthouse
module Facilities
# Documentation located at:
# https://developer.va.gov/explore/facilities/docs/facilities
class Client < Common::... |
0 | code_files/vets-api-private/lib/lighthouse | code_files/vets-api-private/lib/lighthouse/facilities/nearby_response.rb | # frozen_string_literal: true
require 'vets/model'
require_relative 'nearby_facility'
module Lighthouse
module Facilities
class NearbyResponse
include Vets::Model
attribute :body, String
attribute :current_page, Integer
attribute :data, Hash, array: true
attribute :links, Hash
... |
0 | code_files/vets-api-private/lib/lighthouse | code_files/vets-api-private/lib/lighthouse/facilities/configuration.rb | # frozen_string_literal: true
require 'common/client/configuration/rest'
require 'common/client/middleware/response/raise_custom_error'
require 'lighthouse/facilities/middleware/errors'
module Lighthouse
module Facilities
class Configuration < Common::Client::Configuration::REST
def base_path
Sett... |
0 | code_files/vets-api-private/lib/lighthouse/facilities | code_files/vets-api-private/lib/lighthouse/facilities/v1/response.rb | # frozen_string_literal: true
require 'vets/model'
require_relative '../facility'
module Lighthouse
module Facilities
module V1
class Response
include Vets::Model
attribute :body, String
attribute :current_page, Integer
attribute :data, Hash, array: true
attribute ... |
0 | code_files/vets-api-private/lib/lighthouse/facilities | code_files/vets-api-private/lib/lighthouse/facilities/v1/client.rb | # frozen_string_literal: true
require 'common/client/base'
require_relative 'response'
require_relative '../configuration'
module Lighthouse
module Facilities
module V1
# Documentation located at:
# https://developer.va.gov/explore/facilities/docs/facilities
class Client < Common::Client::Base... |
0 | code_files/vets-api-private/lib/lighthouse/facilities | code_files/vets-api-private/lib/lighthouse/facilities/middleware/errors.rb | # frozen_string_literal: true
module Lighthouse
module Facilities
module Middleware
class Errors < Faraday::Middleware
def on_complete(env)
return if env.success?
env.body = parse_body(env)
end
private
def parse_body(env)
body = JSON.parse(en... |
0 | code_files/vets-api-private/lib | code_files/vets-api-private/lib/slack/service.rb | # frozen_string_literal: true
module Slack
class Service
def initialize(params)
@channel = params[:channel]
@webhook = params[:webhook]
end
def notify(header, blocks = nil)
data = {
text: header,
blocks: blocks ? build_blocks(blocks) : nil,
channel: @channel
... |
0 | code_files/vets-api-private/lib | code_files/vets-api-private/lib/lgy/tag_sentry.rb | # frozen_string_literal: true
module LGY
module TagSentry
module_function
def tag_sentry
Sentry.set_tags(feature: 'lgy')
end
end
end
|
0 | code_files/vets-api-private/lib | code_files/vets-api-private/lib/lgy/configuration.rb | # frozen_string_literal: true
require 'common/client/configuration/rest'
module LGY
class Configuration < Common::Client::Configuration::REST
def connection
@conn ||= Faraday.new(base_path, headers: base_request_headers, request: request_options) do |faraday|
faraday.use(:breakers, service_name:)
... |
0 | code_files/vets-api-private/lib | code_files/vets-api-private/lib/lgy/service.rb | # frozen_string_literal: true
require 'lgy/configuration'
require 'common/client/base'
require 'vets/shared_logging'
module LGY
class Service < Common::Client::Base
include Common::Client::Concerns::Monitoring
include Vets::SharedLogging
configuration LGY::Configuration
STATSD_KEY_PREFIX = 'api.lgy'... |
0 | code_files/vets-api-private/lib | code_files/vets-api-private/lib/generators/module_helper.rb | # frozen_string_literal: true
module ModuleHelper
def module_generator_file_insert(file_path, options = {})
insert_file = File.read(file_path)
matcher_regex = options[:regex] || /path 'modules' do(.*)end/m
existing_entries = insert_file.match(matcher_regex).to_s.split("\n")
## removes the begining ... |
0 | code_files/vets-api-private/lib/generators | code_files/vets-api-private/lib/generators/module_component/USAGE | Description:
This generator will create additional files that may be needed when working with a module in vets-api
e.g. Controllers, Models, Serializers and Service Classes
Important: If you try to create a component for a module that does not currently exist,
you will be prompted via the command line with the... |
0 | code_files/vets-api-private/lib/generators | code_files/vets-api-private/lib/generators/module_component/module_component_generator.rb | # frozen_string_literal: true
require 'rails/generators'
class ModuleComponentGenerator < Rails::Generators::NamedBase
source_root File.expand_path('templates', __dir__)
argument :methods, type: :hash
COMPONENT_TYPES = %w[controller model serializer service].freeze
def prompt_user
if !Dir.exist?("module... |
0 | code_files/vets-api-private/lib/generators/module_component/templates/app | code_files/vets-api-private/lib/generators/module_component/templates/app/models/model.rb.erb | # frozen_string_literal: true
require 'common/models/resource'
module <%= class_name %>
module V0
class <%= @comp_name.camelize %> < Common::Resource
attribute :id, Types::Nil.default(nil)
attribute :message, Types::String
end
end
end
|
0 | code_files/vets-api-private/lib/generators/module_component/templates/app | code_files/vets-api-private/lib/generators/module_component/templates/app/serializers/serializer.rb.erb | # frozen_string_literal: true
require 'jsonapi/serializer'
module <%= class_name %>
module V0
class <%= @comp_name.camelize %>Serializer
include JSONAPI::Serializer
attributes :message
end
end
end
|
0 | code_files/vets-api-private/lib/generators/module_component/templates/app | code_files/vets-api-private/lib/generators/module_component/templates/app/controllers/controller.rb.erb | # frozen_string_literal: true
module <%= class_name %>
module V0
class <%= @comp_name.camelize %>Controller < ApplicationController
# Replace SERVICE_NAME with your application's service name in the Datadog Service Catalog
# This is the dd-service property for your application here: https://github.co... |
0 | code_files/vets-api-private/lib/generators/module_component/templates/app | code_files/vets-api-private/lib/generators/module_component/templates/app/services/configuration.rb.erb | # frozen_string_literal: true
module <%= class_name %>
module V0
class Configuration < Common::Client::Configuration::REST
def base_path
Settings.<%= @comp_name.downcase %>.url
end
def service_name
'<%= @comp_name.classify %>'
end
def connection
@connection... |
0 | code_files/vets-api-private/lib/generators/module_component/templates/app | code_files/vets-api-private/lib/generators/module_component/templates/app/services/service.rb.erb | # frozen_string_literal: true
module <%= class_name %>
module V0
class <%= @comp_name.camelize %>Service < Common::Client::Base
configuration <%= class_name %>::V0::Configuration
def get_message
response = perform(:get, '/', {})
Resource.new(response.body.symbolize_keys)
end
... |
0 | code_files/vets-api-private/lib/generators | code_files/vets-api-private/lib/generators/module/USAGE | Description:
This generator will create an initial file structure and engine file for VFS developers. The purpose of this being so they can quickly start developing code in an isolated file structure exclusive to the new business logic thay are creating.
When a generator is invoked, each public method in the gene... |
0 | code_files/vets-api-private/lib/generators | code_files/vets-api-private/lib/generators/module/module_generator.rb | # frozen_string_literal: true
require 'rails/generators'
require 'generators/module_helper'
class ModuleGenerator < Rails::Generators::NamedBase
source_root File.expand_path('templates', __dir__)
include ModuleHelper
def create_directory_structure
# create the dir structure
%w[controllers models serial... |
0 | code_files/vets-api-private/lib/generators/module | code_files/vets-api-private/lib/generators/module/templates/gitignore.erb | # See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'
# Ignore bundler ... |
0 | code_files/vets-api-private/lib/generators/module | code_files/vets-api-private/lib/generators/module/templates/README.rdoc.erb | = <%= class_name %>
TODO: Short description and motivation.
== Installation
Ensure the following line is in the root project's Gemfile:
gem '<%= class_name.underscore %>', path: 'modules/<%= class_name.underscore %>'
== License
This module is open source under the terms of the [MIT License](https://opensource.org/... |
0 | code_files/vets-api-private/lib/generators/module | code_files/vets-api-private/lib/generators/module/templates/Gemfile.erb | # frozen_string_literal: true
source 'https://rubygems.org'
# Declare your gem's dependencies in <%= class_name.downcase %>.gemspec.
# Bundler will treat runtime dependencies like base dependencies, and
# development dependencies will be added by default to the :development group.
gemspec
# Declare any dependencies ... |
0 | code_files/vets-api-private/lib/generators/module | code_files/vets-api-private/lib/generators/module/templates/gemspec.erb | # frozen_string_literal: true
$LOAD_PATH.push File.expand_path('lib', __dir__)
# Maintain your gem's version:
require '<%= class_name.underscore %>/version'
# Describe your gem and declare its dependencies:
Gem::Specification.new do |spec|
spec.name = '<%= class_name.underscore %>'
spec.version = <%= ... |
0 | code_files/vets-api-private/lib/generators/module | code_files/vets-api-private/lib/generators/module/templates/adr-dir.erb | documentation/adr
|
0 | code_files/vets-api-private/lib/generators/module | code_files/vets-api-private/lib/generators/module/templates/rspec.erb | --color
--require spec_helper
--format progress
<%% if ENV['CI'] %>
--format RspecJunitFormatter
--out log/rspec.xml
<%% end %>
|
0 | code_files/vets-api-private/lib/generators/module | code_files/vets-api-private/lib/generators/module/templates/Rakefile.erb | # frozen_string_literal: true
begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end
require 'rdoc/task'
RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = '<%= class_name %>'
rdoc.options << '--line-numbers'
rdo... |
0 | code_files/vets-api-private/lib/generators/module | code_files/vets-api-private/lib/generators/module/templates/irbrc.erb | # Disable autocomplete in deployed environments
# to help prevent running unintended commands
if ENV['RAILS_ENV'] == 'production'
IRB.conf[:USE_AUTOCOMPLETE] = false
end
|
0 | code_files/vets-api-private/lib/generators/module/templates | code_files/vets-api-private/lib/generators/module/templates/bin/rails.erb | #!/usr/bin/env ruby
# frozen_string_literal: true
ENGINE_ROOT = File.expand_path('../..', __dir__)
ENGINE_PATH = File.expand_path('../../lib/<%= class_name.downcase %>/engine', __dir__)
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __dir__)
require 'bundler/setup' if... |
0 | code_files/vets-api-private/lib/generators/module/templates | code_files/vets-api-private/lib/generators/module/templates/config/routes.rb.erb | # frozen_string_literal: true
<%= class_name %>::Engine.routes.draw do
end
|
0 | code_files/vets-api-private/lib/generators/module/templates | code_files/vets-api-private/lib/generators/module/templates/spec/spec_helper.rb.erb | # frozen_string_literal: true
# Configure Rails Envinronment
ENV['RAILS_ENV'] = 'test'
require 'rspec/rails'
RSpec.configure { |config| config.use_transactional_fixtures = true }
|
0 | code_files/vets-api-private/lib/generators/module/templates | code_files/vets-api-private/lib/generators/module/templates/lib/namespace.rb.erb | # frozen_string_literal: true
require '<%= class_name.underscore %>/engine'
module <%= class_name %>
# Your code goes here...
end
|
0 | code_files/vets-api-private/lib/generators/module/templates/lib | code_files/vets-api-private/lib/generators/module/templates/lib/namespace/engine.rb.erb | # frozen_string_literal: true
module <%= class_name %>
# @see https://api.rubyonrails.org/classes/Rails/Engine.html
class Engine < ::Rails::Engine
isolate_namespace <%= class_name %>
config.generators.api_only = true
initializer 'model_core.factories', after: 'factory_bot.set_factory_paths' do
F... |
0 | code_files/vets-api-private/lib/generators/module/templates/lib | code_files/vets-api-private/lib/generators/module/templates/lib/namespace/version.rb.erb | # frozen_string_literal: true
module <%= class_name %>
# version
VERSION = '0.1.0'
end
|
0 | code_files/vets-api-private/lib | code_files/vets-api-private/lib/breakers/statsd_plugin.rb | # frozen_string_literal: true
require 'string_helpers'
module Breakers
class StatsdPlugin
def get_tags(upstream_request)
source_app = RequestStore.store.dig('additional_request_attributes', 'source')
tags = []
if upstream_request
if upstream_request.url&.path
tags.append("en... |
0 | code_files/vets-api-private/lib/vye | code_files/vets-api-private/lib/vye/dgib/authentication_token_service.rb | # frozen_string_literal: true
module Vye
module DGIB
class AuthenticationTokenService
ALGORITHM_TYPE = 'RS256'
# E & USE were provided by security team but may not be needed for JWT generation
# They're typically used for JWK (JSON Web Key) format, not JWT headers
# TODO: Check with secur... |
0 | code_files/vets-api-private/lib/vye | code_files/vets-api-private/lib/vye/dgib/response.rb | # frozen_string_literal: true
require 'common/client/concerns/service_status'
require 'common/models/base'
module Vye
module DGIB
class Response < Common::Base
include Common::Client::Concerns::ServiceStatus
attribute :status, Integer
def initialize(status, attributes = nil)
super(at... |
0 | code_files/vets-api-private/lib/vye | code_files/vets-api-private/lib/vye/dgib/configuration.rb | # frozen_string_literal: true
module Vye
module DGIB
class Configuration < Common::Client::Configuration::REST
def connection
@conn ||= Faraday.new(base_path, headers: base_request_headers, request: request_options) do |faraday|
faraday.use(:breakers, service_name:)
faraday.ssl[... |
0 | code_files/vets-api-private/lib/vye | code_files/vets-api-private/lib/vye/dgib/service.rb | # frozen_string_literal: true
require 'common/client/base'
require_relative 'configuration'
require_relative 'response'
require_relative 'authentication_token_service'
module Vye
module DGIB
class Service < Common::Client::Base
include Common::Client::Concerns::Monitoring
STATSD_KEY_PREFIX = 'api.v... |
0 | code_files/vets-api-private/lib | code_files/vets-api-private/lib/search_gsa/configuration.rb | # frozen_string_literal: true
require 'common/client/configuration/rest'
module SearchGsa
class Configuration < Common::Client::Configuration::REST
self.read_timeout = 30
def connection
@conn ||= Faraday.new(base_path, headers: base_request_headers, request: request_options) do |faraday|
fara... |
0 | code_files/vets-api-private/lib | code_files/vets-api-private/lib/search_gsa/service.rb | # frozen_string_literal: true
require 'common/client/base'
require 'common/client/concerns/monitoring'
require 'common/client/errors'
require 'search/response'
require 'search_gsa/configuration'
module SearchGsa
# This class builds a wrapper around api.gsa.gov web results API. Creating a new instance of class
# w... |
0 | code_files/vets-api-private/lib | code_files/vets-api-private/lib/email_verification/jwt_generator.rb | # frozen_string_literal: true
module EmailVerification
class JwtGenerator
TOKEN_VALIDITY_DURATION = 30.minutes
ALGORITHM = 'HS256'
ISSUER = 'vets-api-email-verification'
def initialize(user)
@user = user
end
def encode_jwt
JWT.encode(payload, secret, ALGORITHM, headers)
end
... |
0 | code_files/vets-api-private/lib | code_files/vets-api-private/lib/efolder/service.rb | # frozen_string_literal: true
module Efolder
## Veteran Facing eFolder
#
# This service provides the veteran with methods to
# both view the contents of their eFolder, and
# also download the files contained therein.
#
class Service
def initialize(user)
@user = user
@client = VBMS::Clien... |
0 | code_files/vets-api-private/lib | code_files/vets-api-private/lib/sentry/event_scrubber.rb | # frozen_string_literal: true
# Scrubber means either a filter or sanitizer.
require_relative 'scrubbers/email_sanitizer'
require_relative 'scrubbers/filter_request_body'
require_relative 'scrubbers/log_as_warning'
require_relative 'scrubbers/pii_sanitizer'
module Sentry
class EventScrubber
def initialize(even... |
0 | code_files/vets-api-private/lib/sentry | code_files/vets-api-private/lib/sentry/scrubbers/log_as_warning.rb | # frozen_string_literal: true
# only change from previous file was Processor was renamed to Scrubbers
require 'common/exceptions'
require 'evss/error_middleware'
require 'evss/disability_compensation_form/gateway_timeout'
module Sentry
module Scrubbers
class LogAsWarning
SENTRY_LOG_LEVEL_WARNING = 30
... |
0 | code_files/vets-api-private/lib/sentry | code_files/vets-api-private/lib/sentry/scrubbers/email_sanitizer.rb | # frozen_string_literal: true
# only change from previous file was Processor was renamed to Scrubbers
module Sentry
module Scrubbers
class EmailSanitizer
# source: https://stackoverflow.com/a/27194235
EMAIL_REGEX = /\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/i
# largely duplicated code from fr... |
0 | code_files/vets-api-private/lib/sentry | code_files/vets-api-private/lib/sentry/scrubbers/filter_request_body.rb | # frozen_string_literal: true
# only change from previous file was Processor was renamed to Scrubbers
module Sentry
module Scrubbers
class FilterRequestBody
FILTERED_CONTROLLERS = %w[ppiu].freeze
def new
self
end
def process(data)
sanitize(data.deep_stringify_keys)
... |
0 | code_files/vets-api-private/lib/sentry | code_files/vets-api-private/lib/sentry/scrubbers/pii_sanitizer.rb | # frozen_string_literal: true
# only change from previous file was Processor was renamed to Scrubbers
module Sentry
module Scrubbers
class PIISanitizer
SANITIZED_FIELDS =
%w[
accountNumber
accountType
address_line1
address_line2
address_line3
... |
0 | code_files/vets-api-private/lib | code_files/vets-api-private/lib/clamav/patch_client.rb | # frozen_string_literal: true
# clamav-client - ClamAV client
# Copyright (C) 2014 Franck Verrot <franck@verrot.fr>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lice... |
0 | code_files/vets-api-private/lib/clamav | code_files/vets-api-private/lib/clamav/commands/patch_scan_command.rb | # frozen_string_literal: true
## Monkey Patch for the clamav SCAN COMMAND
## file path needs to be vets-api/ because of shared volumes
# clamav-client - ClamAV client
# Copyright (C) 2014 Franck Verrot <franck@verrot.fr>
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... |
0 | code_files/vets-api-private/lib | code_files/vets-api-private/lib/claim_letters/claim_letter_downloader.rb | # frozen_string_literal: true
require 'claim_letters/claim_letter_test_data'
require 'claim_letters/responses/claim_letters_response'
require 'claim_letters/utils/letter_transformer'
require 'claim_letters/utils/doctype_service'
require 'claim_letters/utils/user_helper'
module ClaimStatusTool
class ClaimLetterDownl... |
0 | code_files/vets-api-private/lib | code_files/vets-api-private/lib/claim_letters/claim_letter_test_data.rb | # frozen_string_literal: true
# rubocop:disable all
require "ostruct"
module ClaimLetterTestData
TEST_FILE_PATH = Rails.root.join 'lib', 'claim_letters', 'test_pdf', '1.pdf'
TEST_DATA = [
OpenStruct.new(
document_id: '{B686D3C3-8720-41B5-8640-4F5CECD1A1BE}',
series_id: '{BDE11169-689C-4614-A55C-E6... |
0 | code_files/vets-api-private/lib/claim_letters/providers | code_files/vets-api-private/lib/claim_letters/providers/claim_letters/claim_letters_provider.rb | # frozen_string_literal: true
# interface for a ClaimLetterProvider
# `include ClaimLettersProvider` in a new ClaimLetterProvider class
# the new class MUST implement these methods to be a ClaimLetterProvider
module ClaimLettersProvider
def get_letters = raise(NotImplementedError)
def get_letter(_id) = raise(NotIm... |
0 | code_files/vets-api-private/lib/claim_letters/providers | code_files/vets-api-private/lib/claim_letters/providers/claim_letters/lighthouse_claim_letters_provider.rb | # frozen_string_literal: true
require 'claim_letters/providers/claim_letters/claim_letters_provider'
require 'claim_letters/responses/claim_letters_response'
require 'claim_letters/utils/letter_transformer'
require 'claim_letters/utils/doctype_service'
require 'lighthouse/benefits_documents/service'
require 'claim_let... |
0 | code_files/vets-api-private/lib/claim_letters | code_files/vets-api-private/lib/claim_letters/responses/claim_letters_response.rb | # frozen_string_literal: true
require 'vets/model'
module ClaimLetters
module Responses
DOCTYPE_TO_TYPE_DESCRIPTION = {
'27' => 'Board decision',
'34' => 'Request for specific evidence or information',
'184' => 'Claim decision (or other notification, like Intent to File)',
'408' => 'Noti... |
0 | code_files/vets-api-private/lib/claim_letters | code_files/vets-api-private/lib/claim_letters/utils/doctype_service.rb | # frozen_string_literal: true
class ClaimLetters::DoctypeService
def self.allowed_for_user(user)
ClaimLetters::Responses.default_allowed_doctypes(user)
end
end
|
0 | code_files/vets-api-private/lib/claim_letters | code_files/vets-api-private/lib/claim_letters/utils/letter_transformer.rb | # frozen_string_literal: true
module ClaimLetters
module Utils
module LetterTransformer
FILENAME = 'ClaimLetter'
def self.allowed?(doc, allowed_doctypes)
allowed_doctypes.include?(doc[:doc_type] || doc['docTypeId'].to_s)
end
def self.filter_boa(doc)
# Return true (don't ... |
0 | code_files/vets-api-private/lib/claim_letters | code_files/vets-api-private/lib/claim_letters/utils/user_helper.rb | # frozen_string_literal: true
module ClaimLetters
module Utils
module UserHelper
def self.file_number(user)
return local_file_number(user) if safe_get(user, :participant_id).blank?
remote_file_number(user) || safe_get(user, :ssn)
end
def self.local_file_number(user)
sa... |
0 | code_files/vets-api-private/lib | code_files/vets-api-private/lib/apps/client.rb | # frozen_string_literal: true
require 'common/client/base'
require 'common/client/concerns/monitoring'
require_relative 'configuration'
require_relative 'responses/response'
require 'erb'
require 'vets/shared_logging'
module Apps
# Proxy Service for Apps API.
class Client < Common::Client::Base
include Vets::... |
0 | code_files/vets-api-private/lib | code_files/vets-api-private/lib/apps/configuration.rb | # frozen_string_literal: true
require 'common/client/configuration/rest'
module Apps
##
# HTTP client configuration for the {Apps::Client},
# sets the base path, the base request headers, and a service name for breakers and metrics.
#
class Configuration < Common::Client::Configuration::REST
self.read_t... |
0 | code_files/vets-api-private/lib/apps | code_files/vets-api-private/lib/apps/responses/response.rb | # frozen_string_literal: true
require 'common/client/concerns/service_status'
require 'vets/model'
module Apps
module Responses
##
# Model for Apps responses. Body is passed straight through from the service
# with a validation check that it matches the expected schema.
#
# @!attribute body
... |
0 | code_files/vets-api-private/lib/apps | code_files/vets-api-private/lib/apps/schemas/scopes.json | {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object"
},
"properties": {
"name": {
"type": "string"
},
"displayName": {
"type": "string"
... |
0 | code_files/vets-api-private/lib/apps | code_files/vets-api-private/lib/apps/schemas/app.json | {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"required": ["data"],
"properties": {
"data": {
"type": "object",
"required": [
"id", "app_type", "name", "description",
"platforms","logo_url","service_categories",
"app_url","privacy_url","tos_url... |
0 | code_files/vets-api-private/lib/apps | code_files/vets-api-private/lib/apps/schemas/apps.json | {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"required": ["data"],
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"required": [
"id", "app_type", "name", "description",
"platforms","logo_url","service_categ... |
0 | code_files/vets-api-private/lib | code_files/vets-api-private/lib/scopes/form526_submission_state.rb | # frozen_string_literal: true
module Scopes
# rubocop:disable Metrics/ModuleLength
module Form526SubmissionState
extend ActiveSupport::Concern
# rubocop:disable Metrics/BlockLength
# DOCUMENTATION:
# https://github.com/department-of-veterans-affairs/va.gov-team/blob/master/products/disability/526e... |
0 | code_files/vets-api-private/lib | code_files/vets-api-private/lib/faraday_adapter_socks/faraday_adapter_socks.rb | # frozen_string_literal: true
require 'faraday'
require 'socksify'
require 'socksify/http'
require_relative 'faraday/adapter/net_http_socks'
module FaradayAdapterSocks
end
|
0 | code_files/vets-api-private/lib/faraday_adapter_socks/faraday | code_files/vets-api-private/lib/faraday_adapter_socks/faraday/adapter/net_http_socks.rb | # frozen_string_literal: true
# Reference: https://github.com/goldeneggg/faraday_adapter_socks/blob/master/lib/faraday/adapter/net_http_socks.rb
module Faraday
class Adapter
Faraday::Adapter.register_middleware net_http_socks: :NetHttpSocks
class NetHttpSocks < Faraday::Adapter::NetHttp
SOCKS_SCHEMES... |
0 | code_files/vets-api-private/lib | code_files/vets-api-private/lib/central_mail/utilities.rb | # frozen_string_literal: true
module CentralMail
module Utilities
RETRIES = 3
META_PART_NAME = 'metadata'
DOC_PART_NAME = 'content'
SUBMIT_DOC_PART_NAME = 'document'
VALID_LOB = { 'CMP' => 'CMP', 'PMC' => 'PMC', 'INS' => 'INS', 'EDU' => 'EDU', 'VRE' => 'VRE', 'BVA' => 'BVA',
'FI... |
0 | code_files/vets-api-private/lib | code_files/vets-api-private/lib/central_mail/upload_error.rb | # frozen_string_literal: true
require 'pdf_utilities/pdf_validator'
require 'central_mail/upload_error'
module CentralMail
class UploadError < StandardError
attr_accessor :code, :detail, :upstream_http_resp_status
DEFAULT_MESSAGE = 'Internal Server Error'
# DOC1xx errors: client errors, invalid submis... |
0 | code_files/vets-api-private/lib | code_files/vets-api-private/lib/central_mail/configuration.rb | # frozen_string_literal: true
require 'faraday/multipart'
module CentralMail
class Configuration < Common::Client::Configuration::REST
def base_path
"https://#{Settings.central_mail.upload.host}/VADocument"
end
def service_name
'CentralMail'
end
def connection
Faraday.new(bas... |
0 | code_files/vets-api-private/lib | code_files/vets-api-private/lib/central_mail/service.rb | # frozen_string_literal: true
require 'common/client/base'
require 'common/client/concerns/monitoring'
require_relative 'configuration'
module CentralMail
class Service < Common::Client::Base
################################################################
# If you are not a Lighthouse API team, please do n... |
0 | code_files/vets-api-private/lib | code_files/vets-api-private/lib/rx/client_session.rb | # frozen_string_literal: true
require 'common/client/session'
module Rx
# Session model
class ClientSession < Common::Client::Session
redis_store REDIS_CONFIG[:rx_store][:namespace]
redis_ttl 900
redis_key :user_id
end
end
|
0 | code_files/vets-api-private/lib | code_files/vets-api-private/lib/rx/rx_gateway_timeout.rb | # frozen_string_literal: true
require 'common/exceptions/base_error'
module Rx
class RxGatewayTimeout < Common::Exceptions::BaseError
def errors
Array(Common::Exceptions::SerializableError.new(i18n_data))
end
end
end
|
0 | code_files/vets-api-private/lib | code_files/vets-api-private/lib/rx/client.rb | # frozen_string_literal: true
require 'common/client/base'
require 'common/client/concerns/mhv_session_based_client'
require 'rx/configuration'
require 'rx/client_session'
require 'rx/rx_gateway_timeout'
require 'active_support/core_ext/hash/slice'
require 'vets/collection'
module Rx
##
# Core class responsible f... |
0 | code_files/vets-api-private/lib | code_files/vets-api-private/lib/rx/configuration.rb | # frozen_string_literal: true
require 'common/client/configuration/rest'
require 'common/client/middleware/request/camelcase'
require 'common/client/middleware/response/json_parser'
require 'common/client/middleware/response/raise_custom_error'
require 'common/client/middleware/response/mhv_errors'
require 'common/cli... |
0 | code_files/vets-api-private/lib/rx/middleware | code_files/vets-api-private/lib/rx/middleware/response/rx_parser.rb | # frozen_string_literal: true
module Rx
module Middleware
module Response
##
# Middleware class responsible for customizing MHV Rx response parsing
#
class RxParser < Faraday::Middleware
##
# Override the Faraday #on_complete method to filter body through custom #parse
... |
0 | code_files/vets-api-private/lib/rx/middleware | code_files/vets-api-private/lib/rx/middleware/response/rx_raise_error.rb | # frozen_string_literal: true
require 'common/client/middleware/response/raise_custom_error'
module Rx
module Middleware
module Response
class RxRaiseError < Common::Client::Middleware::Response::RaiseCustomError
private
def service_i18n_key
key = super
key << 'LOCKED'... |
0 | code_files/vets-api-private/lib/rx/middleware | code_files/vets-api-private/lib/rx/middleware/response/rx_failed_station.rb | # frozen_string_literal: true
module Rx
module Middleware
module Response
##
# Middleware class responsible for logging Rx Failed Station messages
#
class RxFailedStation < Faraday::Middleware
include Vets::SharedLogging
##
# Override the Faraday #on_complete metho... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.