我有一台服务器,其中包含使用freeradius的强制门户的允许用户列表。我希望有一个单独的服务器能够发送一个人造api请求,以将用户添加到此xml配置列表中。
我正在尝试使用邮递员向我的pfsense文件发送请求以修补配置。身体应该如何构造?
我已经尝试过function_call请求
{
"function":"radius"
"args":[args]
}
并且相信也许我应该使用config_patch请求
该错误无助于描述其期望的json数据的结构。我提供了一个空的json:
{}
哪个返回了:
Fatal error: Uncaught TypeError: Argument 2 passed to
fauxapi\v1\fauxApiPfsenseInterface::array_merge_recursive_distinct() must be of the type array,null given,called in
/etc/inc/fauxapi/fauxapi_pfsense_interface.inc on line 120 and defined in
/etc/inc/fauxapi/fauxapi_pfsense_interface.inc:135
Stack trace:
#0 /etc/inc/fauxapi/fauxapi_pfsense_interface.inc(120):
fauxapi\v1\fauxApiPfsenseInterface->array_merge_recursive_distinct(Array,NULL)
#1 /etc/inc/fauxapi/fauxapi_actions.inc(113): fauxapi\v1\fauxApiPfsenseInterface->config_patch(NULL,true,true)
#2 /etc/inc/fauxapi/fauxapi.inc(90): fauxapi\v1\fauxApiactions->config_patch(Array)
#3 /usr/local/www/fauxapi/v1/index.php(32): fauxapi\v1\fauxApi->__call('config_patch',Array)
#4 {main}
thrown in /etc/inc/fauxapi/fauxapi_pfsense_interface.inc on line 135
PHP ERROR: Type: 1,File: /etc/inc/fauxapi/fauxapi_pfsense_interface.inc,Line: 135,Message: Uncaught TypeError:
Argument 2 passed to fauxapi\v1\fauxApiPfsenseInterface::array_merge_recursive_distinct() must be of the type array,called in /etc/inc/fauxapi/fauxapi_pfsense_interface.inc on line 120 and defined in
/etc/inc/fauxapi/fauxapi_pfsense_interface.inc:135
Stack trace:
#0 /etc/inc/fauxapi/fauxapi_pfsense_interface.inc(120):
fauxapi\v1\fauxApiPfsenseInterface->array_merge_recursive_distinct(Array,Array)
#4 {main}
thrown
我要在此结构中添加用户:
"freeradius": {
"config": [
{
"sortable": "","varusersusername": "blah","varuserspassword": "password",//just for debug purposes
"varuserspasswordencryption": "Cleartext-Password","varusersmotpenable": "","varusersauthmethod": "","varusersmotpinitsecret": "","varusersmotppin": "","varusersmotpoffset": "","qrcodetext": "","varuserswisprredirectionurl": "","varuserssimultaneousconnect": "","description": "","varusersframedipaddress": "","varusersframedipnetmask": "","varusersframedroute": "","varusersvlanid": "","varusersexpiration": "","varuserssessiontimeout": "","varuserslogintime": "","varusersamountoftime": "","varuserspointoftime": "Daily","varusersmaxtotaloctets": "1000","varusersmaxtotaloctetstimerange": "daily","varusersmaxbandwidthdown": "2048","varusersmaxbandwidthup": "2048","varusersacctinteriminterval": "","varuserstopadditionaloptions": "","varuserscheckitemsadditionaloptions": "","varusersreplyitemsadditionaloptions": ""
},