Its been a while
CI / scan_ruby (push) Failing after 2m13s
CI / lint (push) Failing after 20s

This commit is contained in:
Jason Jordan
2026-07-23 10:41:46 -04:00
parent 16fadfd529
commit 9853d58469
83 changed files with 1978 additions and 243 deletions
+7
View File
@@ -41,5 +41,12 @@ module RailsApiAuthTemplate
# Skip views, helpers and assets when generating a new resource.
config.api_only = true
config.middleware.use Rack::Attack
# 1. Configure a session store type and key names
config.session_store :cookie_store, key: '_britton_api_session'
# 2. Re-include the required middlewares for cookies and sessions
config.middleware.use ActionDispatch::Cookies
config.middleware.use config.session_store, config.session_options
end
end
+93 -76
View File
@@ -1,85 +1,102 @@
# PostgreSQL. Versions 9.3 and up are supported.
#
# Install the pg driver:
# gem install pg
# On macOS with Homebrew:
# gem install pg -- --with-pg-config=/usr/local/bin/pg_config
# On Windows:
# gem install pg
# Choose the win32 build.
# Install PostgreSQL and put its /bin directory on your path.
#
# Configure Using Gemfile
# gem "pg"
#
default: &default
adapter: postgresql
encoding: unicode
# For details on connection pooling, see Rails configuration guide
# https://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
production:
primary:
adapter: sqlserver
mode: dblib
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
host: 10.41.82.73
port: 1433
database: BrittonWeb
username: BSTI
password: BSTIBOY
tds_version: 7.3
vhcs:
adapter: sqlserver
mode: dblib
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
host: "10.41.82.72"
port: 1433
database: VHCS_HIPAA
username: BSTI
password: BSTIBOY
database_tasks: false
tds_version: 7.3
baclight:
adapter: sqlserver
mode: dblib
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
host: "10.41.82.73"
port: 1433
database: Baclight
username: BSTI
password: BSTIBOY
database_tasks: false
tds_version: 7.3
heb_web:
adapter: sqlserver
mode: dblib
host: 10.41.82.73
port: 1433
database: HEBWeb
username: SA
password: Adm1nBb5
pool: 5
database_tasks: false
tds_version: 7.3
development:
<<: *default
database: rails_api_auth_template_development
primary:
adapter: sqlserver
mode: dblib
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
# The specified database role being used to connect to PostgreSQL.
# To create additional roles in PostgreSQL see `$ createuser --help`.
# When left blank, PostgreSQL will use the default role. This is
# the same name as the operating system user running Rails.
#username: rails_api_auth_template
host: 10.41.82.73
port: 1433
database: BrittonWeb
username: BSTI
password: BSTIBOY
tds_version: 7.3
# The password associated with the PostgreSQL role (username).
#password:
vhcs:
adapter: sqlserver
mode: dblib
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
# Connect on a TCP socket. Omitted by default since the client uses a
# domain socket that doesn't need configuration. Windows does not have
# domain sockets, so uncomment these lines.
#host: localhost
host: "10.41.82.73"
port: 1433
database: VHCS_HIPAA
username: BSTI
password: BSTIBOY
database_tasks: false
tds_version: 7.3
# The TCP port the server listens on. Defaults to 5432.
# If your server runs on a different port number, change accordingly.
#port: 5432
baclight:
adapter: sqlserver
mode: dblib
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
# Schema search path. The server defaults to $user,public
#schema_search_path: myapp,sharedapp,public
host: "10.41.82.73"
port: 1433
database: Baclight
username: BSTI
password: BSTIBOY
database_tasks: false
tds_version: 7.3
# Minimum log levels, in increasing order:
# debug5, debug4, debug3, debug2, debug1,
# log, notice, warning, error, fatal, and panic
# Defaults to warning.
#min_messages: notice
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: rails_api_auth_template_test
# As with config/credentials.yml, you never want to store sensitive information,
# like your database password, in your source code. If your source code is
# ever seen by anyone, they now have access to your database.
#
# Instead, provide the password or a full connection URL as an environment
# variable when you boot the app. For example:
#
# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
#
# If the connection URL is provided in the special DATABASE_URL environment
# variable, Rails will automatically merge its configuration values on top of
# the values provided in this file. Alternatively, you can specify a connection
# URL environment variable explicitly:
#
# production:
# url: <%= ENV["MY_APP_DATABASE_URL"] %>
#
# Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
# for a full overview on how database connection configuration can be specified.
#
production:
<<: *default
database: rails_api_auth_template_production
username: rails_api_auth_template
password: <%= ENV["RAILS_API_AUTH_TEMPLATE_DATABASE_PASSWORD"] %>
heb_web:
adapter: sqlserver
mode: dblib
host: 10.41.82.73
port: 1433
database: HEBWeb
username: SA
password: Adm1nBb5
pool: 5
database_tasks: false
tds_version: 7.3
+2
View File
@@ -17,6 +17,8 @@ Rails.application.configure do
# Enable server timing.
config.server_timing = true
config.hosts << "web_api"
# Enable/disable caching. By default caching is disabled.
# Run rails dev:cache to toggle caching.
if Rails.root.join("tmp/caching-dev.txt").exist?
+3 -2
View File
@@ -7,10 +7,11 @@
Rails.application.config.middleware.insert_before 0, Rack::Cors do
allow do
origins "*"
origins 'http://localhost:3001'
resource "*",
headers: :any,
methods: [ :get, :post, :put, :patch, :delete, :options, :head ]
methods: [ :get, :post, :put, :patch, :delete, :options, :head ],
credentials: true
end
end
+11
View File
@@ -16,6 +16,17 @@ Devise.setup do |config|
# by default. You can change it below and use your own secret key.
# config.secret_key = '48e5fef13ecab7262e95624bd16f02e6a4ce11f2d44f1e18851e3e046535a6b6c233c94d1eb28e62655a12a63acb9ead3426ca1cb36753fa33f2970cd5377c3b'
config.jwt do |jwt|
jwt.secret = ENV['DEVISE_JWT_SECRET_KEY'] # Or Rails.application.credentials.devise_jwt_secret_key!
jwt.dispatch_requests = [
['POST', %r{^/login$}]
]
jwt.revocation_requests = [
['DELETE', %r{^/logout$}]
]
jwt.expiration_time = 30.minutes.to_i
end
# ==> Controller configuration
# Configure the parent class to the devise controllers.
# config.parent_controller = 'DeviseController'
@@ -4,5 +4,5 @@
# Use this to limit dissemination of sensitive information.
# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
Rails.application.config.filter_parameters += [
:passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
:secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
]
+45 -7
View File
@@ -1,7 +1,17 @@
Rails.application.routes.draw do
mount Rswag::Ui::Engine => "/api-docs"
mount Rswag::Api::Engine => "/api-docs"
devise_for :users, skip: [ :registrations, :passwords, :confirmations ]
devise_for :users,
path: '',
path_names: {
sign_in: 'signin',
sign_out: 'signout',
registration: 'signup'
},
controllers: {
sessions: 'users/sessions',
registrations: 'users/registrations'
}
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
# Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
@@ -10,16 +20,44 @@ Rails.application.routes.draw do
namespace :api do
namespace :v1 do
post "signup", to: "auth#signup"
post "login", to: "auth#login"
post "logout", to: "auth#logout"
post "refresh", to: "auth#refresh"
# post "signup", to: "auth#signup"
# post "login", to: "auth#login"
# post "logout", to: "auth#logout"
# post "refresh", to: "auth#refresh"
get "protected", to: "protected#index"
get "profile", to: "profile#show"
# get "protected", to: "protected#index"
# get "profile", to: "profile#show"
# admin routes
get "admin/dashboard", to: "admin#dashboard"
get 'id_cards/member_card/:id/:layout', to: 'id_cards#member_card'
get 'id_cards/member_benefits/:id', to: 'id_cards#member_benefits'
get 'id_cards/employer_cards/:id', to: 'id_cards#employer_cards'
get 'claims/member_claims/:id', to: 'claims#member_claims'
get 'network_provider/employer_network_provider/:id', to: 'network_provider#employer_network_provider'
resources :members do
member do
get 'initialize_dashboard'
get 'id_card/:layout', to: 'members#id_card'
get 'claims'
end
end
resources :employers do
member do
get 'initialize_dashboard'
get 'id_cards'
get 'members_list'
end
end
resources :brokers do
member do
get 'employers_list'
end
end
end
end
end