Repository navigation
feat(access): add categories permissions and fix subscribe deadlocks - #197
Merged
parfeon merged 9 commits intoOct 22, 2026
Merged
Conversation
Add `ChannelsCategoryPermission` and `UuidsCategoryPermission`, the `categories` option for `grant_token`, and parsing of category permissions in `parse_token`. Parsed token `resources` and `patterns` are optional now. fix(subscribe): fix `DataStream` and dispatcher deadlocks Fix `DataStream` deadlock between `push_data` and `poll_next` which took `queue` and `waker` locks in opposite order, and `EventDispatcher` deadlock between stream creation and `invalidate`. refactor(client): remove redundant `format!` references Remove redundant references in `format!` arguments of `PubNubClientInstance`, access and presence request builders. build(cargo): update manifest and dev dependencies Add `keywords`, enable `access` feature by default, update `wiremock` and `cucumber`, and register the `integration` test target. docs(readme): update PubNub Rust SDK header Update `README.md` PubNub Rust SDK header. test(access): cover category grants and token parsing Add unit and integration tests for categories-only grants, all permission kinds, token parsing and malformed tokens. test(subscribe): cover stream lock order and wake-ups Add tests for `DataStream` and `EventDispatcher` lock ordering, listener wake-ups and delivery of dispatched batches.
parfeon
requested review from
Xavrax,
kazydek and
techwritermat
as code owners
October 13, 2026 07:15
Up to standards ✅🟢 Issues
|
| Category | Results |
|---|---|
| Complexity | 1 medium |
🟢 Metrics 98 complexity · 185 duplication
Metric Results Complexity 98 Duplication 185
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Xavrax
approved these changes
Oct 13, 2026
Gate `data_stream`, request helpers and `blocking` import so narrow feature builds compile. refactor(parse_token): decouple parse_token from access feature Move permission bits to `permission_bits` in core utils. `parse_token` builds without `access`. `access` re-exports the bits. refactor: address issues reported by PR reviewer docs(readme): standardize README to SDK template
Allow `Permission` implementations to be shared across threads. refactor(publish): add custom message type Replace `r#type` with `custom_message_type` publish setter sent as `custom_message_type` query param. Received `Message` exposes the same field, and examples and docs use the new name. refactor(subscribe): skip unknown and malformed entries Unknown `e` values and malformed envelopes are skipped instead of failing the whole subscribe response. Payload is picked by event type first, then by `-pnpres` channel suffix. refactor(publish): remove `space_id` from publish Publish has no `space_id` parameter, so builder setter, `space-id` query param and `space_id` field on received messages are removed. build(deps): move reqwest to 0.13 with rustls Update reqwest in dependencies and dev-dependencies and switch to rustls TLS backend. test(subscribe): cover envelope parsing rules Cover type-first classification, presence channel suffix, unknown event types, malformed entries and message action `added` and `removed` events.
Xavrax
approved these changes
Oct 22, 2026
Xavrax
left a comment
Contributor
There was a problem hiding this comment.
Few findings, overall LGTM
Repeated category entries are combined with bitwise OR and logged as a warning, instead of overwriting the previous value. Categories passed to `resources` or `patterns` are logged as an error and omitted from the payload.
Contributor
Author
|
@pubnub-release-bot release |
parfeon
deleted the
docs/CLEN-3779-CLEN-3758-CLEN-3339-readme-categories-abba
branch
October 22, 2026 18:25
|
🚀 Release successfully completed 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(access): add categories permissions to grant token
Add
ChannelsCategoryPermissionandUuidsCategoryPermission, thecategoriesoption forgrant_token, and parsing of category permissions inparse_token. Parsed tokenresourcesandpatternsare optional now.feat(access): make Permission
SendandSyncAllow
Permissionimplementations to be shared across threads.Closes #188
fix(subscribe): fix
DataStreamand dispatcher deadlocksFix
DataStreamdeadlock betweenpush_dataandpoll_nextwhich tookqueueandwakerlocksin opposite order, and
EventDispatcherdeadlock between stream creation andinvalidate.refactor(client): remove redundant
format!referencesRemove redundant references in
format!arguments ofPubNubClientInstance, access and presencerequest builders.
refactor(publish): add custom message type
Replace
r#typewithcustom_message_typepublish setter sent ascustom_message_typequery param.Received
Messageexposes the same field, and examples and docs use the new name.Closes #190
refactor(subscribe): skip unknown and malformed entries
Unknown
evalues and malformed envelopes are skipped instead of failing the whole subscriberesponse. Payload is picked by event type first, then by
-pnpreschannel suffix.build(cargo): update manifest and dev dependencies
Add
keywords, enableaccessfeature by default, updatewiremockandcucumber, and registerthe
integrationtest target.docs(readme): update PubNub Rust SDK header
Update
README.mdPubNub Rust SDK header.test(access): cover category grants and token parsing
Add unit and integration tests for categories-only grants, all permission kinds, token parsing and
malformed tokens.
test(subscribe): cover stream lock order and wake-ups
Add tests for
DataStreamandEventDispatcherlock ordering, listener wake-ups and delivery ofdispatched batches.
test(subscribe): cover envelope parsing rules
Cover type-first classification, presence channel suffix, unknown event types, malformed
entries and message action
addedandremovedevents.