/* 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_expr.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 {
int auth_type_set;
typedef struct provider_alias_rec {
char *provider_name;
char *provider_alias;
typedef struct authn_alias_srv_conf {
{
return (void *)conf;
}
{
if (new->auth_type_set) {
}
else {
}
if (new->ap_auth_name) {
} else {
}
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;
}
/* Only per-server directive we have is GLOBAL_ONLY */
{
return basev;
}
{
};
{
NULL,
};
{
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) {
if (!provider) {
/* by the time they use it, the provider should be loaded and
registered with us. */
"Unknown Authn provider: %s",
}
/* 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)
{
if (expr_err) {
}
return NULL;
}
const char *word1)
{
if (expr_err) {
}
return NULL;
}
{
if (conf->ap_auth_type) {
if (err) {
APLOG_MARK, APLOG_ERR, APR_SUCCESS, r, APLOGNO(02834) "AuthType expression could not be evaluated: %s", err);
return NULL;
}
}
return NULL;
}
{
if (conf->ap_auth_name) {
if (err) {
APLOG_MARK, APLOG_ERR, APR_SUCCESS, r, APLOGNO(02835) "AuthName expression could not be evaluated: %s", err);
return NULL;
}
}
return NULL;
}
{
"an HTTP authorization type (e.g., \"Basic\")"),
"the authentication realm (e.g. \"Members Only\")"),
"container for grouping an authentication provider's "
"directives under a provider alias"),
{NULL}
};
{
/* if there isn't an AuthType, then assume that no authentication
is required so return OK */
if (!ap_auth_type(r)) {
return OK;
}
/* there's an AuthType configured, but no authentication module
* loaded to support it
*/
"AuthType %s configured without corresponding module",
ap_auth_type(r));
return HTTP_INTERNAL_SERVER_ERROR;
}
{
}
{
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 */
merge_authn_alias_svr_config, /* merge server config */
register_hooks /* register hooks */
};