gen_auth.h (2639B)
1 /* 2 This file is part of libmicrohttpd 3 Copyright (C) 2022 Evgeny Grin (Karlson2k) 4 5 This library is free software; you can redistribute it and/or 6 modify it under the terms of the GNU Lesser General Public 7 License as published by the Free Software Foundation; either 8 version 2.1 of the License, or (at your option) any later version. 9 10 This library is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 Lesser General Public License for more details. 14 15 You should have received a copy of the GNU Lesser General Public 16 License along with this library. 17 If not, see <http://www.gnu.org/licenses/>. 18 */ 19 20 /** 21 * @file microhttpd/gen_auth.h 22 * @brief Declarations for HTTP authorisation general functions 23 * @author Karlson2k (Evgeny Grin) 24 */ 25 26 #ifndef MHD_GET_AUTH_H 27 #define MHD_GET_AUTH_H 1 28 29 #include "mhd_options.h" 30 #ifdef HAVE_STDBOOL_H 31 #include <stdbool.h> 32 #endif /* HAVE_STDBOOL_H */ 33 34 struct MHD_Connection; /* Forward declaration to avoid include of the large headers */ 35 36 #ifdef BAUTH_SUPPORT 37 38 /* Forward declaration to avoid additional headers inclusion */ 39 struct MHD_RqBAuth; 40 /** 41 * Return request's Basic Authorisation parameters. 42 * 43 * Function return result of parsing of the request's "Authorization" header or 44 * returns cached parsing result if the header was already parsed for 45 * the current request. 46 * @param connection the connection to process 47 * @return the pointer to structure with Authentication parameters, 48 * NULL if no memory in memory pool, if called too early (before 49 * header has been received) or if no valid Basic Authorisation header 50 * found. 51 */ 52 const struct MHD_RqBAuth * 53 MHD_get_rq_bauth_params_ (struct MHD_Connection *connection); 54 55 #endif /* BAUTH_SUPPORT */ 56 #ifdef DAUTH_SUPPORT 57 /* Forward declaration to avoid additional headers inclusion */ 58 struct MHD_RqDAuth; 59 60 /** 61 * Return request's Digest Authorisation parameters. 62 * 63 * Function return result of parsing of the request's "Authorization" header or 64 * returns cached parsing result if the header was already parsed for 65 * the current request. 66 * @param connection the connection to process 67 * @return the pointer to structure with Authentication parameters, 68 * NULL if no memory in memory pool, if called too early (before 69 * header has been received) or if no valid Basic Authorisation header 70 * found. 71 */ 72 const struct MHD_RqDAuth * 73 MHD_get_rq_dauth_params_ (struct MHD_Connection *connection); 74 #endif /* DAUTH_SUPPORT */ 75 76 #endif /* MHD_GET_AUTH_H */