9ebadccefe4b8080ff0b5ee1d6493b474abaec78
[mod_auth_gssapi.git] / src / mod_auth_gssapi.h
1 /* Copyright (C) 2014 mod_auth_gssapi authors - See COPYING for (C) terms */
2
3 #include <stdbool.h>
4 #include <stdint.h>
5 #include <time.h>
6 #include <gssapi/gssapi.h>
7 #include <gssapi/gssapi_ext.h>
8
9 #define APR_WANT_STRFUNC
10 #include "apr_want.h"
11 #include <apr_strings.h>
12 #include <apr_base64.h>
13
14 #include <httpd.h>
15 #include <http_core.h>
16 #include <http_connection.h>
17 #include <http_log.h>
18 #include <http_request.h>
19 #include <mod_session.h>
20
21 /* apache's httpd.h drags in empty PACKAGE_* variables.
22  * undefine them to avoid annoying compile warnings as they
23  * are re-defined in config.h */
24 #undef PACKAGE_BUGREPORT
25 #undef PACKAGE_NAME
26 #undef PACKAGE_STRING
27 #undef PACKAGE_TARNAME
28 #undef PACKAGE_VERSION
29 #include "config.h"
30
31 #include "crypto.h"
32 #include "sessions.h"
33
34 #define MIN_SESS_EXP_TIME 300 /* 5 minutes validity minimum */
35
36 struct mag_config {
37     apr_pool_t *pool;
38     bool ssl_only;
39     bool map_to_local;
40     bool gss_conn_ctx;
41     bool use_sessions;
42     bool use_s4u2proxy;
43     char *deleg_ccache_dir;
44     gss_key_value_set_desc *cred_store;
45     struct seal_key *mag_skey;
46     enum {
47         BA_OFF = 0,
48         BA_FORWARD = 1,
49         BA_ON = 2
50     } basic_auth;
51 };
52
53 struct mag_conn {
54     apr_pool_t *parent;
55     gss_ctx_id_t ctx;
56     bool established;
57     const char *user_name;
58     const char *gss_name;
59     time_t expiration;
60     const char *auth_type;
61 };