module Omniauth::HubAz::Mixins::ControllerHelper

Private Instance Methods

hub_az_jwt_token() click to toggle source
# File lib/omniauth/hub_az/hub_az/mixins/controller_helper.rb, line 22
def hub_az_jwt_token
  return @hub_az_jwt_token if defined?(@hub_az_jwt_token)

  @hub_az_jwt_token = request.headers['Authorization'].to_s.split(' ').last
end
hub_az_token() click to toggle source
# File lib/omniauth/hub_az/hub_az/mixins/controller_helper.rb, line 16
def hub_az_token
  return @hub_az_token if defined?(@hub_az_token)

  @hub_az_token = Omniauth::HubAz::Token.verify!(hub_az_jwt_token)
end
hub_az_token_requires_role!(role) click to toggle source
# File lib/omniauth/hub_az/hub_az/mixins/controller_helper.rb, line 8
def hub_az_token_requires_role!(role)
  head 401 unless (hub_az_token.valid? && hub_az_token.has_role?(role))
end
valid_hub_az_token_required!() click to toggle source
# File lib/omniauth/hub_az/hub_az/mixins/controller_helper.rb, line 12
def valid_hub_az_token_required!
  head 401 unless hub_az_token.valid?
end