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_policy.h,v 1.4 2008/08/19 19:11:37 veiming Exp $
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * Types and functions for using OpenSSO Access
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * Management SDK policy objects.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * For explaination on each of these values see the comments in the
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * function am_policy_compare_urls.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster am_resource_match_t (*cmp_func_ptr)(const struct am_resource_traits *rsrc_traits,
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster boolean_t (*has_patterns)(const char *resource_name);
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster boolean_t (*get_resource_root)(const char *resource_name,
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster void (*canonicalize)(const char *resource, char **c_resource);
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * Opaque handle for a policy evaluation object.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * Destroy am_policy_result internal structures.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan FosterAM_EXPORT void am_policy_result_destroy(am_policy_result_t *result);
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * Method to initialize the policy evaluation engine.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosteram_policy_init(am_properties_t policy_config_properties);
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * Method to initialize one specific instance of service for
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * policy evaluation.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosteram_policy_service_init(const char *service_name,
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * Method to close an initialized policy evaluator
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * Method to evaluate a non-boolean policy question for a resource.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosteram_policy_evaluate_ignore_url_notenforced(am_policy_t policy_handle,
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * Method to evaluate a non-boolean policy question for a resource.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * Method to check if notification is enabled in the SDK.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * If notification is enabled returns non-zero, otherwise zero.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosteram_policy_is_notification_enabled(am_policy_t policy_handle);
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * Method to refresh policy cache when a policy notification is received
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * by the client.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * Method will take two url resources compare and return an appropriate
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * result. The use_patterns is AM_TRUE, this method will consider occurances
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * of '*' in the policy resource name as wildcards. If usePatterns is
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * AM_FALSE, '*' occurances are taken as a literal characters.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * EXACT_MATCH - If both the resource names exactly matched.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * SUB_RESOURCE_MATCH - If the resourceName is a sub-resource to the resource
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * name defined in the policy.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * SUPER_RESOURCE_MATCH - If the resourcName is a ancestor of the policy
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * resource name.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * NO_MATCH - If the there is no kind of match between the policy resource
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * and the requested resource name.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * EXACT_PATTERN_MATCH - This result will be returned only if the policy is
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * matches resource name. Distinction is not made
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * whether it was a EXACT_MATCH or a pattern match.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * Note: In cases of SUB/SUPER_RESOURCE_MATCH, if the usePatterns is
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * AM_TRUE, the patterns are sub/super matching patterns.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosteram_policy_compare_urls(const am_resource_traits_t *rsrc_traits,
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * Given a url resource name, this method will populate the pointer
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * resourceRoot with the resource root.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster * Successful root extraction will return AM_TRUE and AM_FALSE otherwise.
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosteram_policy_get_url_resource_root(const char *resource_name,
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosteram_policy_resource_has_patterns(const char *resource_name);
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosteram_policy_resource_canonicalize(const char *, char **);
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Fosteram_policy_invalidate_session(am_policy_t policy_handle,
4fe4e4f798a84a46e567f64ceadd3648eb0582d4Allan Foster#endif /* not AM_POLICY_H */