Skip to content

docs: add snippets for Access Manager categories - #261

Merged
techwritermat merged 1 commit into
masterfrom
docs-snippets
Oct 26, 2026
Merged

techwritermat merged 1 commit into
masterfrom
docs-snippets

Conversation

@techwritermat

Copy link
Copy Markdown
Contributor

Summary

Adds docs snippets for the grant token category permissions (let a token list all channel metadata or all uuid metadata, get only, no resources needed). The repo had no snippet markers yet, so this adds a new small sample and uses the // snippet.name ... // snippet.end format.

File: core/samples/pubnub_sync_grant_token_categories_sample.c

Snippet marker Content
grantTokenCategories pubnub_grant_token with perm_obj {"ttl":60, "uuid":..., "permissions":{"categories":{"channels":32, "uuids":32}}} and no resources
parseTokenCategories pubnub_parse_token, then reads the cat section (chan and uuid) with pbjson_get_object_value and checks for 32

The sample is added to the sync OpenSSL example list in CMakeLists.txt (next to pubnub_sync_grant_token_sample, same USE_GRANT_TOKEN_API condition) and to the make targets (make/common/targets_app_openssl.mk, openssl/posix.mk, openssl/windows.mk).

How verified

  • Configured with cmake -DOPENSSL=ON -DEXAMPLES=ON -DUSE_GRANT_TOKEN_API=1 -DUSE_CALLBACK_API=0 -DUSE_CRYPTO_API=1 and built the new target and the existing pubnub_sync_grant_token_sample. Both build with no compiler warnings (-Wall, plus -Wextra on the new file).
  • Ran print_token_categories offline in a scratch harness against a hand-built token with cat {chan: 32, uuid: 32} (prints both as yes) and against an existing token without cat (prints that there are no category permissions).
  • The make targets were not run, only the CMake build.
  • Not run live, no keyset available.

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@KGronek-Pubnub KGronek-Pubnub left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@techwritermat
techwritermat merged commit efcae08 into master Oct 26, 2026
8 checks passed
@techwritermat
techwritermat deleted the docs-snippets branch October 26, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants