Skip to content

Implement PAM categories support - #139

Merged
jakub-grzesiowski merged 9 commits into
masterfrom
pam-categories
Oct 20, 2026
Merged

jakub-grzesiowski merged 9 commits into
masterfrom
pam-categories

Conversation

@jakub-grzesiowski

@jakub-grzesiowski jakub-grzesiowski commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

feat(grant): Added category permissions for listing all App Context metadata.

grantToken()->categories() and grant()->categories() grant the get permission on PNGrantCategory::CHANNELS, PNGrantCategory::UUIDS, or both. Keysets that restrict App Context listing only allow getAllChannelMetadata() and getAllUUIDMetadata() for clients holding these grants. parseToken() exposes the granted categories through getChannelsCategory() and getUuidsCategory(), and Grant results expose them through getCategories(). PAMv2 category grants require an auth key and accept only get(true) to grant or get(false) to revoke.

fix(parse-token): Fixed parseToken() decoding base64url tokens incorrectly, which could return wrong permissions, timestamps, resource names and signatures. getSignature() now returns the token's actual signature, so values stored from earlier versions may differ.

Every - or _ in a token flipped one bit of the decoded data. Authorization was not affected, because the server validates the raw token, but values read from parsed tokens could be wrong, for example full-access permissions read as 251 instead of 255, or timestamps off by up to about 18 hours. If you stored or compared getSignature() values, recompute them after upgrading.

fix(grant): Fixed isGetEnabled(), isUpdateEnabled() and isJoinEnabled() on channel, channel group and uuid entries of Grant and Audit results returning the manage permission.

fix(audit): Fixed audit() throwing a TypeError on every successful response instead of returning a PNAccessManagerAuditResult.

Comment thread examples/AccessManager.php Resolved
@jakub-grzesiowski

Copy link
Copy Markdown
Contributor Author

@pubnub-release-bot release as 10.1.0

@jakub-grzesiowski
jakub-grzesiowski merged commit 15d76a3 into master Oct 20, 2026
23 of 32 checks passed
@jakub-grzesiowski
jakub-grzesiowski deleted the pam-categories branch October 20, 2026 17:48
@pubnub-release-bot

Copy link
Copy Markdown
Contributor

🚀 Release successfully completed 🚀

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.

3 participants