Skip to content

Commit

Permalink
Merge pull request #70 from lessonly/personal/Edwin/Fix/2024.07/LIC-3…
Browse files Browse the repository at this point in the history
…34_logs

LIC-334 - add logs
  • Loading branch information
Edwin-Feng authored Jul 16, 2024
2 parents 4c90204 + 00aee1c commit f6e659d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/controllers/scim_rails/scim_users_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module ScimRails
class ScimUsersController < ScimRails::ApplicationController
def index
Rails.logger.warn("ScimRails::ScimUsersController: index: request.original_url #{request.original_url} request.params: #{params.to_json}")
if params[:filter].present?
query = ScimRails::ScimQueryParser.new(params[:filter])

Expand All @@ -27,6 +28,7 @@ def index
end

def create
Rails.logger.warn("ScimRails::ScimUsersController: create: request.original_url #{request.original_url} request.params: #{params.to_json}")
if ScimRails.config.scim_user_prevent_update_on_create
user = @company.public_send(ScimRails.config.scim_users_scope).create!(permitted_user_params)
else
Expand All @@ -43,11 +45,13 @@ def create
end

def show
Rails.logger.warn("ScimRails::ScimUsersController: show: request.original_url #{request.original_url} request.params: #{params.to_json}")
user = @company.public_send(ScimRails.config.scim_users_scope).find(params[:id])
json_scim_response(object: user)
end

def put_update
Rails.logger.warn("ScimRails::ScimUsersController: put_update: request.original_url #{request.original_url} request.params: #{params.to_json}")
user = @company.public_send(ScimRails.config.scim_users_scope).find(params[:id])
update_status(user) unless put_active_param.nil?
user.update!(permitted_user_params)
Expand All @@ -57,6 +61,7 @@ def put_update
# TODO: PATCH will only deprovision or reprovision users.
# This will work just fine for Okta but is not SCIM compliant.
def patch_update
Rails.logger.warn("ScimRails::ScimUsersController: patch_update: request.original_url #{request.original_url} request.params: #{params.to_json}")
user = @company.public_send(ScimRails.config.scim_users_scope).find(params[:id])
update_status(user)
json_scim_response(object: user)
Expand Down

0 comments on commit f6e659d

Please sign in to comment.