~ubuntu-branches/ubuntu/feisty/apache2/feisty

« back to all changes in this revision

Viewing changes to modules/aaa/mod_auth.h

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Barth
  • Date: 2006-12-09 21:05:45 UTC
  • mfrom: (0.6.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20061209210545-h70s0xaqc2v8vqr2
Tags: 2.2.3-3.2
* Non-maintainer upload.
* 043_ajp_connection_reuse: Patch from upstream Bugzilla, fixing a critical
  issue with regard to connection reuse in mod_proxy_ajp.
  Closes: #396265

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Licensed to the Apache Software Foundation (ASF) under one or more
 
2
 * contributor license agreements.  See the NOTICE file distributed with
 
3
 * this work for additional information regarding copyright ownership.
 
4
 * The ASF licenses this file to You under the Apache License, Version 2.0
 
5
 * (the "License"); you may not use this file except in compliance with
 
6
 * the License.  You may obtain a copy of the License at
 
7
 *
 
8
 *     http://www.apache.org/licenses/LICENSE-2.0
 
9
 *
 
10
 * Unless required by applicable law or agreed to in writing, software
 
11
 * distributed under the License is distributed on an "AS IS" BASIS,
 
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
13
 * See the License for the specific language governing permissions and
 
14
 * limitations under the License.
 
15
 */
 
16
 
 
17
/**
 
18
 * @file  mod_auth.h
 
19
 * @brief uthentication Extension Module for Apache
 
20
 *
 
21
 * @defgroup MOD_AUTH mod_auth
 
22
 * @ingroup  APACHE_MODS
 
23
 */
 
24
 
 
25
#ifndef APACHE_MOD_AUTH_H
 
26
#define APACHE_MOD_AUTH_H
 
27
 
 
28
#include "apr_pools.h"
 
29
#include "apr_hash.h"
 
30
 
 
31
#include "httpd.h"
 
32
 
 
33
#ifdef __cplusplus
 
34
extern "C" {
 
35
#endif
 
36
 
 
37
#define AUTHN_PROVIDER_GROUP "authn"
 
38
#define AUTHN_DEFAULT_PROVIDER "file"
 
39
    
 
40
#define AUTHZ_GROUP_NOTE "authz_group_note"
 
41
#define AUTHN_PROVIDER_NAME_NOTE "authn_provider_name"
 
42
 
 
43
typedef enum {
 
44
    AUTH_DENIED,
 
45
    AUTH_GRANTED,
 
46
    AUTH_USER_FOUND,
 
47
    AUTH_USER_NOT_FOUND,
 
48
    AUTH_GENERAL_ERROR
 
49
} authn_status;
 
50
 
 
51
typedef struct {
 
52
    /* Given a username and password, expected to return AUTH_GRANTED
 
53
     * if we can validate this user/password combination.
 
54
     */
 
55
    authn_status (*check_password)(request_rec *r, const char *user,
 
56
                                  const char *password);
 
57
 
 
58
    /* Given a user and realm, expected to return AUTH_USER_FOUND if we
 
59
     * can find a md5 hash of 'user:realm:password'
 
60
     */
 
61
    authn_status (*get_realm_hash)(request_rec *r, const char *user,
 
62
                                   const char *realm, char **rethash);
 
63
} authn_provider;
 
64
 
 
65
/* A linked-list of authn providers. */
 
66
typedef struct authn_provider_list authn_provider_list;
 
67
 
 
68
struct authn_provider_list {
 
69
    const char *provider_name;
 
70
    const authn_provider *provider;
 
71
    authn_provider_list *next;
 
72
};
 
73
 
 
74
typedef struct {
 
75
    /* For a given user, return a hash of all groups the user belongs to.  */
 
76
    apr_hash_t * (*get_user_groups)(request_rec *r, const char *user);
 
77
} authz_provider;
 
78
 
 
79
#ifdef __cplusplus
 
80
}
 
81
#endif
 
82
 
 
83
#endif