Pubsub subscribe using full JID?

Submitted by Anonymous on Wed, 2009-07-01 18:49

It seems that Tigase Pubsub converts all pubsub subscriptions to bare JID. If I try to subscribe user@domain/resource to a pubsub node, the resource is striped and the subscriber is stored in the database as user@domain. Is this by design? I have a legitimate use-case when I need full-JID subscriptions. They are also required by XEP-60 (p. 6.1.1).

bmalkow's picture

You may start in

You may start in tigase.pubsub.repository.NodeSubscriptions.addSubscriberJid()
and other methods in this class.

You should check if methods does receives full jid (maybe pubsub makes bareJid before it calls methods from NodeSubscriptions)

Feel free to contact me directly.

--
Bartosz Małkowski

How dependant is the current

How dependant is the current architecture/implementation on bare-JID-only subscriptions? And how hard do you think it would be to make it support full-JIDs? I may try to implement it, but any pointers would be helpful :) (like where to start, any gotchas to be aware of, etc.)

bmalkow's picture

PubSub allows subscribing by

PubSub allows subscribing by bareJID only. I don't see anything in XEP what force me to implement fullJID subscribing. ;-)

When I implemented XEP-0060 customer doesn't needs fullJID, but performance. Thats why PubSub hasn't implented full jid - for simplify of implementation.

--
Bartosz Małkowski

It's an implicit requirement

It's an implicit requirement to record the full JID. Otherwise it's impossible to implement e.g. 6.2.1 (unsubscribing) correctly. Not to mention that notifications will probably be sent to the wrong resources.

dayu's picture

In 6.1.1, it mentions that

In 6.1.1, it mentions that the subscriber can be a full jid. But it does not require the server to record the full jid. As long as the server compares the bare jid part which is the minimum requirement, it does not violate that section.

It is something nice to add though.

Dayu, this section has

Dayu, this section has nothing to do with whether full-JID subscriptions are required. It only establishes that a regular user can't subscribe other users - which of course is done by comparing the bare JIDs.

dayu's picture

I don't think it is

I don't think it is required. The following section indicates only bare JID comparison is required.

In 6.1.3.1 JIDs Do Not Match

If the specified JID is a bare JID or full JID, the service MUST at a minimum check the bare JID portion against the bare JID portion of the 'from' attribute on the received IQ request to make sure that the requesting entity has the same identity as the JID which is being requested to be added to the subscriber list.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Post new comment

The content of this field is kept private and will not be shown publicly.