Repository navigation
docs: add snippets for Access Manager categories - #261
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
techwritermat
requested review from
KGronek-Pubnub,
Xavrax and
parfeon
as code owners
October 23, 2026 09:40
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.
Summary
Adds docs snippets for the grant token category permissions (let a token list all channel metadata or all uuid metadata,
getonly, no resources needed). The repo had no snippet markers yet, so this adds a new small sample and uses the// snippet.name...// snippet.endformat.File:
core/samples/pubnub_sync_grant_token_categories_sample.cgrantTokenCategoriespubnub_grant_tokenwithperm_obj{"ttl":60, "uuid":..., "permissions":{"categories":{"channels":32, "uuids":32}}}and no resourcesparseTokenCategoriespubnub_parse_token, then reads thecatsection (chananduuid) withpbjson_get_object_valueand checks for32The sample is added to the sync OpenSSL example list in
CMakeLists.txt(next topubnub_sync_grant_token_sample, sameUSE_GRANT_TOKEN_APIcondition) and to the make targets (make/common/targets_app_openssl.mk,openssl/posix.mk,openssl/windows.mk).How verified
cmake -DOPENSSL=ON -DEXAMPLES=ON -DUSE_GRANT_TOKEN_API=1 -DUSE_CALLBACK_API=0 -DUSE_CRYPTO_API=1and built the new target and the existingpubnub_sync_grant_token_sample. Both build with no compiler warnings (-Wall, plus-Wextraon the new file).print_token_categoriesoffline in a scratch harness against a hand-built token withcat{chan: 32, uuid: 32}(prints both as yes) and against an existing token withoutcat(prints that there are no category permissions).🤖 Generated with Claude Code