Resource Attributes
[Common Library Functions and Constants]


Defines

#define XACML_RESOURCE_ATTRIBUTE_RESOURCE_ID   "urn:oasis:names:tc:xacml:1.0:resource:resource-id"
#define XACML_RESOURCE_ATTRIBUTE_TARGETN_NAMESPACE   "urn:oasis:names:tc:xacml:2.0:resource:target-namespace"

Functions

xacml_result_t xacml_resource_attribute_init (xacml_resource_attribute_t *attribute)
xacml_result_t xacml_resource_attribute_add (xacml_resource_attribute_t attribute, const char *attribute_id, const char *data_type, const char *issuer, const char *value)
void xacml_resource_attribute_destroy (xacml_resource_attribute_t attribute)
xacml_result_t xacml_resource_attribute_get_count (xacml_resource_attribute_t attribute, size_t *count)
xacml_result_t xacml_resource_attribute_get_attribute (const xacml_resource_attribute_t attribute, size_t num, const char **attribute_id, const char **data_type, const char **issuer, const char **value)

Detailed Description

These macros define constants which can be used for XACML 2.0-compliant subject category attributes. See Appendex B.6 of http://docs.oasis-open.org/xacml/2.0/access_control-xacml-2.0-core-spec-os.pdf for details.

See also:
xacml_request_add_resource_attribute()

Define Documentation

#define XACML_RESOURCE_ATTRIBUTE_RESOURCE_ID   "urn:oasis:names:tc:xacml:1.0:resource:resource-id"

Resource ID

#define XACML_RESOURCE_ATTRIBUTE_TARGETN_NAMESPACE   "urn:oasis:names:tc:xacml:2.0:resource:target-namespace"

Target Namespace


Function Documentation

xacml_result_t xacml_resource_attribute_add ( xacml_resource_attribute_t  attribute,
const char *  attribute_id,
const char *  data_type,
const char *  issuer,
const char *  value 
)

Add an attribute value to a resource attribute

Adds a new attribute to a resource attribute set.

Parameters:
attribute Resource attribute to add the attribute value to.
attribute_id String defining the identifier of the attribute. See Resource Attributes for standard attribute IDs.
data_type String defining the data type of the attribute's value. See Attribute Data Types for standard XACML data type names.
issuer String defining the issuer of the resource attribute. This may be NULL.
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_resource_attribute_destroy ( xacml_resource_attribute_t  attribute  ) 

Destroy an resource attribute

Frees resources associated with a resource attribute set. After calling this, the attribute value must not be used by the caller.

Parameters:
attribute Resource attribute to destroy.
Returns:
void
See also:
xacml_resource_attribute_init().

xacml_result_t xacml_resource_attribute_get_attribute ( const xacml_resource_attribute_t  attribute,
size_t  num,
const char **  attribute_id,
const char **  data_type,
const char **  issuer,
const char **  value 
)

Get the value of a resource attribute

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

Parameters:
attribute The XACML query request 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. See Resource Attributes for standard values this may be set to.
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.
issuer Pointer to be set to the issuer of the attribute. The caller must not modify or free this value.
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_resource_attribute_get_count()

References XACML_RESULT_INVALID_PARAMETER, and XACML_RESULT_SUCCESS.

xacml_result_t xacml_resource_attribute_get_count ( xacml_resource_attribute_t  attribute,
size_t *  count 
)

Count the number of attributes in a resource attribute set.

Modifies the value pointed to by count to contain the number of subject attribute in request. Values from 0 to the value returned in count can be passed to xacml_request_get_subject_attribute() to iterate through the set of subject attributes in a request.

Parameters:
attribute Resource attribute 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_resource_attribute_get_attribute()

References XACML_RESULT_INVALID_PARAMETER, and XACML_RESULT_SUCCESS.

xacml_result_t xacml_resource_attribute_init ( xacml_resource_attribute_t attribute  ) 

Initialize an XACML resource attribute

Creates an XACML resource attribute which can contain a set of attributes of a single resource. The resource attributes can be added to an XACML query request by calling xacml_request_add_resource_attribute().

Parameters:
attribute Resource attribute to initialize. The value pointed to this can be passed to other xacml_resource_attribute_* functions.
Return values:
XACML_RESULT_SUCCESS Success
XACML_RESULT_INVALID_PARAMETER Invalid parameter
See also:
xacml_resource_attribute_destroy()

References XACML_RESULT_INVALID_PARAMETER, and XACML_RESULT_SUCCESS.