class PhobosCheckpointUI::StaticApp

Constants

NO_AUTH
SESSION_KEY

Attributes

configs[RW]

Public Class Methods

new(app = nil, saml_handler = SamlHandler) { |self| ... } click to toggle source
Calls superclass method
# File lib/phobos_checkpoint_ui/static_app.rb, line 7
def initialize(app = nil, saml_handler = SamlHandler)
  super()
  @app = app
  @saml_handler = saml_handler
  @template_cache = Tilt::Cache.new
  yield self if block_given?
end

Private Instance Methods

api_request?() click to toggle source
# File lib/phobos_checkpoint_ui/static_app.rb, line 103
def api_request?
  !!(request.path_info =~ %r{^/api})
end
no_auth_path?() click to toggle source
# File lib/phobos_checkpoint_ui/static_app.rb, line 99
def no_auth_path?
  NO_AUTH.include?(request.path)
end
omniauth_data() click to toggle source
# File lib/phobos_checkpoint_ui/static_app.rb, line 126
def omniauth_data
  request.env['omniauth.auth']
end
reply_forbidden() click to toggle source
# File lib/phobos_checkpoint_ui/static_app.rb, line 112
def reply_forbidden
  content_type :json
  halt 403, { error: 'Forbidden' }.to_json
end
reply_redirect_to_login() click to toggle source
# File lib/phobos_checkpoint_ui/static_app.rb, line 117
def reply_redirect_to_login
  cookies[:origin] = request.fullpath
  redirect to('/auth/saml')
end
reply_unauthorized() click to toggle source
# File lib/phobos_checkpoint_ui/static_app.rb, line 107
def reply_unauthorized
  content_type :json
  halt 401, { error: 'Unauthorized' }.to_json
end
signed_in?() click to toggle source
# File lib/phobos_checkpoint_ui/static_app.rb, line 122
def signed_in?
  !session[:user].nil?
end