Skip to content

Latest commit

 

History

History
61 lines (37 loc) · 4.13 KB

File metadata and controls

61 lines (37 loc) · 4.13 KB
title
Trac / Remote API

Trac / Remote API

XML-RPC ??

  • XmlRpcPlugin – Trac Hacks - Plugins Macros etc.

    • This plugin allows Trac plugins to export SELECT PARTS of their interface via XML-RPC and JSON-RPC (if json or simplejson is available). Latest trunk version includes a pluggable API for EXTENDING PROTOCOLS, and see for instance TracRpcProtocolsPlugin for more protocols.

      所謂 "extending protocols" 指的是像 JSON-RPC 這類不同的 RPC 管道。

    • The BROWSABLE XML-RPC URI suffix is /rpc, but most XML-RPC clients should use the authenticated URL suffix /login/rpc as this will provide AUTHENTICATED REQUESTS through Trac.

      The XML_RPC permission is used to grant users access to using the RPC interface. If you do want to use /rpc and UNAUTHENTICATED ACCESS, you must grant the XML_RPC permission to the anonymous user.

      $TRAC_HOST/rpc 可以看 RPC API 文件,如果沒有權限,存取 /rpc 會看到 "XML_RPC privileges are required to perform this operation. You don't have the required permissions." 的提示。

      /login/rpc 才是給程式走的,API 文件裡會標示每個 function 的權限要求 (permission required),有 XML_RPCTICKET_VIEWTICKET_CREATE、By resource 等。

      為什麼下面 Python End-User Usage 的範例都用 /xmlrpc 而非 /login/rpc ? 按照 Remote Procedure Call (RPC) – Trac Hacks 的說法,/rpc//login/rpc 走 JSON-RPC,而 /xmlrpc//login/xmlrpc 則是 XML-RPC,其中 /login/... 都是 authenticated access。

    • Method status:

      • Ticket API is also complete, with the following types exported: component, version, milestone, type, status, resolution, priority and severity.
      • The WikiRPC API ?? is complete, mostly thanks to mgood.
    • Protocol and method documentation for the latest version of the plugin can be found here. 註冊帳號後就能存取

新手上路 {: #getting-started }

Authentication ??

參考資料 {: #reference }

相關:

手冊: