Obligations
[Common Library Functions and Constants]


Functions

xacml_result_t xacml_obligation_init (xacml_obligation_t *obligation, const char *obligation_id, xacml_effect_t fulfill_on)
void xacml_obligation_destroy (xacml_obligation_t obligation)
xacml_result_t xacml_obligation_add_attribute (xacml_obligation_t obligation, const char *attribute_id, const char *data_type, const char *value)
xacml_result_t xacml_obligation_get_attribute_count (const xacml_obligation_t obligation, size_t *count)
xacml_result_t xacml_obligation_get_attribute (const xacml_obligation_t obligation, size_t num, const char **attribute_id, const char **data_type, const char **value)
xacml_result_t xacml_obligation_get_id (const xacml_obligation_t obligation, const char **obligation_id)
xacml_result_t xacml_obligation_get_effect (const xacml_obligation_t obligation, xacml_effect_t *fulfill_on)

Function Documentation

xacml_result_t xacml_obligation_add_attribute ( xacml_obligation_t  obligation,
const char *  attribute_id,
const char *  data_type,
const char *  value 
)

Add an attribute value to an obligation

Adds a new attribute to an obligation.

Parameters:
obligation Obligation to add the attribute value to.
attribute_id String defining the identifier of the attribute.
data_type String defining the data type of the attribute's value. See Attribute Data Types for standard XACML data type names.
value String defining the attribute value.
Return values:
XACML_RESULT_SUCCESS Success
XACML_RESULT_INVALID_PARAMETER Invalid parameter

References XACML_RESULT_INVALID_PARAMETER, and XACML_RESULT_SUCCESS.

void xacml_obligation_destroy ( xacml_obligation_t  obligation  ) 

Destroy an obligation

Frees resources associated with an obligation. After calling this, the obligation value must not be used by the caller.

Parameters:
obligation Obligation to destroy.
Returns:
void
See also:
xacml_obligation_init().

xacml_result_t xacml_obligation_get_attribute ( const xacml_obligation_t  obligation,
size_t  num,
const char **  attribute_id,
const char **  data_type,
const char **  value 
)

Get the value of an attribute

Retrieves the information related to an attribute, based on the attribute's index. The total number of attributes can be determined by calling xacml_obligation_get_attribute_count().

Parameters:
obligation The obligation to inspect.
num Attribute index.
attribute_id Pointer to be set to the id of the attribute. The caller must not modify or free this value.
data_type Pointer to be set to the data type of the attribute. The caller must not modify or free this value. See Attribute Data Types for standard values this may be set to.
value Pointer to be set to the value of the attribute. The caller must not modify or free this value.
Return values:
XACML_RESULT_SUCCESS Success.
XACML_RESULT_INVALID_PARAMETER Invalid parameter.
See also:
xacml_obligation_add_attribute(), xacml_obligation_get_attribute_count()

References XACML_RESULT_INVALID_PARAMETER, and XACML_RESULT_SUCCESS.

xacml_result_t xacml_obligation_get_attribute_count ( const xacml_obligation_t  obligation,
size_t *  count 
)

Count the number of attributes in an obligation

Modifies the value pointed to by count to contain the number of attributes in obligation. Values from 0 to the value returned in count can be passed to xacml_obligatino_get_attribute() to iterate through the set of attributes in an obligation.

Parameters:
obligation Obligation to inspect.
count Pointer to be set to the number of attributes.
Return values:
XACML_RESULT_SUCCESS Success.
XACML_RESULT_INVALID_PARAMETER Invalid parameter.
See also:
xacml_obligation_get_attribute()

References XACML_RESULT_INVALID_PARAMETER, and XACML_RESULT_SUCCESS.

xacml_result_t xacml_obligation_get_effect ( const xacml_obligation_t  obligation,
xacml_effect_t fulfill_on 
)

Get the effect when an obligation applies

Modifies the value pointed to by fulfill_on to contain the effect associated with the obligation.

Parameters:
obligation Obligation to inspect.
fulfill_on Pointer to be set to the effect of the obligation.
Return values:
XACML_RESULT_SUCCESS Success.
XACML_RESULT_INVALID_PARAMETER Invalid parameter.
See also:
xacml_obligation_init()

References XACML_RESULT_INVALID_PARAMETER, and XACML_RESULT_SUCCESS.

xacml_result_t xacml_obligation_get_id ( const xacml_obligation_t  obligation,
const char **  obligation_id 
)

Get the id of an obligation

Modifies the value pointed to by obligation_id to contain the identifier associated with the obligation. The caller must not modify or free the value returned via obligation

Parameters:
obligation Obligation to inspect.
obligation_id Pointer to be set to the ID of the obligation.
Return values:
XACML_RESULT_SUCCESS Success.
XACML_RESULT_INVALID_PARAMETER Invalid parameter.
See also:
xacml_obligation_init()

References XACML_RESULT_INVALID_PARAMETER, and XACML_RESULT_SUCCESS.

xacml_result_t xacml_obligation_init ( xacml_obligation_t obligation,
const char *  obligation_id,
xacml_effect_t  fulfill_on 
)

Initialize an obligation

Creates an obligation structure which can be used to contain a set of attributes related to a single obligation. When the obligation is no longer needed, the caller must destroy it by calling xacml_obligation_destroy().

Parameters:
obligation Response to initialize. The value pointed to by this can be passed to other xacml_obligation_* functions.
obligation_id Obligation identifier.
fulfill_on The effect for which the obligation must be fulfilled.
Return values:
XACML_RESULT_SUCCESS Success
XACML_RESULT_INVALID_PARAMETER Invalid parameter
See also:
xacml_obligation_destroy().

References XACML_EFFECT_Deny, XACML_EFFECT_Permit, XACML_RESULT_INVALID_PARAMETER, and XACML_RESULT_SUCCESS.