diff options
Diffstat (limited to 'include/asterisk/http.h')
-rw-r--r-- | include/asterisk/http.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/asterisk/http.h b/include/asterisk/http.h index 9efcad7f7..59e185a6f 100644 --- a/include/asterisk/http.h +++ b/include/asterisk/http.h @@ -112,6 +112,26 @@ struct ast_http_uri { /*! \brief Get cookie from Request headers */ struct ast_variable *ast_http_get_cookies(struct ast_variable *headers); +/*! \brief HTTP authentication information. */ +struct ast_http_auth { + /*! Provided userid. */ + char *userid; + /*! For Basic auth, the provided password. */ + char *password; +}; + +/*! + * \brief Get HTTP authentication information from headers. + * + * The returned object is AO2 managed, so clean up with ao2_cleanup(). + * + * \param headers HTTP request headers. + * \return HTTP auth structure. + * \return \c NULL if no supported HTTP auth headers present. + * \since 12 + */ +struct ast_http_auth *ast_http_get_auth(struct ast_variable *headers); + /*! \brief Register a URI handler */ int ast_http_uri_link(struct ast_http_uri *urihandler); |