Skip to content

Add PubSub member affiliation support#3445

Open
romanbsd wants to merge 1 commit into
igniterealtime:mainfrom
romanbsd:agent/pubsub-member-affiliation
Open

Add PubSub member affiliation support#3445
romanbsd wants to merge 1 commit into
igniterealtime:mainfrom
romanbsd:agent/pubsub-member-affiliation

Conversation

@romanbsd

@romanbsd romanbsd commented Jul 21, 2026

Copy link
Copy Markdown

Summary

  • add the standard PubSub member affiliation and support owner affiliation updates to it
  • restrict whitelist access to explicit member, publisher, or owner affiliations
  • prevent lingering none affiliation records from retaining whitelist access
  • add focused coverage for member access and stale none rejection

XEP references and rationale

XEP-0060: Publish-Subscribe defines the member affiliation and recommends support for non-required affiliations. Its whitelist access model specifies that an owner should add an entity to the whitelist by assigning the member affiliation. It also defines the corresponding service discovery feature as http://jabber.org/protocol/pubsub#member-affiliation.

XEP-0503: Server-side spaces builds on XEP-0060 and says that a Spaces service SHOULD implement and advertise member-affiliation for better usability.

Openfire previously had no member affiliation. Its whitelist implementation instead accepted every stored affiliation except outcast. A none affiliation record can remain after membership is removed, which caused that entity to continue being treated as whitelisted. Requiring an explicit member, publisher, or owner affiliation aligns whitelist membership with XEP-0060 and makes removal effective.

This core support lets consumers such as the Spaces plugin implement and advertise XEP-0503's member-affiliation recommendation truthfully.

Test plan

  • ./mvnw -pl xmppserver '-P!git-info' -Dtest=WhitelistAccessTest test -nsu
  • git diff --check upstream/main...HEAD

Whitelist access previously treated lingering none affiliations as authorized. Add the standard member affiliation and require an explicit member, publisher, or owner affiliation for whitelist access.
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b25a8579-8d75-47a3-b470-568987c4f41e

📥 Commits

Reviewing files that changed from the base of the PR and between 26dc082 and 01e4642.

📒 Files selected for processing (5)
  • xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/Node.java
  • xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/NodeAffiliate.java
  • xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/PubSubEngine.java
  • xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/models/WhitelistAccess.java
  • xmppserver/src/test/java/org/jivesoftware/openfire/pubsub/models/WhitelistAccessTest.java

📝 Walkthrough

Walkthrough

The pubsub affiliation model now defines member affiliations, exposes a Node.addMember method, and processes "member" affiliation updates. Whitelist subscription access now requires a member, publisher, or owner affiliation. New tests verify that members can subscribe and users with a none affiliation cannot.

Suggested reviewers: guusdk

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly matches the changes to member affiliations, whitelist access, and added test coverage.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@romanbsd
romanbsd marked this pull request as ready for review July 21, 2026 10:11
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.

1 participant