Opened on 02/22/2016 at 04:37:12 PM
Last modified on 12/21/2017 at 11:29:03 AM
#3678 new change
Replace the XmlRpcPlugin
Reported by: | fhd | Assignee: | |
---|---|---|---|
Priority: | P3 | Milestone: | |
Module: | Infrastructure | Keywords: | |
Cc: | Blocked By: | #3676 | |
Blocking: | Platform: | Unknown / Cross platform | |
Ready: | no | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description (last modified by trev)
Background
#3676 adds two Trac plugins:
- The XmlRpc plugin.
- The HttpAuth plugin, which allows the API user to authenticate via HTTP basic auth, interfacing with the AccountManager plugin we also use.
It would be better for security and sanity to not rely on these plugins.
What to change
Since we only need the Trac API for communicating between servers controlled by us, we could simply invoke a Python script via SSH that interacts with the Trac environment in the same way plugins do.
Since we don't want the change the issue status, it should be possible to minify the update code in XML-RPC plugin as follows:
from trac.env import Environment from trac.util.datefmt import to_datetime, utc import trac.ticket.model as model from trac.ticket.notification import TicketNotifyEmail env = Environment(env_path) when = to_datetime(None, utc) ticket = model.Ticket(env, ticket_id) ticket.save_changes(author, comment, when=when) try: tn = TicketNotifyEmail(env) tn.notify(ticket, newticket=False, modtime=when) except Exception, e: warn("Failure sending notification on change of " "ticket #%s: %s" % (ticket.id, e))
Attachments (0)
Note: See
TracTickets for help on using
tickets.