module JunglePath::API::Helpers::Auth

Public Instance Methods

authenticate(auth_provider, data_provider, no_cache=false) click to toggle source
# File lib/jungle_path/api/helpers/auth.rb, line 6
def authenticate auth_provider, data_provider, no_cache=false
        puts "Auth.authenticate"
        #data_provider = JunglePath::Authentication::DataProvider::Default.new unless data_provider
        #auth_provider = JunglePath::Authentication::AuthProvider::Default.new unless auth_provider
        @current_identity = auth_provider.authenticate(request, data_provider, no_cache)
        halt 401 unless @current_identity and @current_identity.valid?
        request.body.rewind
end
current_auth() click to toggle source
# File lib/jungle_path/api/helpers/auth.rb, line 31
def current_auth
        @current_identity and @current_identity.authorization_filter
end
current_identity() click to toggle source
# File lib/jungle_path/api/helpers/auth.rb, line 15
def current_identity
        @current_identity
end
current_key() click to toggle source
# File lib/jungle_path/api/helpers/auth.rb, line 23
def current_key
        @current_identity and @current_identity.key
end
current_query_filters() click to toggle source
# File lib/jungle_path/api/helpers/auth.rb, line 35
def current_query_filters
        @current_identity and @current_identity.query_filters
end
current_role() click to toggle source
# File lib/jungle_path/api/helpers/auth.rb, line 27
def current_role
        @current_identity and @current_identity.role
end
current_user() click to toggle source
# File lib/jungle_path/api/helpers/auth.rb, line 19
def current_user
        @current_identity and @current_identity.user
end