Class: SSO::BasicWithHidden

Inherits:
Basic
  • Object
show all
Defined in:
app/services/sso/basic_with_hidden.rb

Instance Method Summary collapse

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)


3
4
5
6
# File 'app/services/sso/basic_with_hidden.rb', line 3

def available?
  authentication = Rack::Auth::Basic::Request.new(controller.request.env)
  Thread.current[:service_user_login] =  authentication.provided? && authentication.basic? && authentication.credentials.first =~ /virt_who_reporter_\d+/ && controller.api_request? && controller.is_a?(::Katello::Api::Rhsm::CandlepinProxiesController)
end

#current_userObject



8
9
10
# File 'app/services/sso/basic_with_hidden.rb', line 8

def current_user
  User.unscoped.where(:auth_source_id => ForemanVirtWhoConfigure::AuthSourceHiddenWithAuthentication.default.id).(self.user)
end