Class: SignIn::ClientConfigsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/sign_in/client_configs_controller.rb

Constant Summary

Constants included from ExceptionHandling

ExceptionHandling::SKIP_SENTRY_EXCEPTION_TYPES

Constants included from Authentication

Authentication::BEARER_PATTERN

Instance Method Summary collapse

Methods inherited from ApplicationController

#cors_preflight

Methods included from Traceable

#set_trace_tags

Methods included from SentryLogging

#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger

Methods included from Headers

#block_unknown_hosts, #set_app_info_headers

Methods included from Authentication

#authenticate, #authenticate_service_account, #load_user

Instance Method Details

#createObject



20
21
22
23
24
25
26
27
28
# File 'app/controllers/sign_in/client_configs_controller.rb', line 20

def create
  client_config = SignIn::ClientConfig.new(client_config_params)

  if client_config.save
    render json: client_config, status: :created
  else
    render json: client_config.errors, status: :unprocessable_entity
  end
end

#destroyObject



38
39
40
41
42
43
44
# File 'app/controllers/sign_in/client_configs_controller.rb', line 38

def destroy
  if @client_config.destroy
    head :no_content
  else
    render json: @client_config.errors, status: :unprocessable_entity
  end
end

#indexObject



10
11
12
13
14
# File 'app/controllers/sign_in/client_configs_controller.rb', line 10

def index
  client_configs = SignIn::ClientConfig.where(client_id: params[:client_ids])

  render json: client_configs, status: :ok
end

#showObject



16
17
18
# File 'app/controllers/sign_in/client_configs_controller.rb', line 16

def show
  render json: @client_config, status: :ok
end

#updateObject



30
31
32
33
34
35
36
# File 'app/controllers/sign_in/client_configs_controller.rb', line 30

def update
  if @client_config.update(client_config_params)
    render json: @client_config, status: :ok
  else
    render json: @client_config.errors, status: :unprocessable_entity
  end
end