1 | /* Copyright 2009 Justin Erenkrantz and Greg Stein
|
---|
2 | *
|
---|
3 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
4 | * you may not use this file except in compliance with the License.
|
---|
5 | * You may obtain a copy of the License at
|
---|
6 | *
|
---|
7 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
8 | *
|
---|
9 | * Unless required by applicable law or agreed to in writing, software
|
---|
10 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
12 | * See the License for the specific language governing permissions and
|
---|
13 | * limitations under the License.
|
---|
14 | */
|
---|
15 |
|
---|
16 | #ifndef AUTH_H
|
---|
17 | #define AUTH_H
|
---|
18 |
|
---|
19 | #include "auth_kerb.h"
|
---|
20 |
|
---|
21 | #ifdef __cplusplus
|
---|
22 | extern "C" {
|
---|
23 | #endif
|
---|
24 |
|
---|
25 | void serf__encode_auth_header(const char **header, const char *protocol,
|
---|
26 | const char *data, apr_size_t data_len,
|
---|
27 | apr_pool_t *pool);
|
---|
28 |
|
---|
29 | /** Basic authentication **/
|
---|
30 | apr_status_t serf__init_basic(int code,
|
---|
31 | serf_context_t *ctx,
|
---|
32 | apr_pool_t *pool);
|
---|
33 | apr_status_t serf__init_basic_connection(int code,
|
---|
34 | serf_connection_t *conn,
|
---|
35 | apr_pool_t *pool);
|
---|
36 | apr_status_t serf__handle_basic_auth(int code,
|
---|
37 | serf_request_t *request,
|
---|
38 | serf_bucket_t *response,
|
---|
39 | const char *auth_hdr,
|
---|
40 | const char *auth_attr,
|
---|
41 | void *baton,
|
---|
42 | apr_pool_t *pool);
|
---|
43 | apr_status_t serf__setup_request_basic_auth(peer_t peer,
|
---|
44 | int code,
|
---|
45 | serf_connection_t *conn,
|
---|
46 | serf_request_t *request,
|
---|
47 | const char *method,
|
---|
48 | const char *uri,
|
---|
49 | serf_bucket_t *hdrs_bkt);
|
---|
50 |
|
---|
51 | /** Digest authentication **/
|
---|
52 | apr_status_t serf__init_digest(int code,
|
---|
53 | serf_context_t *ctx,
|
---|
54 | apr_pool_t *pool);
|
---|
55 | apr_status_t serf__init_digest_connection(int code,
|
---|
56 | serf_connection_t *conn,
|
---|
57 | apr_pool_t *pool);
|
---|
58 | apr_status_t serf__handle_digest_auth(int code,
|
---|
59 | serf_request_t *request,
|
---|
60 | serf_bucket_t *response,
|
---|
61 | const char *auth_hdr,
|
---|
62 | const char *auth_attr,
|
---|
63 | void *baton,
|
---|
64 | apr_pool_t *pool);
|
---|
65 | apr_status_t serf__setup_request_digest_auth(peer_t peer,
|
---|
66 | int code,
|
---|
67 | serf_connection_t *conn,
|
---|
68 | serf_request_t *request,
|
---|
69 | const char *method,
|
---|
70 | const char *uri,
|
---|
71 | serf_bucket_t *hdrs_bkt);
|
---|
72 | apr_status_t serf__validate_response_digest_auth(peer_t peer,
|
---|
73 | int code,
|
---|
74 | serf_connection_t *conn,
|
---|
75 | serf_request_t *request,
|
---|
76 | serf_bucket_t *response,
|
---|
77 | apr_pool_t *pool);
|
---|
78 |
|
---|
79 | #ifdef SERF_HAVE_KERB
|
---|
80 | /** Kerberos authentication **/
|
---|
81 | apr_status_t serf__init_kerb(int code,
|
---|
82 | serf_context_t *ctx,
|
---|
83 | apr_pool_t *pool);
|
---|
84 | apr_status_t serf__init_kerb_connection(int code,
|
---|
85 | serf_connection_t *conn,
|
---|
86 | apr_pool_t *pool);
|
---|
87 | apr_status_t serf__handle_kerb_auth(int code,
|
---|
88 | serf_request_t *request,
|
---|
89 | serf_bucket_t *response,
|
---|
90 | const char *auth_hdr,
|
---|
91 | const char *auth_attr,
|
---|
92 | void *baton,
|
---|
93 | apr_pool_t *pool);
|
---|
94 | apr_status_t serf__setup_request_kerb_auth(peer_t peer,
|
---|
95 | int code,
|
---|
96 | serf_connection_t *conn,
|
---|
97 | serf_request_t *request,
|
---|
98 | const char *method,
|
---|
99 | const char *uri,
|
---|
100 | serf_bucket_t *hdrs_bkt);
|
---|
101 | apr_status_t serf__validate_response_kerb_auth(peer_t peer,
|
---|
102 | int code,
|
---|
103 | serf_connection_t *conn,
|
---|
104 | serf_request_t *request,
|
---|
105 | serf_bucket_t *response,
|
---|
106 | apr_pool_t *pool);
|
---|
107 | #endif /* SERF_HAVE_SPNEGO */
|
---|
108 |
|
---|
109 | #ifdef __cplusplus
|
---|
110 | }
|
---|
111 | #endif
|
---|
112 |
|
---|
113 | #endif /* !AUTH_H */
|
---|