4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster/* -*- Mode: C -*-
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * The contents of this file are subject to the terms
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * of the Common Development and Distribution License
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * (the License). You may not use this file except in
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * compliance with the License.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * You can obtain a copy of the License at
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * https://opensso.dev.java.net/public/CDDLv1.0.html or
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * See the License for the specific language governing
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * permission and limitations under the License.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * When distributing Covered Code, include this CDDL
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * Header Notice in each file and include the License file
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * If applicable, add the following below the CDDL Header,
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * with the fields enclosed by brackets [] replaced by
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * your own identifying information:
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * "Portions Copyrighted [year] [name of copyright owner]"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * $Id: am.h,v 1.4 2008/08/19 19:11:35 veiming Exp $
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * General utility routines provided by the OpenSSO
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * Access Management library.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_POLICY_PROPERTY_PREFIX "com.sun.am.policy.am."
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_AUTH_PROPERTY_PREFIX "com.sun.am.auth."
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_SSO_PROPERTY_PREFIX "com.sun.am.sso."
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_LOG_PROPERTY_PREFIX "com.sun.am.log."
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster/* Common Properties */
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_SSL_CERT_DIR_PROPERTY AM_COMMON_PROPERTY_PREFIX "sslcert.dir"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_SSL_CERT_DIR_PROPERTY_OLD AM_COMMON_PROPERTY_PREFIX "sslCertDir"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_CERT_DB_PREFIX_PROPERTY AM_COMMON_PROPERTY_PREFIX "certdb.prefix"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_CERT_DB_PREFIX_PROPERTY_OLD AM_COMMON_PROPERTY_PREFIX "certDbPrefix"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_TRUST_SERVER_CERTS_PROPERTY AM_COMMON_PROPERTY_PREFIX "trust_server_certs"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_TRUST_SERVER_CERTS_PROPERTY_OLD AM_COMMON_PROPERTY_PREFIX "trustServerCerts"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_COOKIE_NAME_PROPERTY AM_COMMON_PROPERTY_PREFIX "cookie.name"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_COOKIE_NAME_PROPERTY_OLD AM_COMMON_PROPERTY_PREFIX "cookieName"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_COOKIE_SECURE_PROPERTY AM_COMMON_PROPERTY_PREFIX "cookie.secure"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_CERT_DB_PASSWORD_PROPERTY AM_COMMON_PROPERTY_PREFIX "certdb.password"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_CERT_DB_PASSWORD_PROPERTY_OLD AM_COMMON_PROPERTY_PREFIX "certDBPassword"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_NAMING_URL_PROPERTY AM_COMMON_PROPERTY_PREFIX "naming.url"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_NAMING_URL_PROPERTY_OLD AM_COMMON_PROPERTY_PREFIX "namingURL"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_NOTIFICATION_ENABLE_PROPERTY AM_COMMON_PROPERTY_PREFIX "notification.enable"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_NOTIFICATION_ENABLE_PROPERTY_OLD AM_COMMON_PROPERTY_PREFIX "notificationEnabled"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_NOTIFICATION_URL_PROPERTY AM_COMMON_PROPERTY_PREFIX "notification.url"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_NOTIFICATION_URL_PROPERTY_OLD AM_COMMON_PROPERTY_PREFIX "notificationURL"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_LOADBALANCE_PROPERTY AM_COMMON_PROPERTY_PREFIX "load_balancer.enable"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_LOADBALANCE_PROPERTY_OLD AM_COMMON_PROPERTY_PREFIX "loadBalancer_enable"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_IGNORE_NAMING_SERVICE_PROPERTY AM_COMMON_PROPERTY_PREFIX "ignore.naming_service"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_RECEIVE_TIMEOUT_PROPERTY AM_COMMON_PROPERTY_PREFIX "receive_timeout"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_TCP_NODELAY_ENABLE_PROPERTY AM_COMMON_PROPERTY_PREFIX "tcp_nodelay.enable"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_CONNECT_TIMEOUT_PROPERTY AM_COMMON_PROPERTY_PREFIX "connect_timeout"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_IGNORE_SERVER_CHECK AM_COMMON_PROPERTY_PREFIX "ignore_server_check"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_POLL_PRIMARY_SERVER AM_COMMON_PROPERTY_PREFIX "poll_primary_server"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster/* Log Properties */
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_LOG_LEVELS_PROPERTY AM_COMMON_PROPERTY_PREFIX "log.level"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_LOG_LEVELS_PROPERTY_OLD AM_COMMON_PROPERTY_PREFIX "logLevels"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_IGNORE_PATH_INFO_OLD AM_COMMON_PROPERTY_PREFIX "ignore_path_info"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_LOG_FILE_PROPERTY_OLD AM_COMMON_PROPERTY_PREFIX "logFile"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_SERVER_LOG_FILE_PROPERTY_OLD AM_COMMON_PROPERTY_PREFIX "serverLogFile"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster/* Authentication Properties */
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_AUTH_ORGANIZATION_NAME_PROPERTY AM_AUTH_PROPERTY_PREFIX "org.name"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_AUTH_ORGANIZATION_NAME_PROPERTY_OLD AM_AUTH_PROPERTY_PREFIX "orgName"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_AUTH_CERT_ALIAS_PROPERTY AM_AUTH_PROPERTY_PREFIX "certificate.alias"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_AUTH_CERT_ALIAS_PROPERTY_OLD AM_AUTH_PROPERTY_PREFIX "certificateAlias"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_AUTH_SERVICE_URLS_PROPERTY AM_AUTH_PROPERTY_PREFIX "auth_service.url"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_AUTH_SERVICE_URLS_PROPERTY_OLD AM_AUTH_PROPERTY_PREFIX "authServiceURL"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster/* Policy Properties */
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_POLICY_URL_COMPARISON_CASE_IGNORE_PROPERTY AM_POLICY_PROPERTY_PREFIX "url_comparison.case_ignore"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_POLICY_URL_COMPARISON_CASE_IGNORE_PROPERTY_OLD AM_POLICY_PROPERTY_PREFIX "urlComparison.caseIgnore"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_POLICY_PROFILE_ATTRS_MODE_OLD AM_POLICY_PROPERTY_PREFIX "ldapattribute.mode"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_POLICY_PROFILE_ATTRS_MAP_OLD AM_POLICY_PROPERTY_PREFIX "headerAttributes"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_POLICY_PROFILE_ATTRS_COOKIE_PFX_OLD AM_POLICY_PROPERTY_PREFIX "ldapattribute.cookiePrefix"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_POLICY_PROFILE_ATTRS_COOKIE_MAX_AGE_OLD AM_POLICY_PROPERTY_PREFIX "ldapattribute.cookieMaxAge"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_POLICY_HASH_BUCKET_SIZE_PROPERTY AM_POLICY_PROPERTY_PREFIX "hash_bucket.size"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_POLICY_HASH_BUCKET_SIZE_PROPERTY_OLD AM_POLICY_PROPERTY_PREFIX "hashBucketSize"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_POLICY_HASH_TIMEOUT_MINS_PROPERTY AM_POLICY_PROPERTY_PREFIX "polling.interval"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_POLICY_HASH_TIMEOUT_MINS_PROPERTY_OLD AM_POLICY_PROPERTY_PREFIX "cacheEntryLifeTime"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_POLICY_LOGIN_URL_PROPERTY AM_POLICY_PROPERTY_PREFIX "login.url"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_POLICY_LOGIN_URL_PROPERTY_OLD AM_POLICY_PROPERTY_PREFIX "loginURL"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_POLICY_PASSWORD_PROPERTY AM_POLICY_PROPERTY_PREFIX "password"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_POLICY_USER_NAME_PROPERTY AM_POLICY_PROPERTY_PREFIX "username"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_POLICY_ORG_NAME_PROPERTY AM_POLICY_PROPERTY_PREFIX "org.name"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_POLICY_MODULE_NAME_PROPERTY AM_POLICY_PROPERTY_PREFIX "auth_module"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_POLICY_MAX_THREADS_PROPERTY AM_POLICY_PROPERTY_PREFIX "max_threads"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_POLICY_USER_ID_PARAM_PROPERTY AM_POLICY_PROPERTY_PREFIX "userid.param"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_POLICY_USER_ID_PARAM_PROPERTY_OLD AM_POLICY_PROPERTY_PREFIX "userIdParam"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_POLICY_USER_ID_PARAM_TYPE_PROPERTY AM_POLICY_PROPERTY_PREFIX "userid.param.type"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_POLICY_USER_ID_PARAM_TYPE_PROPERTY_OLD AM_POLICY_PROPERTY_PREFIX "userIdParamType"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_POLICY_FETCH_FROM_ROOT_RSRC_PROPERTY AM_POLICY_PROPERTY_PREFIX "fetch_from_root_resource"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_POLICY_FETCH_FROM_ROOT_RSRC_PROPERTY_OLD AM_POLICY_PROPERTY_PREFIX "fetchFromRootResource"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_SSO_HASH_BUCKET_SIZE_PROPERTY AM_SSO_PROPERTY_PREFIX "hash_bucket.size"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_SSO_HASH_BUCKET_SIZE_PROPERTY_OLD AM_SSO_PROPERTY_PREFIX "hashBucketSize"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_SSO_HASH_TIMEOUT_MINS_PROPERTY AM_SSO_PROPERTY_PREFIX "cache_entry.lifetime"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_SSO_HASH_TIMEOUT_MINS_PROPERTY_OLD AM_SSO_PROPERTY_PREFIX "cacheEntryLifeTime"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_SSO_MAX_THREADS_PROPERTY AM_SSO_PROPERTY_PREFIX "max_threads"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_SSO_MAX_THREADS_PROPERTY_OLD AM_SSO_PROPERTY_PREFIX "maxThreads"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_SSO_CHECK_CACHE_INTERVAL_PROPERTY AM_SSO_PROPERTY_PREFIX "polling.period"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_SSO_CHECK_CACHE_INTERVAL_PROPERTY_OLD AM_SSO_PROPERTY_PREFIX "checkCacheInterval"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_SSO_DEFAULT_SESSION_URL AM_SSO_PROPERTY_PREFIX "default_session.url"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_SSO_DEFAULT_SESSION_URL_OLD AM_SSO_PROPERTY_PREFIX "defaultSessionURL"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#define AM_COMMON_IGNORE_PREFERRED_NAMING_URL_PROPERTY AM_COMMON_PROPERTY_PREFIX "ignore.preferred_naming_url"
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * This function must be called at the end of the program to
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * release memory used by am_sso_init, am_auth_init, and/or am_policy_init().
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * This should be called only once.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * Any properties input parameter given to the init functions am_sso_init()
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * am_auth_init() or am_policy_init() should be destroyed only after
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * am_cleanup is called.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * Parameters:
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * XML message containing the notification message.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * policy_handle_t
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * The policy handle created from am_policy_service_init().
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * NULL if policy is not initialized or not used.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * AM_SUCCESS
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * if XML message was successfully parsed and processed.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * AM_INVALID_ARGUMENT
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * if any input parameter is invalid.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * AM_FAILURE
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * if any other error occurred.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#endif /* not AM_H */