fahim fahad fahim
fahim fahad fahim

Reputation: 11

How to configure a xmpp pubsub leafnode so that anyone can publish or update item there?

The user romeo@host creates a LeafNode 0c55624367fc10d2548c569782f569dc:downline by this configuration:

("pubsub#deliver_payloads", "true")

("pubsub#notify_config", "false")

("pubsub#notify_delete", "false")

("pubsub#notify_retract", "false")

("pubsub#purge_offline", "false")

("pubsub#persist_items", "true")

("pubsub#publish_model", "open")

("pubsub#max_items", "50")

("pubsub#subscribe", "false")

("pubsub#access_model", "open")

("pubsub#send_last_published_item", "never")

("pubsub#deliver_notifications", "false")

Creates an item like this:

<item id='downline'>
  <downline xmlns='pubsub:mecloak:users:downline'>
    <downline>
      {&quot;users&quot;:[{&quot;username&quot;:&quot;do hdhddkd&quot;,&quot;userphone&quot;:&quot;+8801111111147&quot;}]}
    </downline>
  </downline>
</item>

User juliet@host tries to update/publish in the same node in this way:

<iq to='pubsub.192.168.0.100' id='1P42B-58' type='set'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <publish node='0c55624367fc10d2548c569782f569dc:downline'>
      <item id='downline'>
        <downline xmlns='pubsub:mecloak:users:downline'>
          <downline xmlns='pubsub:mecloak:users:downline'>
            {"users":[{"username":"chhy","userphone":"+8801111111147"},{"username":"do hdhddkd","userphone":"+8801111111147"}]}
          </downline>
        </downline>
      </item>
    </publish>
  </pubsub>
</iq>

But juliet is getting an error like this:

<iq xml:lang='en-US' to='[email protected]/12934698245865334251579' from='pubsub.192.168.0.100' type='error' id='1P42B-58'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <publish node='0c55624367fc10d2548c569782f569dc:downline'>
      <item id='downline'>
        <downline xmlns='pubsub:mecloak:users:downline'>
          <downline>
            {&quot;users&quot;:[{&quot;username&quot;:&quot;chhy&quot;,&quot;userphone&quot;:&quot;+8801111111147&quot;},{&quot;username&quot;:&quot;do hdhddkd&quot;,&quot;userphone&quot;:&quot;+8801111111147&quot;}]}
          </downline>
        </downline>
      </item>
    </publish>
  </pubsub>
  <error type='auth'>
    <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  </error>
</iq>

Am I missing a point, perhaps a configuration?

Upvotes: 0

Views: 107

Answers (1)

fahim fahad fahim
fahim fahad fahim

Reputation: 11

After research, I find out the problem. The problem was not within the configuration but within the item id.

<item id='downline'>
            <downline xmlns='pubsub:mecloak:users:downline'>
              <downline>
                {&quot;users&quot;:[{&quot;username&quot;:&quot;do hdhddkd&quot;,&quot;userphone&quot;:&quot;+8801111111147&quot;}]}
              </downline>
            </downline>
          </item>

in Romeo's case the item id was downline and also in Juliet's case the id was downline

<item id='downline'>
            <downline xmlns='pubsub:mecloak:users:downline'>
              <downline xmlns='pubsub:mecloak:users:downline'>
                {"users":[{"username":"chhy","userphone":"+8801111111147"},{"username":"do hdhddkd","userphone":"+8801111111147"}]}
              </downline>
            </downline>
          </item>

juliet has no right to override romeo's item that is why server rejects it.

juliet changed the item id and it works fine. :)

Upvotes: 0

Related Questions