summaryrefslogtreecommitdiff
path: root/libsoup/auth/soup-auth.h
blob: 606127b5e9dfffadc413667fc22e7618453beb99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
 * Copyright (C) 2001-2003, Ximian, Inc.
 */

#pragma once

#include "soup-types.h"
#include "soup-headers.h"

G_BEGIN_DECLS

#define SOUP_TYPE_AUTH (soup_auth_get_type())
SOUP_AVAILABLE_IN_2_4
G_DECLARE_DERIVABLE_TYPE (SoupAuth, soup_auth, SOUP, AUTH, GObject)

struct _SoupAuthClass {
	GObjectClass parent_class;

	const char  *scheme_name;
	guint        strength;

	gboolean     (*update)               (SoupAuth      *auth,
					      SoupMessage   *msg,
					      GHashTable    *auth_header);

	GSList *     (*get_protection_space) (SoupAuth      *auth,
					      SoupURI       *source_uri);

	void         (*authenticate)         (SoupAuth      *auth,
					      const char    *username,
					      const char    *password);
	gboolean     (*is_authenticated)     (SoupAuth      *auth);

	char *       (*get_authorization)    (SoupAuth      *auth,
					      SoupMessage   *msg);

	gboolean     (*is_ready)             (SoupAuth      *auth,
					      SoupMessage   *msg);

	gboolean     (*can_authenticate)     (SoupAuth      *auth);

	gpointer padding[6];
};

SOUP_AVAILABLE_IN_2_4
SoupAuth   *soup_auth_new                   (GType          type,
					     SoupMessage   *msg,
					     const char    *auth_header);
SOUP_AVAILABLE_IN_2_4
gboolean    soup_auth_update                (SoupAuth      *auth,
					     SoupMessage   *msg,
					     const char    *auth_header);

SOUP_AVAILABLE_IN_2_4
gboolean    soup_auth_is_for_proxy          (SoupAuth      *auth);
SOUP_AVAILABLE_IN_2_4
const char *soup_auth_get_scheme_name       (SoupAuth      *auth);
SOUP_AVAILABLE_IN_ALL
const char *soup_auth_get_authority         (SoupAuth      *auth);
SOUP_AVAILABLE_IN_2_4
const char *soup_auth_get_realm             (SoupAuth      *auth);
SOUP_AVAILABLE_IN_2_4
char       *soup_auth_get_info              (SoupAuth      *auth);

SOUP_AVAILABLE_IN_2_4
void        soup_auth_authenticate          (SoupAuth      *auth,
					     const char    *username,
					     const char    *password);

SOUP_AVAILABLE_IN_ALL
void        soup_auth_cancel                (SoupAuth      *auth);

SOUP_AVAILABLE_IN_2_4
gboolean    soup_auth_is_authenticated      (SoupAuth      *auth);

SOUP_AVAILABLE_IN_ALL
gboolean    soup_auth_is_cancelled          (SoupAuth      *auth);

SOUP_AVAILABLE_IN_2_42
gboolean    soup_auth_is_ready              (SoupAuth      *auth,
					     SoupMessage   *msg);
SOUP_AVAILABLE_IN_2_54
gboolean    soup_auth_can_authenticate      (SoupAuth      *auth);

SOUP_AVAILABLE_IN_2_4
char       *soup_auth_get_authorization     (SoupAuth      *auth, 
					     SoupMessage   *msg);

SOUP_AVAILABLE_IN_2_4
GSList     *soup_auth_get_protection_space  (SoupAuth      *auth,
					     SoupURI       *source_uri);
SOUP_AVAILABLE_IN_2_4
void        soup_auth_free_protection_space (SoupAuth      *auth,
					     GSList        *space);

SOUP_AVAILABLE_IN_2_54
gboolean    soup_auth_negotiate_supported   (void);

#define SOUP_TYPE_AUTH_BASIC (soup_auth_basic_get_type ())
SOUP_AVAILABLE_IN_2_4
GType soup_auth_basic_get_type (void);

#define SOUP_TYPE_AUTH_DIGEST (soup_auth_digest_get_type ())
SOUP_AVAILABLE_IN_2_4
GType soup_auth_digest_get_type (void);

#define SOUP_TYPE_AUTH_NTLM (soup_auth_ntlm_get_type ())
SOUP_AVAILABLE_IN_2_4
GType soup_auth_ntlm_get_type (void);

#define SOUP_TYPE_AUTH_NEGOTIATE (soup_auth_negotiate_get_type ())
SOUP_AVAILABLE_IN_2_54
GType soup_auth_negotiate_get_type (void);


G_END_DECLS