Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure load paths of controllers and models #106

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,6 @@ Scimitar.engine_configuration = Scimitar::EngineConfiguration.new({

When it comes to token access, Scimitar neither enforces nor presumes any kind of encoding for bearer tokens. You can use anything you like, including encoding/encrypting JWTs if you so wish - https://rubygems.org/gems/jwt may be useful. The way in which a client might integrate with your SCIM service varies by client and you will have to check documentation to see how a token gets conveyed to that client in the first place (e.g. a full OAuth flow with your application, or just a static token generated in some UI which an administrator copies and pastes into their client's SCIM configuration UI).

**Important:** Under Rails 7 or later, you may need to wrap any Scimitar configuration with `Rails.application.config.to_prepare do...` to avoid `NameError: uninitialized constant...` exceptions arising due to autoloader problems:

```ruby
Rails.application.config.to_prepare do
Scimitar.engine_configuration = Scimitar::EngineConfiguration.new({
# ...
end
end
```

### Routes

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
require_dependency "scimitar/application_controller"

module Scimitar

# An ActiveRecord-centric subclass of Scimitar::ResourcesController. See that
Expand All @@ -19,7 +17,7 @@ module Scimitar
#
class ActiveRecordBackedResourcesController < ResourcesController

rescue_from ActiveRecord::RecordNotFound, with: :handle_resource_not_found # See Scimitar::ApplicationController
rescue_from 'ActiveRecord::RecordNotFound', with: :handle_resource_not_found # See Scimitar::ApplicationController

before_action :obtain_id_column_name_from_attribute_map

Expand Down
2 changes: 0 additions & 2 deletions app/controllers/scimitar/resource_types_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
require_dependency "scimitar/application_controller"

module Scimitar
class ResourceTypesController < ApplicationController
def index
Expand Down
2 changes: 0 additions & 2 deletions app/controllers/scimitar/resources_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
require_dependency "scimitar/application_controller"

module Scimitar

# A Rails controller which is mostly idiomatic, with #index, #show, #create
Expand Down
2 changes: 0 additions & 2 deletions app/controllers/scimitar/schemas_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
require_dependency "scimitar/application_controller"

module Scimitar
class SchemasController < ApplicationController
def index
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require_dependency "scimitar/application_controller"
module Scimitar
class ServiceProviderConfigurationsController < ApplicationController
def show
Expand Down
8 changes: 7 additions & 1 deletion lib/scimitar/engine.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
require 'rails/engine'

module Scimitar
class Engine < ::Rails::Engine
class Engine < Rails::Engine
isolate_namespace Scimitar
config.autoload_once_paths = %W(
#{root}/app/controllers
#{root}/app/models
)

Mime::Type.register 'application/scim+json', :scim

Expand Down
Loading