Class: SignIn::ServiceAccountConfigsController
- Inherits:
-
ServiceAccountApplicationController
- Object
- ActionController::API
- ServiceAccountApplicationController
- SignIn::ServiceAccountConfigsController
- Defined in:
- app/controllers/sign_in/service_account_configs_controller.rb
Constant Summary
Constants included from ExceptionHandling
ExceptionHandling::SKIP_SENTRY_EXCEPTION_TYPES
Constants included from ServiceAccountAuthentication
SignIn::ServiceAccountAuthentication::BEARER_PATTERN
Constants included from Authentication
Authentication::BEARER_PATTERN
Instance Attribute Summary
Attributes inherited from ServiceAccountApplicationController
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #index ⇒ Object
- #not_found ⇒ Object private
- #service_account_config_params ⇒ Object private
- #set_service_account_config ⇒ Object private
- #show ⇒ Object
- #update ⇒ Object
Methods included from Traceable
Methods included from SentryControllerLogging
#set_tags_and_extra_context, #tags_context, #user_context
Methods included from SentryLogging
#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger, #set_sentry_metadata
Methods included from Headers
Methods included from ExceptionHandling
#render_errors, #report_mapped_exception, #report_original_exception, #skip_sentry_exception?, #skip_sentry_exception_types
Methods included from ServiceAccountAuthentication
#authenticate_service_account, #authenticate_service_account_access_token, #bearer_token, #handle_authenticate_error, #validate_requested_scope
Methods included from Authentication
#access_token, #access_token_authenticate, #authenticate, #authenticate_access_token, #bearer_token, #cookie_access_token, #handle_authenticate_error, #load_user, #load_user_object, #scrub_bearer_token, #validate_request_ip
Instance Method Details
#create ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/sign_in/service_account_configs_controller.rb', line 19 def create service_account_config = ServiceAccountConfig.new(service_account_config_params) if service_account_config.save render json: service_account_config, status: :created else render json: { errors: service_account_config.errors }, status: :unprocessable_entity end end |
#destroy ⇒ Object
37 38 39 40 41 42 43 |
# File 'app/controllers/sign_in/service_account_configs_controller.rb', line 37 def destroy if @service_account_config.destroy head :no_content else render json: { errors: @service_account_config.errors }, status: :unprocessable_entity end end |
#index ⇒ Object
9 10 11 12 13 |
# File 'app/controllers/sign_in/service_account_configs_controller.rb', line 9 def index service_account_configs = ServiceAccountConfig.where(service_account_id: params[:service_account_ids]) render json: service_account_configs, status: :ok end |
#not_found ⇒ Object (private)
61 62 63 |
# File 'app/controllers/sign_in/service_account_configs_controller.rb', line 61 def not_found render json: { errors: { service_account_config: ['not found'] } }, status: :not_found end |
#service_account_config_params ⇒ Object (private)
47 48 49 50 51 52 53 54 55 |
# File 'app/controllers/sign_in/service_account_configs_controller.rb', line 47 def service_account_config_params params.require(:service_account_config).permit(:service_account_id, :description, :access_token_audience, :access_token_duration, scopes: [], certificates: [], access_token_user_attributes: []) end |
#set_service_account_config ⇒ Object (private)
57 58 59 |
# File 'app/controllers/sign_in/service_account_configs_controller.rb', line 57 def set_service_account_config @service_account_config = ServiceAccountConfig.find_by!(service_account_id: params[:service_account_id]) end |
#show ⇒ Object
15 16 17 |
# File 'app/controllers/sign_in/service_account_configs_controller.rb', line 15 def show render json: @service_account_config, status: :ok end |
#update ⇒ Object
29 30 31 32 33 34 35 |
# File 'app/controllers/sign_in/service_account_configs_controller.rb', line 29 def update if @service_account_config.update(service_account_config_params) render json: @service_account_config, status: :ok else render json: { errors: @service_account_config.errors }, status: :unprocessable_entity end end |