Class: Parse::CLPScope::CacheEntry

Inherits:
Struct
  • Object
show all
Defined in:
lib/parse/clp_scope.rb

Overview

Cache-entry shape. kind: is the disposition of the most recent schema-fetch attempt:

  • :cached_clp — schema fetch succeeded and returned a non-empty classLevelPermissions map. permits? evaluates against it.
  • :no_clp — schema fetch succeeded but the class has no CLP configured (or it's an empty hash). Parse Server treats this as public-default, so permits? returns true for all operations.
  • :unresolvable — schema fetch FAILED (network error, 5xx, unexpected exception, missing client). FAIL CLOSED: permits? returns false for every non-master query. Without this, a transient schema-endpoint outage would silently turn an admin-only class into public-readable for the duration of the outage — every mongo-direct caller was getting unfiltered rows because permits? returned true on entry.nil?.

fetched_at is a monotonic clock reading used by stale? so the SDK isn't fooled by NTP adjustments.

clp is nil for :no_clp and :unresolvable; readers must branch on kind before dereferencing.

Instance Attribute Summary collapse

Instance Attribute Details

#clpObject

Returns the value of attribute clp

Returns:

  • (Object)

    the current value of clp



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

def clp
  @clp
end

#fetched_atObject

Returns the value of attribute fetched_at

Returns:

  • (Object)

    the current value of fetched_at



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

def fetched_at
  @fetched_at
end

#kindObject

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



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

def kind
  @kind
end