Add signature_verify_hint accessor methods to LassoProfile

* lasso/id-ff/profile.{c,h}:
   add a LassoProfileSignatureVerifyHint enumeration and two accessor
   methods:
    - lasso_profile_get_signature_verify_hint
    - lasso_profile_set_signature_verify_hint
 * lasso/id-ff/profileprivate.h:
   add private field signature_verify_hint.
This commit is contained in:
Benjamin Dauvergne 2010-03-27 16:51:34 +00:00
parent 7930eba5a3
commit d5994b2bae
4 changed files with 57 additions and 1 deletions

View File

@ -87,6 +87,8 @@ lasso_profile_set_artifact_message
lasso_profile_get_server
lasso_profile_set_signature_hint
lasso_profile_get_signature_hint
lasso_profile_set_signature_verify_hint
lasso_profile_get_signature_verify_hint
LassoProfileSignatureHint
<SUBSECTION Standard>
LASSO_PROFILE

View File

@ -625,6 +625,41 @@ lasso_profile_get_signature_hint(LassoProfile *profile)
return profile->private_data->signature_hint;
}
/**
* lasso_profile_set_signature_verify_hint:
* @profile: a #LassoProfile object
* @signature_verify_hint: whether next received message signatures should be checked or not (or let
* Lasso choose from implicit information).
*
* By default each profile will choose to sign or not its messages, this method allow to force or
* forbid the signature of messages, on a per transaction basis.
*/
void
lasso_profile_set_signature_verify_hint(LassoProfile *profile, LassoProfileSignatureVerifyHint signature_verify_hint)
{
if (! LASSO_IS_PROFILE(profile) && ! profile->private_data)
return;
profile->private_data->signature_verify_hint = signature_verify_hint;
}
/**
* lasso_profile_get_signature_verify_hint:
* @profile: a #LassoProfile object
*
* Return the value of the signature verify hint attribute (see
* lasso_profile_set_signature_verify_hint()).
*
* Return value: a value in the enum type #LassoProfileSignatureVerifyHint.
*/
LassoProfileSignatureVerifyHint
lasso_profile_get_signature_verify_hint(LassoProfile *profile)
{
if (! LASSO_IS_PROFILE(profile) && ! profile->private_data)
return LASSO_PROFILE_SIGNATURE_HINT_MAYBE;
return profile->private_data->signature_verify_hint;
}
/**
* lasso_profile_set_soap_fault_response:
* @profile: a #LassoProfile object

View File

@ -98,7 +98,7 @@ typedef enum {
* @LASSO_PROFILE_SIGNATURE_HINT_FORCE: generate and validate all signatures.
* @LASSO_PROFILE_SIGNATURE_HINT_FORBID: do not generate or validate any signature.
*
* Advice a #LassoProfile object about the policy for generating and validating request and response
* Advice a #LassoProfile object about the policy for generating request and response
* signatures.
*/
typedef enum {
@ -107,6 +107,21 @@ typedef enum {
LASSO_PROFILE_SIGNATURE_HINT_FORBID = 2
} LassoProfileSignatureHint;
/**
* LassoProfileSignatureVerifyHint:
* @LASSO_PROFILE_SIGNATURE_VERIFY_HINT_MAYBE: let Lasso decide what to do.
* @LASSO_PROFILE_SIGNATURE_VERIFY_HINT_IGNORE: check signatures but do not stop protocol handling
* on failures. The result of signature checking is still available in
* #LassoProfile.signature_status
*
* Advice a #LassoProfile object about the policy checking request and response
* signatures.
*/
typedef enum {
LASSO_PROFILE_SIGNATURE_VERIFY_HINT_MAYBE = 0,
LASSO_PROFILE_SIGNATURE_VERIFY_HINT_IGNORE = 1
} LassoProfileSignatureVerifyHint;
/**
* LassoProfile:
* @server: #LassoServer object representing the provider intiating this profile,
@ -185,6 +200,9 @@ LASSO_EXPORT void lasso_profile_set_signature_hint(LassoProfile *profile,
LASSO_EXPORT LassoProfileSignatureHint lasso_profile_get_signature_hint(LassoProfile *profile);
LASSO_EXPORT gint lasso_profile_set_soap_fault_response(LassoProfile *profile, const char
*faultcode, const char *faultstring, GList *details);
LASSO_EXPORT void lasso_profile_set_signature_verify_hint(LassoProfile *profile,
LassoProfileSignatureVerifyHint signature_verify_hint);
LASSO_EXPORT LassoProfileSignatureVerifyHint lasso_profile_get_signature_verify_hint(LassoProfile *profile);
#ifdef __cplusplus
}

View File

@ -38,6 +38,7 @@ struct _LassoProfilePrivate
char *artifact_message;
gboolean dispose_has_run;
LassoProfileSignatureHint signature_hint;
LassoProfileSignatureVerifyHint signature_verify_hint;
};
void lasso_profile_set_response_status(LassoProfile *profile, const gchar *statusCodeValue);