core/sdk_event_schema_registry
library
Classes
-
EventAuditRecord
-
One SdkEventSchemaRegistry.validate call's outcome, kept in a
bounded history — same ring-buffer convention
MemoryWatchdog/RemoteKillSwitchController already use in this
package.
-
EventParamSchema
-
One declared param — pii means "this key, if present, is ALWAYS
stripped before the event reaches a real AnalyticsProvider," full
stop, independent of required/type (see EventSchema's
constructor for why a param can never be both
required and pii).
-
EventSchema
-
One event's contract — name, param shape, and how to handle an
unrecognized field. migrate upgrades an older client's raw params to
what THIS (current) schema version expects, applied before validation
— same "migrate on read" convention
VersionedJsonStore.migrate
already uses in this package, so an app that can't ship a client
update immediately still has its old-shaped events validated
correctly against the newest schema.
-
EventValidationResult
-
The outcome of validating one
logEvent call — sanitizedParams is
what's actually safe to forward to a real provider (empty when
accepted is false: a rejected event is never partially sent).
-
SchemaValidatedAnalyticsProvider
-
Decorator over a real AnalyticsProvider — validates every event
through registry first, forwarding only EventValidationResult.sanitizedParams
when accepted, dropping it silently otherwise (never partially, never
raw). Same decorator shape
ConsentGatedAnalyticsProvider already
uses, so it composes: SchemaValidatedAnalyticsProvider(ConsentGatedAnalyticsProvider(real), registry).
-
SdkEventSchemaRegistry
-
Validates event name/params against registered EventSchemas before
anything reaches a real AnalyticsProvider — default-deny at 2
levels: an unregistered event name is rejected outright, and a
registered event's own unknown/pii fields are handled per the
schema's own policy rather than passed through untouched.
Functions
-
eventSchemaAuditHealthCollector(SdkEventSchemaRegistry registry)
→ HealthCollectorSpec
-
Opt-in
SdkHealthReport (FEAT-39) section reporting recent event
validation activity — a consumer registers this itself, same reasoning
memoryWatchdogHealthCollector (FEAT-74) isn't part of
defaultHealthCollectors(): it needs a specific registry instance,
not a module a consumer either has or hasn't registered.