summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2025-05-04 14:14:19 +0100
committerSadie Powell <sadie@witchery.services>2025-05-04 14:14:19 +0100
commit4b854d39357cbcfa43eb833949d48a49b0420ad6 (patch)
treebdc625b02f2366a64c68ed33826250894e1fa9c0 /data
parent0b2b00b37dd2e713129a04bdae4c5b8aab858126 (diff)
Add support for bearer tokens for authorising with RPC.
Diffstat (limited to 'data')
-rw-r--r--data/modules.example.conf46
1 files changed, 40 insertions, 6 deletions
diff --git a/data/modules.example.conf b/data/modules.example.conf
index a017e54fe..bb9e6f57a 100644
--- a/data/modules.example.conf
+++ b/data/modules.example.conf
@@ -672,7 +672,7 @@ module
/*
* If your database uses a password hashing algorithm that can not be compared using a simple
- * comparison function then you can specify it here to compare locally.
+ * comparison method then you can specify it here to compare locally.
*
* You will need to have the appropriate encryption module (e.g. enc_bcrypt) loaded in order
* for this to work.
@@ -795,8 +795,11 @@ module
/*
* jsonrpc
*
- * Allows remote applications (websites) to execute queries in real time to retrieve data from Anope.
- * By itself this module does nothing, but allows other modules (rpc_main) to receive and send JSON-RPC queries.
+ * Allows remote applications to execute methods within Anope using the JSON-RPC
+ * protocol. See https://www.jsonrpc.org/specification for more information.
+ *
+ * By itself this module does nothing. You should load a RPC method module like
+ * rpc_data which actually provides RPC methods.
*
* IMPORTANT: this can not be loaded at the same time as the xmlrpc module.
*/
@@ -806,13 +809,30 @@ module
/* Web service to use. Requires httpd. */
server = "httpd/main"
+
+ /*
+ * You can also specify one or more authorization tokens to protect access
+ * to the JSON-RPC interface. These tokens should be sent using the Bearer
+ * authorization header as defined in RFC 6750.
+ */
+ #token
+ {
+ /* The token used for authentication. */
+ token = "BmcxTaiYjoBtayfnxCFq"
+
+ /** A list of glob patterns for methods the token can execute. */
+ methods = "~anope.message* anope.*"
+ }
}
/*
* [EXTRA] xmlrpc
*
- * Allows remote applications (websites) to execute queries in real time to retrieve data from Anope.
- * By itself this module does nothing, but allows other modules (rpc_main) to receive and send XMLRPC queries.
+ * Allows remote applications to execute methods within Anope using the XML-RPC
+ * protocol. See https://xmlrpc.com/spec.md for more information.
+ *
+ * By itself this module does nothing. You should load a RPC method module like
+ * rpc_data which actually provides RPC methods.
*
* IMPORTANT: this can not be loaded at the same time as the jsonrpc module.
*/
@@ -836,6 +856,20 @@ module
*/
#enable_i8 = no
#enable_nil = no
+
+ /*
+ * You can also specify one or more authorization tokens to protect access
+ * to the XML-RPC interface. These tokens should be sent using the Bearer
+ * authorization header as defined in RFC 6750.
+ */
+ #token
+ {
+ /* The token used for authentication. */
+ token = "BmcxTaiYjoBtayfnxCFq"
+
+ /** A list of glob patterns for methods the token can execute. */
+ methods = "~anope.message* anope.*"
+ }
}
/*
@@ -858,7 +892,7 @@ module
/*
* rpc_main
*
- * Adds the main RPC core functions.
+ * Adds the main RPC core methods.
* Requires xmlrpc.
*/
#module { name = "rpc_main" }