Class: FaspClient::ApplicationController

Inherits:
Object
  • Object
show all
Defined in:
app/controllers/fasp_client/application_controller.rb

Instance Method Summary collapse

Instance Method Details

#fasp_client_controller?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'app/controllers/fasp_client/application_controller.rb', line 7

def fasp_client_controller?
  true
end

#get_providerObject



11
12
13
14
15
16
# File 'app/controllers/fasp_client/application_controller.rb', line 11

def get_provider
  head :unauthorized and return unless request.headers.key?("Signature-Input")
  m = request.headers["Signature-Input"].match(/keyid=\"([^\"]+)\"/)
  @provider = FaspClient::Provider.find_by(uuid: m[1]) if m
  head :unauthorized if @provider.nil?
end

#verify_requestObject



18
19
20
# File 'app/controllers/fasp_client/application_controller.rb', line 18

def verify_request
  head :unauthorized unless @provider.valid_request?(request)
end