mod_authn_core.c revision 75031befec2825183c13931fc3266b56ed575c3d
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Security options etc.
*
* Module derived from code originally written by Rob McCool
*
*/
#include "apr_strings.h"
#include "apr_network_io.h"
#define APR_WANT_STRFUNC
#define APR_WANT_BYTEFUNC
#include "apr_want.h"
#include "ap_config.h"
#include "httpd.h"
#include "http_config.h"
#include "http_core.h"
#include "http_log.h"
#include "http_request.h"
#include "http_protocol.h"
#include "ap_provider.h"
#include "mod_auth.h"
#endif
/* TODO List
- Track down all of the references to r->ap_auth_type
and change them to ap_auth_type()
- Remove ap_auth_type and ap_auth_name from the
request_rec
*/
typedef struct {
char *ap_auth_type;
char *ap_auth_name;
typedef struct provider_alias_rec {
char *provider_name;
char *provider_alias;
const authn_provider *provider;
typedef struct authn_alias_srv_conf {
{
return (void *)conf;
}
{
/* Create this conf by duplicating the base, replacing elements
* (or creating copies for merging) where new-> values exist.
*/
if (new->ap_auth_type) {
}
if (new->ap_auth_name) {
}
return (void*)conf;
}
const char *password)
{
/* Look up the provider alias in the alias list */
/* Get the the dir_config and call ap_Merge_per_dir_configs() */
/* Call the real provider->check_password() function */
/* return the result of the above function call */
if (provider_name) {
/* If we found the alias provider in the list, then merge the directory
configurations and call the real provider */
if (prvdraliasrec) {
}
}
return ret;
}
{
/* Look up the provider alias in the alias list */
/* Get the the dir_config and call ap_Merge_per_dir_configs() */
/* Call the real provider->get_realm_hash() function */
/* return the result of the above function call */
if (provider_name) {
/* If we found the alias provider in the list, then merge the directory
configurations and call the real provider */
if (prvdraliasrec) {
}
}
return ret;
}
{
return (void *) authcfg;
}
static const authn_provider authn_alias_provider =
{
};
{
const char *args;
char *provider_alias;
char *provider_name;
const char *errmsg;
return err;
}
"> directive missing closing '>'", NULL);
}
if (!args[0]) {
"> directive requires additional arguments", NULL);
}
/* Pull the real provider name and the alias name from the block header */
if (!provider_name[0] || !provider_alias[0]) {
"> directive requires additional arguments", NULL);
}
"The alias provider name must be different from the base provider name.", NULL);
}
/* Look up the alias provider to make sure that it hasn't already been registered. */
if (provider) {
" has already be registered previously as either a base provider or an alias provider.",
NULL);
}
/* walk the subsection configuration to get the per_dir config that we will
merge just before the real provider is called. */
if (!errmsg) {
/* Save off the new directory config along with the original provider name
and function pointer data */
/* Register the fake provider so that we get called first */
}
return errmsg;
}
/*
* Load an authorisation realm into our location configuration, applying the
* usual rules that apply to realms.
*/
const char *word1)
{
return NULL;
}
static const char *authn_ap_auth_type(request_rec *r)
{
}
static const char *authn_ap_auth_name(request_rec *r)
{
}
static const command_rec authn_cmds[] =
{
"An HTTP authorization type (e.g., \"Basic\")"),
"The authentication realm (e.g. \"Members Only\")"),
"Container for authentication directives grouped under "
"a provider alias"),
{NULL}
};
static void register_hooks(apr_pool_t *p)
{
}
{
create_authn_core_dir_config, /* dir config creater */
merge_authn_core_dir_config, /* dir merger --- default is to override */
create_authn_alias_svr_config, /* server config */
NULL, /* merge server config */
register_hooks /* register hooks */
};