Commit 1fb9cb2
Changed files (22)
app
controllers
scim
config
environments
initializers
app/controllers/scim/v2/users_controller.rb
@@ -39,8 +39,8 @@ module Scim
params.permit(:schemas, :userName)
end
- def repository
- $container.resolve(:user_repository)
+ def repository(container = Spank::IOC)
+ container.resolve(:user_repository)
end
end
end
config/environments/development.rb
@@ -1,5 +1,9 @@
+# frozen_string_literal: true
+
Rails.application.configure do
- config.webpacker.check_yarn_integrity = true # Settings specified here will take precedence over those in config/application.rb.
+ # Settings specified here will take precedence over those in
+ # config/application.rb
+ config.webpacker.check_yarn_integrity = true
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
config/environments/production.rb
@@ -1,5 +1,9 @@
+# frozen_string_literal: true
+
Rails.application.configure do
- config.webpacker.check_yarn_integrity = false # Settings specified here will take precedence over those in config/application.rb.
+ # Settings specified here will take precedence over those in
+ # config/application.rb
+ config.webpacker.check_yarn_integrity = false
# Code is not reloaded between requests.
config.cache_classes = true
@@ -30,7 +34,8 @@ Rails.application.configure do
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
- # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
+ # `config.assets.precompile` and `config.assets.version`
+ # have moved to config/initializers/assets.rb
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = 'http://assets.example.com'
@@ -42,9 +47,11 @@ Rails.application.configure do
# Mount Action Cable outside main process or domain
# config.action_cable.mount_path = nil
# config.action_cable.url = 'wss://example.com/cable'
- # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
+ # config.action_cable.allowed_request_origins =
+ # [ 'http://example.com', /http:\/\/example.*/ ]
- # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
+ # Force all access to the app over SSL, use Strict-Transport-Security,
+ # and use secure cookies.
# config.force_ssl = true
# Use the lowest log level to ensure availability of diagnostic information
@@ -52,18 +59,20 @@ Rails.application.configure do
config.log_level = :debug
# Prepend all log lines with the following tags.
- config.log_tags = [ :request_id ]
+ config.log_tags = [:request_id]
# Use a different cache store in production.
# config.cache_store = :mem_cache_store
- # Use a real queuing backend for Active Job (and separate queues per environment)
+ # Use a real queuing backend for Active Job
+ # (and separate queues per environment)
# config.active_job.queue_adapter = :resque
# config.active_job.queue_name_prefix = "proof_#{Rails.env}"
config.action_mailer.perform_caching = false
# Ignore bad email addresses and do not raise email delivery errors.
- # Set this to true and configure the email server for immediate delivery to raise delivery errors.
+ # Set this to true and configure the email server for immediate
+ # delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
@@ -78,7 +87,8 @@ Rails.application.configure do
# Use a different logger for distributed setups.
# require 'syslog/logger'
- # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
+ # config.logger =
+ # ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
if ENV["RAILS_LOG_TO_STDOUT"].present?
logger = ActiveSupport::Logger.new(STDOUT)
config/environments/test.rb
@@ -1,5 +1,8 @@
+# frozen_string_literal: true
+
Rails.application.configure do
- # Settings specified here will take precedence over those in config/application.rb.
+ # Settings specified here will take precedence over those
+ # in config/application.rb.
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
config/initializers/application_controller_renderer.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# ActiveSupport::Reloader.to_prepare do
config/initializers/assets.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Be sure to restart your server when you modify this file.
# Version of your assets, change this if you want to expire all your assets.
config/initializers/backtrace_silencers.rb
@@ -1,7 +1,10 @@
+# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
-# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
+# You can add backtrace silencers for libraries that you're using
+# but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
-# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
+# You can also remove all the silencers if you're trying to debug
+# a problem that might stem from framework code.
# Rails.backtrace_cleaner.remove_silencers!
config/initializers/filter_parameter_logging.rb
@@ -1,4 +1,12 @@
+# frozen_string_literal: true
+
# Be sure to restart your server when you modify this file.
# Configure sensitive parameters which will be filtered from the log file.
-Rails.application.config.filter_parameters += [:password, :authenticity_token, 'SAMLResponse', 'SAMLRequest', 'RelayState']
+Rails.application.config.filter_parameters += [
+ :RelayState,
+ :SAMLRequest,
+ :SAMLResponse,
+ :authenticity_token,
+ :password,
+]
config/initializers/inflections.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format. Inflections
config/initializers/jwt.rb
@@ -1,1 +1,3 @@
+# frozen_string_literal: true
+
Rails.application.config.x.jwt.private_key = OpenSSL::PKey::RSA.new(2048)
config/initializers/mime_types.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
config/initializers/saml_kit.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class OnDemandRegistry < SimpleDelegator
def metadata_for(entity_id)
found = __getobj__.metadata_for(entity_id)
config/initializers/session_store.rb
@@ -1,1 +1,3 @@
+# frozen_string_literal: true
+
Rails.application.config.session_store :active_record_store, key: "_proof"
config/initializers/spank.rb
@@ -1,10 +1,14 @@
-$container=Spank::Container.new
-$container.register(:user_repository) do |container|
- UserRepository.new(container.resolve(:user_mapper))
+# frozen_string_literal: true
+
+container = Spank::Container.new
+container.register(:user_repository) do |x|
+ UserRepository.new(x.resolve(:user_mapper))
end.as_singleton
-$container.register(:user_mapper) do |container|
- UserMapper.new(container.resolve(:url_helpers))
+container.register(:user_mapper) do |x|
+ UserMapper.new(x.resolve(:url_helpers))
end.as_singleton
-$container.register(:url_helpers) do |container|
+container.register(:url_helpers) do |_container|
Rails.application.routes.url_helpers
end
+
+Spank::IOC.bind_to(container)
config/initializers/wrap_parameters.rb
@@ -1,9 +1,12 @@
+# frozen_string_literal: true
+
# Be sure to restart your server when you modify this file.
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.
-# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
+# Enable parameter wrapping for JSON.
+# You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do
wrap_parameters format: [:json]
end
config/application.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require_relative 'boot'
require 'rails/all'
@@ -11,7 +13,8 @@ module Proof
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 5.1
- # Settings in config/environments/* take precedence over those specified here.
+ # Settings in config/environments/* take precedence over those specified
+ # here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
end
config/boot.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
require 'bundler/setup' # Set up gems listed in the Gemfile.
config/environment.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Load the Rails application.
require_relative 'application'
config/puma.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
# Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers: a minimum and maximum.
# Any libraries that use thread pools should be configured to match
@@ -7,8 +9,7 @@
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
threads threads_count, threads_count
-# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
-#
+# Specifies the `port` that Puma will listen on to receive requests
port ENV.fetch("PORT") { 3000 }
# Specifies the `environment` that Puma will run in.
@@ -51,6 +52,5 @@ on_worker_boot do
ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
end
-
# Allow puma to be restarted by `rails restart` command.
plugin :tmp_restart
config/spring.rb
@@ -1,6 +1,8 @@
-%w(
+# frozen_string_literal: true
+
+%w[
.ruby-version
.rbenv-vars
tmp/restart.txt
tmp/caching-dev.txt
-).each { |path| Spring.watch(path) }
+].each { |path| Spring.watch(path) }
.rubocop.yml
@@ -5,7 +5,7 @@ AllCops:
2.5
Exclude:
- 'bin/**/*'
- - 'config/**/*'
+ - 'config/routes.rb'
- 'db/schema.rb'
- 'db/seeds.rb'
- 'node_modules/**/*'