DataSyncNamespace

DataSync PAM v3 namespaces and helpers.

ENTITIES, RELATIONSHIPS and MEMBERSHIPS appear literally as keys under the token's res/pat blocks, as siblings of chan/grp/uuid. USERS_PROJECTION and CHANNELS_PROJECTION do not: see their docs.

Properties

Link copied to clipboard

Namespace of DataSyncGrant.channel / DataSyncGrant.channelPattern. Like USERS_PROJECTION it is not a permission bucket: the permission bits go into the plain channels bucket (shared with pub/sub and App Context v2), and this string appears only as the prefix of the pn-projections composite key (datasync:channels:<id>).

Link copied to clipboard

The projection a resource uses when its DataSyncGrantType.projection is left unset. Pass this explicitly to a grant's projection when you want the entry written out rather than left implicit.

Link copied to clipboard
const val ENTITIES: String
Link copied to clipboard
const val MEMBERSHIPS: String
Link copied to clipboard

The meta key the DataSync backend reads per-resource projection assignments from.

Link copied to clipboard
Link copied to clipboard

Namespace of DataSyncGrant.user / DataSyncGrant.userPattern. It is not a permission bucket: the permission bits of those grants go into the plain users bucket, and this string appears only as the prefix of the pn-projections composite key (datasync:users:<id>) (server team, 2026-08-07). Note this contradicts the ADR examples, which key every projection under datasync:entities:<id>.

Functions

Link copied to clipboard
fun refChannel(id: String, projection: String? = null): String

Resolves the ref-channel a DataSync resource publishes its realtime events on. null, "default" and DEFAULT_PROJECTION resolve to the bare id; any other projection resolves to __{projection}__{id}.

Link copied to clipboard
fun refChannelPattern(pattern: String, projection: String? = null): String

Builds the PAM channel regex matching the ref-channels of every DataSync resource whose id matches pattern, as seen through projection (resolved like refChannel).