## LassoAssertionQuery

LassoAssertionQuery

## Functions

LassoAssertionQuery * | lasso_assertion_query_new ()
void | lasso_assertion_query_destroy ()
lasso_error_t | lasso_assertion_query_init_request ()
lasso_error_t | lasso_assertion_query_validate_request ()
lasso_error_t | lasso_assertion_query_build_request_msg ()
lasso_error_t | lasso_assertion_query_process_request_msg ()
lasso_error_t | lasso_assertion_query_build_response_msg ()
lasso_error_t | lasso_assertion_query_process_response_msg ()
lasso_error_t | lasso_assertion_query_add_attribute_request ()
LassoAssertionQueryRequestType | lasso_assertion_query_get_request_type ()

## Types and Values

enum | LassoAssertionQueryRequestType
struct | LassoAssertionQuery

## Description

## Functions

### lasso_assertion_query_new ()

    LassoAssertionQuery *
    lasso_assertion_query_new (LassoServer *server);

Creates a new LassoAssertionQuery.

#### Parameters

server | the LassoServer |

#### Returns

a newly created LassoAssertionQuery object; or NULL if an error occured

### lasso_assertion_query_destroy ()

    void
    lasso_assertion_query_destroy (LassoAssertionQuery *assertion_query);

Destroys a LassoAssertionQuery object.

#### Parameters

assertion_query | a LassoAssertionQuery |

### lasso_assertion_query_init_request ()

    lasso_error_t
    lasso_assertion_query_init_request (LassoAssertionQuery *assertion_query,
                                        char *remote_provider_id,
                                        LassoHttpMethod http_method,
                                        LassoAssertionQueryRequestType query_request_type);

Initializes a new Assertion Query Request. For the AssertionID request type, the remote_provider_id is mandatory, for all other kind of request it is optional if we can find a provider supporting the associated role, i.e. IDP; authentication, attribute and authorization authority.

#### Parameters

assertion_query | a LassoAssertionQuery |
remote_provider_id | the providerID of the remote provider. | [allow-none]
http_method | if set, then it get the protocol profile in metadata corresponding of this HTTP request method. |
query_request_type | the type of request. |

#### Returns

0 on success; or a negative value otherwise.

### lasso_assertion_query_validate_request ()

    lasso_error_t
    lasso_assertion_query_validate_request
                                   (LassoAssertionQuery *assertion_query);

Processes a Assertion query or request; caller must add assertions to the response afterwards.

#### Parameters

assertion_query | a LassoAssertionQuery |

#### Returns

0 on success; or a negative value otherwise.

### lasso_assertion_query_build_request_msg ()

    lasso_error_t
    lasso_assertion_query_build_request_msg
                                   (LassoAssertionQuery *assertion_query);

Build an Assertion Query profile request message.

#### Parameters

assertion_query | a LassoAssertionQuery |

#### Returns

0 on success; or a negative value otherwise.

### lasso_assertion_query_process_request_msg ()

    lasso_error_t
    lasso_assertion_query_process_request_msg
                                   (LassoAssertionQuery *assertion_query,
                                    gchar *request_msg);

Processes a Assertion query or request message. Rebuilds a request object from the message and check its signature.

#### Parameters

assertion_query | a LassoAssertionQuery |
request_msg | the Assertion query or request message |

#### Returns

0 on success; or a negative value otherwise.

### lasso_assertion_query_build_response_msg ()

    lasso_error_t
    lasso_assertion_query_build_response_msg
                                   (LassoAssertionQuery *assertion_query);

Builds the Response message.

#### Parameters

assertion_query | a LassoAssertionQuery |

#### Returns

0 on success; or a negative value otherwise.

### lasso_assertion_query_process_response_msg ()

    lasso_error_t
    lasso_assertion_query_process_response_msg
                                   (LassoAssertionQuery *assertion_query,
                                    gchar *response_msg);

Parses the response message and builds the corresponding response object.

#### Parameters

assertion_query | a LassoAssertionQuery |
response_msg | the response message |

#### Returns

0 on success; or a negative value otherwise.

### lasso_assertion_query_add_attribute_request ()

    lasso_error_t
    lasso_assertion_query_add_attribute_request
                                   (LassoAssertionQuery *assertion_query,
                                    char *format,
                                    char *name);

Append a new attribute designator to the current attribute request.

#### Parameters

assertion_query | a LassoAssertionQuery object |
attribute_format | the attribute designator format |
attribute_name | the attribute designator name |

#### Returns

0 if successful, an error code otherwise.

### lasso_assertion_query_get_request_type ()

    LassoAssertionQueryRequestType
    lasso_assertion_query_get_request_type
                                   (LassoAssertionQuery *assertion_query);

Return the type of the last processed request.

#### Parameters

assertion_query | a LassoAssertionQuery object |

#### Returns

a LassoAssertionQueryRequestType value

## Types and Values

### enum LassoAssertionQueryRequestType

Enumerate the existing kind of AssertionQuery requests.

#### Members

LASSO_ASSERTION_QUERY_REQUEST_TYPE_UNSET | the unknown value |
LASSO_ASSERTION_QUERY_REQUEST_TYPE_ASSERTION_ID | an AssertionID request, to retrieve an assertion by its ID. |
LASSO_ASSERTION_QUERY_REQUEST_TYPE_AUTHN | an AuthnQuery request, which is used to request existing authentication assertions about a given subject from an Authentication Authority |
LASSO_ASSERTION_QUERY_REQUEST_TYPE_ATTRIBUTE | an AttributeQuery, which is used to retrieve attribute an a principal. |
LASSO_ASSERTION_QUERY_REQUEST_TYPE_AUTHZ_DECISION | an AuthzDecisionQuery, which is used to request authorisation to let a principal access a certain resource. |
LASSO_ASSERTION_QUERY_REQUEST_TYPE_LAST |  |

### struct LassoAssertionQuery

    struct LassoAssertionQuery {
    	LassoProfile parent;
    };