Module: Parse::AtlasSearch::Session

Defined in:
lib/parse/atlas_search/session.rb

Overview

Compatibility shim over Parse::Authorization.

This module used to own session-token resolution, role-closure expansion, and both caches. It no longer does. Deciding who a caller is and what they may read is authorization infrastructure that Atlas Search consumes, not infrastructure Atlas Search owns, and the old arrangement meant Parse::Query#results_direct on a query with no $search in it went through Parse::ACLScope into this namespace to find out who was asking. See Parse::Authorization for the reasoning and for the real implementation.

Everything here now delegates to the default client's authorization context. That is the one behavior difference worth knowing: these methods take no client:, so they can only ever address Parse.client. Code running against a secondary application should call other_client.authorization directly.

Slated for removal in 6.0.

Constant Summary collapse

InvalidSession =
Deprecated.

Use Parse::Authorization::InvalidSession. Kept as the same object rather than a subclass so existing rescue Parse::AtlasSearch::Session::InvalidSession clauses still catch what the resolver actually raises.

Parse::Authorization::InvalidSession
MemoryCache =
Parse::Authorization::MemoryCache
Resolved =
Parse::Authorization::Resolved

Class Method Summary collapse

Class Method Details

.invalidate(session_token) ⇒ Object

Deprecated.

Use client.authorization.invalidate(token). Note that Parse::Cache::Invalidation now does this automatically from the _Session after_logout trigger, so an application no longer has to remember to call it from its own logout path.



53
54
55
# File 'lib/parse/atlas_search/session.rb', line 53

def invalidate(session_token)
  context.invalidate(session_token)
end

.invalidate_user_roles(user_id) ⇒ Object

Deprecated.

Use client.authorization.invalidate_user_roles(id).



58
59
60
# File 'lib/parse/atlas_search/session.rb', line 58

def invalidate_user_roles(user_id)
  context.invalidate_user_roles(user_id)
end

.reset_caches!Object

Deprecated.

Use client.authorization.reset_caches!.



63
64
65
# File 'lib/parse/atlas_search/session.rb', line 63

def reset_caches!
  context.reset_caches!
end

.resolve(session_token) ⇒ Parse::Authorization::Resolved

Deprecated.

Use client.authorization.resolve(token), or Parse::Authorization.resolve with an explicit client:.



45
46
47
# File 'lib/parse/atlas_search/session.rb', line 45

def resolve(session_token)
  context.resolve(session_token)
end