Class: Sts::TermsOfUseController

Inherits:
SignIn::ServiceAccountApplicationController show all
Defined in:
app/controllers/sts/terms_of_use_controller.rb

Constant Summary

Constants included from ExceptionHandling

ExceptionHandling::SKIP_SENTRY_EXCEPTION_TYPES

Constants included from SignIn::ServiceAccountAuthentication

SignIn::ServiceAccountAuthentication::BEARER_PATTERN

Constants included from SignIn::Authentication

SignIn::Authentication::BEARER_PATTERN

Instance Attribute Summary

Attributes inherited from SignIn::ServiceAccountApplicationController

#current_user

Instance Method Summary collapse

Methods included from Traceable

#set_trace_tags

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

#set_app_info_headers

Methods included from ExceptionHandling

#render_errors, #report_mapped_exception, #report_original_exception, #skip_sentry_exception?, #skip_sentry_exception_types

Methods included from SignIn::ServiceAccountAuthentication

#authenticate_service_account, #authenticate_service_account_access_token, #bearer_token, #handle_authenticate_error, #validate_requested_scope

Methods included from SignIn::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

#current_statusObject



8
9
10
11
# File 'app/controllers/sts/terms_of_use_controller.rb', line 8

def current_status
  Rails.logger.info('[Sts][TermsOfUseController] current_status success', icn:)
  render json: { agreement_status: @current_terms_of_use_agreement&.response }, status: :ok
end

#icnObject (private)



21
22
23
# File 'app/controllers/sts/terms_of_use_controller.rb', line 21

def icn
  @service_account_access_token.user_attributes['icn']
end

#set_current_terms_of_use_agreementObject (private)



15
16
17
18
19
# File 'app/controllers/sts/terms_of_use_controller.rb', line 15

def set_current_terms_of_use_agreement
  @current_terms_of_use_agreement = TermsOfUseAgreement.joins(:user_account)
                                                       .where(user_account: { icn: })
                                                       .current.last
end