Mailing List Archive

Porting HttpAuthPlugin to Trac 1.6? (was: Problem with accountmanager and xmlrpc)
Hi,

it seems, that I need HttpAuthPlugin to make (XML-) RPC work again on
Trac 1.6. It used to work fine in Trac 1.4 with the config

[httpauth]
paths = /xmlrpc, /login/xmlrpc

Are there any plans to port the plugin? I naively tried to update it
using `2to3`, but that did not work.

Thanks in advance for any help!

Cheers, Martin


Quoting Martin:
> Hi,
>
> in the past (<= Trac 1.4), I had to use an additional plugin (httpauth)
> to make xmlrpc work despite accountmanager being active. However, for
> Trac 1.6 this plugin seems to be gone (or not ported to Python 3). I
> understood, that accountmanager has been changed in a way that httpauth
> is not needed anymore, but maybe I'm wrong. Anyone using accountmanager
> and xmlrpc together successfully? How?
>
> Cheers


--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/20240403130424.Horde.kvfAx9UYpmMoKoWmG9gbYkx%40webmail.in-berlin.de.
Re: Porting HttpAuthPlugin to Trac 1.6? (was: Problem with accountmanager and xmlrpc) [ In reply to ]
hi Martin,

maybe it would help to get some more information about what you tried so
far, like

- what version you installed , trunk, pip
- a full traceback of the exceptions thrown

I guess then people could point out things easier

cheers

Markus

Am Mi., 3. Apr. 2024 um 13:04 Uhr schrieb Martin <debacle@debian.org>:

> Hi,
>
> it seems, that I need HttpAuthPlugin to make (XML-) RPC work again on
> Trac 1.6. It used to work fine in Trac 1.4 with the config
>
> [httpauth]
> paths = /xmlrpc, /login/xmlrpc
>
> Are there any plans to port the plugin? I naively tried to update it
> using `2to3`, but that did not work.
>
> Thanks in advance for any help!
>
> Cheers, Martin
>
>
> Quoting Martin:
> > Hi,
> >
> > in the past (<= Trac 1.4), I had to use an additional plugin (httpauth)
> > to make xmlrpc work despite accountmanager being active. However, for
> > Trac 1.6 this plugin seems to be gone (or not ported to Python 3). I
> > understood, that accountmanager has been changed in a way that httpauth
> > is not needed anymore, but maybe I'm wrong. Anyone using accountmanager
> > and xmlrpc together successfully? How?
> >
> > Cheers
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Trac Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to trac-users+unsubscribe@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/trac-users/20240403130424.Horde.kvfAx9UYpmMoKoWmG9gbYkx%40webmail.in-berlin.de
> .
>

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAJ4osOkNEK3-UQFxBtXWo%2BP39p9f0fqGLV6%3DO0yV09fWpVdDxQ%40mail.gmail.com.
Re: Porting HttpAuthPlugin to Trac 1.6? (was: Problem with accountmanager and xmlrpc) [ In reply to ]
Hi,

On 2024-04-04 09:50, Markus Rosjat wrote:
> maybe it would help to get some more information about what you tried so far, like
>
> - what version you installed , trunk, pip
> - a full traceback of the exceptions thrown
>
> I guess then people could point out things easier

Sure!

I use Trac 1.6 and httpauth module 1.2 with one change:

- def post_process_request(self, req, template, content_type):
+ def post_process_request(self, req, template, data, content_type):

because there seems to be an additional parameter now.

As soon as I enable the module and reload a page, I get this backtrace:

2024-04-05 21:53:24,232 Trac[chrome] ERROR: Jinja2 UndefinedError error while rendering XML/HTML template
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/trac/web/chrome.py", line 1569, in iterable_content
for chunk in stream:
File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1662, in __next__
return self._next() # type: ignore
^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1639, in _buffered_generator
c = next(self._gen)
^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1354, in generate
yield self.environment.handle_exception()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 936, in handle_exception
raise rewrite_traceback_stack(source=source)
File "/usr/lib/python3/dist-packages/trac/wiki/templates/wiki_view.html", line 11, in top-level template code
# extends 'layout.html'
File "/usr/lib/python3/dist-packages/trac/templates/layout.html", line 12, in top-level template code
# import "macros.html" as jmacros with context
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/trac/templates/theme.html", line 16, in top-level template code
# block head
File "/usr/lib/python3/dist-packages/trac/wiki/templates/wiki_view.html", line 26, in block 'head'
# set modify_perm = 'WIKI_MODIFY' in perm(page.resource)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 485, in getattr
return getattr(obj, attribute)
^^^^^^^^^^^^^^^^^^^^^^^
UndefinedError: 'page' is undefined

Does this ring a bell?

Cheers

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/8734rz1mrc.fsf%40fama.lan.
Re: Porting HttpAuthPlugin to Trac 1.6? (was: Problem with accountmanager and xmlrpc) [ In reply to ]
On Sat, Apr 6, 2024 at 7:13?AM Martin <debacle@debian.org> wrote:
> I use Trac 1.6 and httpauth module 1.2 with one change:
>
> - def post_process_request(self, req, template, content_type):
> + def post_process_request(self, req, template, data, content_type):
>
> because there seems to be an additional parameter now.

The issue has been filed in https://trac-hacks.org/ticket/14250 and is
fixed now.

> As soon as I enable the module and reload a page, I get this backtrace:
>
> 2024-04-05 21:53:24,232 Trac[chrome] ERROR: Jinja2 UndefinedError error while rendering XML/HTML template
> Traceback (most recent call last):
> File "/usr/lib/python3/dist-packages/trac/web/chrome.py", line 1569, in iterable_content
> for chunk in stream:
> File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1662, in __next__
> return self._next() # type: ignore
> ^^^^^^^^^^^^
> File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1639, in _buffered_generator
> c = next(self._gen)
> ^^^^^^^^^^^^^^^
> File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1354, in generate
> yield self.environment.handle_exception()
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 936, in handle_exception
> raise rewrite_traceback_stack(source=source)
> File "/usr/lib/python3/dist-packages/trac/wiki/templates/wiki_view.html", line 11, in top-level template code
> # extends 'layout.html'
> File "/usr/lib/python3/dist-packages/trac/templates/layout.html", line 12, in top-level template code
> # import "macros.html" as jmacros with context
> ^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/usr/lib/python3/dist-packages/trac/templates/theme.html", line 16, in top-level template code
> # block head
> File "/usr/lib/python3/dist-packages/trac/wiki/templates/wiki_view.html", line 26, in block 'head'
> # set modify_perm = 'WIKI_MODIFY' in perm(page.resource)
> ^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 485, in getattr
> return getattr(obj, attribute)
> ^^^^^^^^^^^^^^^^^^^^^^^
> UndefinedError: 'page' is undefined
>
> Does this ring a bell?

Unable to reproduce it. Also, it is not an issue of HttpAuthPlugin.
Please post the details of your environment (especially installed
plugins and configurations) and how to reproduce it.

--
Jun Omae <jun66j5@gmail.com> (?? ?)

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/CAEVLMai0A2MOLs%3D0EiKpC%2BQyyTXcsL1%3DDF3xheimWhmoYaMsjw%40mail.gmail.com.
Re: Porting HttpAuthPlugin to Trac 1.6? (was: Problem with accountmanager and xmlrpc) [ In reply to ]
On 2024-04-10 03:02, Jun Omae wrote:
> The issue has been filed in https://trac-hacks.org/ticket/14250 and is
> fixed now.

Yes, the new version 1.3 works perfectly fine! Thank you so much!

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/875xwd13bc.fsf%40fama.lan.