ftp://ftp.redhat.com/pub/redhat/linux/rawhide/SRPMS/SRPMS/gnome-vfs2-2.3.8-1.src.rpm
[gnome-vfs-httpcaptive.git] / modules / http-authn.h
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
2 /* http-authn.h - Basic authentication handling for HTTP
3
4    Copyright (C) 2001 Eazel, Inc.
5
6    The Gnome Library is free software; you can redistribute it and/or
7    modify it under the terms of the GNU Library General Public License as
8    published by the Free Software Foundation; either version 2 of the
9    License, or (at your option) any later version.
10
11    The Gnome Library is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14    Library General Public License for more details.
15
16    You should have received a copy of the GNU Library General Public
17    License along with the Gnome Library; see the file COPYING.LIB.  If not,
18    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19    Boston, MA 02111-1307, USA.
20
21    Authors: 
22                  Michael Fleming <mfleming@eazel.com>
23 */
24
25 #ifndef HTTP_AUTHN_H
26 #define HTTP_AUTHN_H
27
28 #include <libgnomevfs/gnome-vfs-uri.h>
29
30 enum AuthnHeaderType {
31         AuthnHeader_WWW,
32         AuthnHeader_Proxy
33 };
34
35 void     http_authn_init                                        (void);
36
37 void     http_authn_shutdown                                    (void);
38
39 char *   http_authn_session_get_header_for_uri                  (GnomeVFSURI *uri);
40
41 void     http_authn_session_add_credentials                     (GnomeVFSURI *uri,
42                                                                  const char * username,
43                                                                  const char * password);
44
45 gboolean http_authn_parse_response_header_basic                 (enum AuthnHeaderType type,
46                                                                  GList *response_headers, 
47                                                                  /* OUT */ char **p_realm);
48
49 char *   http_authn_get_header_for_uri                          (GnomeVFSURI *uri);
50
51 gboolean http_authn_self_test                                   (void);
52
53
54 #endif /* HTTP_AUTHN_H */