webhooks: add "user created" webhook
Webhooks send a POST to an admin-supplied URL when something happens, with relevant information sent in JSON. One has been added for creating users in Settings > Webhooks > User Created. Lazily, the portion of GetUsers which generates a respUser has been factored out, and is called to send the JSON payload. A stripped-down common.Req method has been added, which is used by the barebones WebhookSender struct.
This commit is contained in:
@@ -2017,6 +2017,24 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"webhooks": {
|
||||
"order": [],
|
||||
"meta": {
|
||||
"name": "Webhooks",
|
||||
"description": "jfa-go will send a POST request to these URLs when an event occurs, with relevant information. Request information is logged when debug logging is enabled.",
|
||||
"wiki_link": "https://wiki.jfa-go.com/docs/webhooks/"
|
||||
},
|
||||
"settings": {
|
||||
"created": {
|
||||
"name": "User Created",
|
||||
"required": false,
|
||||
"requires_restart": false,
|
||||
"type": "list",
|
||||
"value": "",
|
||||
"description": "URLs to hit when an account is created through jfa-go. Sends a `respUser` object."
|
||||
}
|
||||
}
|
||||
},
|
||||
"files": {
|
||||
"order": [],
|
||||
"meta": {
|
||||
|
||||
Reference in New Issue
Block a user