Line data Source code
1 : /* 2 : * lwan - web server 3 : * Copyright (c) 2014 L. A. F. Pereira <l@tia.mat.br> 4 : * 5 : * This program is free software; you can redistribute it and/or 6 : * modify it under the terms of the GNU General Public License 7 : * as published by the Free Software Foundation; either version 2 8 : * of the License, or any later version. 9 : * 10 : * This program 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 13 : * GNU General Public License for more details. 14 : * 15 : * You should have received a copy of the GNU General Public License 16 : * along with this program; if not, write to the Free Software 17 : * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 18 : * USA. 19 : */ 20 : 21 : #pragma once 22 : 23 : #include "lwan.h" 24 : 25 : bool lwan_http_authorize_init(void); 26 : void lwan_http_authorize_shutdown(void); 27 : 28 : bool lwan_http_authorize(struct lwan_request *request, 29 : const char *realm, 30 : const char *password_file); 31 : 32 : static inline bool 33 4 : lwan_http_authorize_urlmap(struct lwan_request *request, 34 : const struct lwan_url_map *url_map) 35 : { 36 8 : return lwan_http_authorize(request, url_map->authorization.realm, 37 4 : url_map->authorization.password_file); 38 : }