![]() |
The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Integrate FreeRADIUS with RESTfull APIs. More...
#include <freeradius-devel/curl/base.h>
#include <freeradius-devel/curl/xlat.h>
#include <freeradius-devel/server/base.h>
#include <freeradius-devel/server/cf_parse.h>
#include <freeradius-devel/server/global_lib.h>
#include <freeradius-devel/server/tmpl.h>
#include <freeradius-devel/util/atexit.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/util/uri.h>
#include <freeradius-devel/unlang/call_env.h>
#include <freeradius-devel/unlang/xlat_func.h>
#include "rest.h"
Go to the source code of this file.
Macros | |
#define | REST_CALL_ENV_REQUEST_COMMON(_dflt_username, _dflt_password) |
#define | REST_CALL_ENV_RESPONSE_COMMON { FR_CALL_ENV_PARSE_ONLY_OFFSET("header", FR_TYPE_STRING, CALL_ENV_FLAG_ATTRIBUTE, rlm_rest_call_env_t, response.header) }, \ |
#define | REST_CALL_ENV_SECTION(_var, _section, _dflt_username, _dflt_password) |
#define | SECTION_REQUEST_COMMON |
Functions | |
static int | _mod_conn_free (fr_curl_io_request_t *randle) |
static int | _rest_request_cleanup (fr_curl_io_request_t *randle, UNUSED void *uctx) |
Cleans up after a REST request. | |
static int | _rest_uri_part_escape_uctx_free (void *uctx) |
static int | instantiate (module_inst_ctx_t const *mctx) |
static unlang_action_t | mod_accounting (unlang_result_t *p_result, module_ctx_t const *mctx, request_t *request) |
static unlang_action_t | mod_accounting_result (unlang_result_t *p_result, module_ctx_t const *mctx, request_t *request) |
static unlang_action_t | mod_authenticate (unlang_result_t *p_result, module_ctx_t const *mctx, request_t *request) |
static unlang_action_t | mod_authenticate_result (unlang_result_t *p_result, module_ctx_t const *mctx, request_t *request) |
static unlang_action_t | mod_authorize (unlang_result_t *p_result, module_ctx_t const *mctx, request_t *request) |
static unlang_action_t | mod_authorize_result (unlang_result_t *p_result, module_ctx_t const *mctx, request_t *request) |
static int | mod_bootstrap (module_inst_ctx_t const *mctx) |
static int | mod_load (void) |
static unlang_action_t | mod_post_auth (unlang_result_t *p_result, module_ctx_t const *mctx, request_t *request) |
static unlang_action_t | mod_post_auth_result (unlang_result_t *p_result, module_ctx_t const *mctx, request_t *request) |
static int | mod_thread_detach (module_thread_inst_ctx_t const *mctx) |
Cleanup all outstanding requests associated with this thread. | |
static int | mod_thread_instantiate (module_thread_inst_ctx_t const *mctx) |
Create a thread specific multihandle. | |
static int | parse_sub_section (rlm_rest_t *inst, CONF_SECTION *parent, conf_parser_t const *config_items, rlm_rest_section_t *config, char const *name) |
REST_CALL_ENV_SECTION (rest_call_env_accounting, "accounting",,) | |
REST_CALL_ENV_SECTION (rest_call_env_authenticate, "authenticate",.pair.dflt="User-Name",.pair.dflt="User-Password") | |
REST_CALL_ENV_SECTION (rest_call_env_authorize, "authorize",,) | |
REST_CALL_ENV_SECTION (rest_call_env_post_auth, "post-auth",,) | |
static int | rest_conn_alloc (fr_curl_io_request_t *randle, void *uctx) |
static int | rest_proxy_parse (UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent, CONF_ITEM *ci, UNUSED conf_parser_t const *rule) |
static int | rest_uri_part_escape (fr_value_box_t *vb, UNUSED void *uctx) |
URL escape a single box forming part of a URL. | |
static int | rest_uri_part_escape (fr_value_box_t *vb, void *uctx) |
static void * | rest_uri_part_escape_uctx_alloc (UNUSED request_t *request, void const *uctx) |
Allocate an escape uctx to pass to fr_uri_escape. | |
static xlat_action_t | rest_xlat (UNUSED TALLOC_CTX *ctx, UNUSED fr_dcursor_t *out, xlat_ctx_t const *xctx, request_t *request, fr_value_box_list_t *in) |
Simple xlat to read text data from a URL. | |
static xlat_action_t | rest_xlat_resume (TALLOC_CTX *ctx, fr_dcursor_t *out, xlat_ctx_t const *xctx, request_t *request, UNUSED fr_value_box_list_t *in) |
static int | rlm_rest_perform (module_ctx_t const *mctx, rlm_rest_section_t const *section, fr_curl_io_request_t *randle, request_t *request) |
static int | rlm_rest_status_update (request_t *request, void *handle) |
Update the status attribute. | |
Integrate FreeRADIUS with RESTfull APIs.
Definition in file rlm_rest.c.
#define REST_CALL_ENV_REQUEST_COMMON | ( | _dflt_username, | |
_dflt_password | |||
) |
Definition at line 175 of file rlm_rest.c.
#define REST_CALL_ENV_RESPONSE_COMMON { FR_CALL_ENV_PARSE_ONLY_OFFSET("header", FR_TYPE_STRING, CALL_ENV_FLAG_ATTRIBUTE, rlm_rest_call_env_t, response.header) }, \ |
Definition at line 183 of file rlm_rest.c.
#define REST_CALL_ENV_SECTION | ( | _var, | |
_section, | |||
_dflt_username, | |||
_dflt_password | |||
) |
Definition at line 186 of file rlm_rest.c.
#define SECTION_REQUEST_COMMON |
Definition at line 103 of file rlm_rest.c.
|
static |
|
static |
Cleans up after a REST request.
Resets all options associated with a CURL handle, and frees any headers associated with it.
[in] | randle | to cleanup. |
[in] | uctx | unused. |
Definition at line 1160 of file rlm_rest.c.
|
static |
Definition at line 326 of file rlm_rest.c.
|
static |
Definition at line 1297 of file rlm_rest.c.
|
static |
|
static |
Definition at line 876 of file rlm_rest.c.
|
static |
|
static |
Definition at line 733 of file rlm_rest.c.
|
static |
|
static |
Definition at line 620 of file rlm_rest.c.
|
static |
|
static |
|
static |
|
static |
Definition at line 954 of file rlm_rest.c.
|
static |
Cleanup all outstanding requests associated with this thread.
Destroys all curl easy handles, and then the multihandle associated with this thread.
[in] | mctx | data to destroy. |
Definition at line 1277 of file rlm_rest.c.
|
static |
Create a thread specific multihandle.
Easy handles representing requests are added to the curl multihandle with the multihandle used for mux/demux.
[in] | mctx | Thread instantiation data. |
Definition at line 1247 of file rlm_rest.c.
|
static |
Definition at line 1032 of file rlm_rest.c.
REST_CALL_ENV_SECTION | ( | rest_call_env_accounting | , |
"accounting" | |||
) |
REST_CALL_ENV_SECTION | ( | rest_call_env_authenticate | , |
"authenticate" | , | ||
.pair. | dflt = "User-Name" , |
||
.pair. | dflt = "User-Password" |
||
) |
REST_CALL_ENV_SECTION | ( | rest_call_env_authorize | , |
"authorize" | |||
) |
REST_CALL_ENV_SECTION | ( | rest_call_env_post_auth | , |
"post-auth" | |||
) |
|
static |
Definition at line 1213 of file rlm_rest.c.
|
static |
|
static |
URL escape a single box forming part of a URL.
[in] | vb | to escape |
[in] | uctx | UNUSED context containing CURL handle |
Definition at line 361 of file rlm_rest.c.
|
static |
|
static |
Allocate an escape uctx to pass to fr_uri_escape.
[in] | request | UNUSED. |
[in] | uctx | pointer to the start of the uri_parts array. |
Definition at line 337 of file rlm_rest.c.
|
static |
Definition at line 414 of file rlm_rest.c.
|
static |
Definition at line 384 of file rlm_rest.c.
|
static |
Update the status attribute.
[in] | request | The current request. |
[in] | handle | rest handle. |
Definition at line 301 of file rlm_rest.c.
fr_dict_attr_t const* attr_rest_http_body |
Definition at line 271 of file rlm_rest.c.
fr_dict_attr_t const* attr_rest_http_header |
Definition at line 272 of file rlm_rest.c.
fr_dict_attr_t const* attr_rest_http_status_code |
Definition at line 273 of file rlm_rest.c.
|
static |
Definition at line 274 of file rlm_rest.c.
|
static |
Definition at line 275 of file rlm_rest.c.
fr_dict_t const* dict_freeradius |
Definition at line 261 of file rlm_rest.c.
|
static |
Definition at line 262 of file rlm_rest.c.
|
static |
Definition at line 53 of file rlm_rest.c.
|
static |
Definition at line 77 of file rlm_rest.c.
|
static |
Definition at line 153 of file rlm_rest.c.
|
static |
Definition at line 239 of file rlm_rest.c.
char const* rest_no_proxy = "*" |
Unique pointer used to determine if we should explicitly disable proxying.
Magic pointer value for determining if we should disable proxying.
Definition at line 82 of file rlm_rest.c.
|
static |
Definition at line 44 of file rlm_rest.c.
|
static |
Definition at line 489 of file rlm_rest.c.
module_rlm_t rlm_rest |
Definition at line 1363 of file rlm_rest.c.
fr_dict_autoload_t rlm_rest_dict |
Definition at line 265 of file rlm_rest.c.
fr_dict_attr_autoload_t rlm_rest_dict_attr |
Definition at line 278 of file rlm_rest.c.
global_lib_autoinst_t const *const rlm_rest_lib |
Definition at line 288 of file rlm_rest.c.
|
static |
Definition at line 124 of file rlm_rest.c.
|
static |
Definition at line 111 of file rlm_rest.c.
|
static |
Definition at line 118 of file rlm_rest.c.
|
static |
Definition at line 141 of file rlm_rest.c.
|
static |
Definition at line 136 of file rlm_rest.c.