Coder Social home page Coder Social logo

Comments (10)

gdt avatar gdt commented on May 21, 2024 1

Thanks all for the fix, submitting it, reviewing and approving. I just updated locally the pkgsrc entry for xmpppy to 0.6.5, built on NetBSD/9 amd64 with Python 3.9, and confirmed that with my modified xsend.py script, authentication works against ejabberd.

I am finding that xsend.py needs some extra parens in print, but that's very minor and I will try to get a PR filed about that.

from xmpppy.

gdt avatar gdt commented on May 21, 2024 1

Now that you've merged the authentication file change, that seems viable. I will try that and open an issue if I have any problems. Thanks for all the fixes.

from xmpppy.

amotl avatar amotl commented on May 21, 2024

Dear Greg,

thanks for reporting. I believe the example programs within the docs/examples folder haven't received any efforts to port them to Python 3 yet.

Maybe you are more lucky with basic.py or, even better, the integrated xmpp-message command line entrypoint? The code for the latter can be found, including synopsis, at xmpp/cli.py.

With kind regards,
Andreas.

from xmpppy.

D-L avatar D-L commented on May 21, 2024

try the following patch

--- a/xmpp/auth.py
+++ b/xmpp/auth.py
@@ -38,9 +38,10 @@ def H(some):
         some = some.encode("utf-8")
     return md5(some).digest()
 def C(some):
-    if isinstance(some[0], bytes):
-        some = map(str, some)
-    return ':'.join(some)
+    if IS_PYTHON3:
+        some = [ x.encode('utf-8') if isinstance(x,str) else x for x in some ]
+        return b':'.join(some)
+    return ':'.join(map(str,some))

from xmpppy.

amotl avatar amotl commented on May 21, 2024

Dear David,

thank you for this patch. Can I humbly ask you to submit it as a pull request? I will be happy to publish another patch release including it.

With kind regards,
Andreas.

from xmpppy.

sumdog avatar sumdog commented on May 21, 2024

I had someone who uses one of my tools experience the same issue:

https://gitlab.com/djsumdog/dav-xmpp-sync/-/issues/1#note_752958838

I don't have this issue on my own XMPP server running prosidy, but I created an account on chatterboxtown.us which uses ejabberd. I was able to replicate the authentication failure.

...
    while not self.set: self._owner.Process(10)
  File "/home/cassius/.local/lib/python3.8/site-packages/xmpp/dispatcher.py", line 129, in Process
    raise ex
  File "/home/cassius/.local/lib/python3.8/site-packages/xmpp/dispatcher.py", line 307, in dispatch
    handler['func'](session,stanza)
  File "/home/cassius/.local/lib/python3.8/site-packages/xmpp/dispatcher.py", line 219, in streamErrorHandler
    raise exc((name,text))
xmpp.protocol.NotAuthorized: ('not-authorized', '')

If I manually patched the local xmpppy in my local environment using the code provided by @D-L. Authentication works on both my prosidy server and the chatterbox/ejabberd server. I'm currently on Python 3.8.12.

For now I can monkey patch the issue using the following:

import xmpp
import sys

def _C_monkey_patch(some):
    if sys.version_info >= (3, 0, 0):
        some = [ x.encode('utf-8') if isinstance(x,str) else x for x in some ]
        return b':'.join(some)
    return ':'.join(map(str,some))
xmpp.auth.C = _C_monkey_patch

I see a PR was never submitted. I could make one. Are there any tests, code formatting checks or CI/CD pipelines in this project? I don't see any.

from xmpppy.

amotl avatar amotl commented on May 21, 2024

Hi again,

thanks again for the contribution, @D-L. @sumdog submitted your patch with #54 and we just merged it and released xmpppy version 0.6.5 to PyPI.

Please let us know if you still see any issues on this topic.

With kind regards,
Andreas.

from xmpppy.

amotl avatar amotl commented on May 21, 2024

Dear Greg,

let's just move forward with #55, implementing your request from #42, and remove xsend.py altogether, as xmpp/cli.py now has all the details and contains the complete canonical implementation to connect, authenticate and submit a single XMPP message.

With kind regards,
Andreas.

from xmpppy.

Neustradamus avatar Neustradamus commented on May 21, 2024

@sumdog: Can you publish your https://gitlab.com/djsumdog/dav-xmpp-sync on GitHub too?
A mirror?

Thanks in advance!

from xmpppy.

sumdog avatar sumdog commented on May 21, 2024

@sumdog: Can you publish your https://gitlab.com/djsumdog/dav-xmpp-sync on GitHub too? A mirror?

Thanks in advance!

Sorry, I purposefully put all new projects on Gitlab and have been thinking of migrating old projects off Github. It's pretty trivial to create an account there if you want to submit patches, or I can take patches via e-mail as well.

from xmpppy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.