diff options
| author | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2010-01-12 15:39:45 +0000 |
|---|---|---|
| committer | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2010-01-12 15:39:45 +0000 |
| commit | 0988cc2ec8650ee7bd30b4869a9b0afec704c89f (patch) | |
| tree | ccd99065bc2561f2504ec100ee26ed6c6eb1cbc4 | |
| parent | 601617843b3bf1e203db821879ffdf63d83d6d04 (diff) | |
Core: in profile.c, profile.h, profileprivate.h, add a new attribute to express signature needs
| -rw-r--r-- | lasso/id-ff/profile.c | 32 | ||||
| -rw-r--r-- | lasso/id-ff/profile.h | 8 | ||||
| -rw-r--r-- | lasso/id-ff/profileprivate.h | 1 |
3 files changed, 41 insertions, 0 deletions
diff --git a/lasso/id-ff/profile.c b/lasso/id-ff/profile.c index ad011499..3998ff1c 100644 --- a/lasso/id-ff/profile.c +++ b/lasso/id-ff/profile.c @@ -501,7 +501,38 @@ init_from_xml(LassoNode *node, xmlNode *xmlnode) return 0; } +/** + * lasso_profile_set_signature_hint: + * @profile: a #LassoProfile object + * @signature_hint: wheter next produced messages should be signed 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_hint(LassoProfile *profile, LassoProfileSignatureHint signature_hint) +{ + if (! LASSO_IS_PROFILE(profile) && ! profile->private_data) + return; + profile->private_data->signature_hint = signature_hint; +} +/** + * lasso_profile_get_signature_hint: + * @profile: a #LassoProfile object + * + * Return the value of the signature hint attribute (see lasso_profile_set_signature_hint()). + * + * Return value: a value in the enum type #LassoProfileSignatureHint. + */ +LassoProfileSignatureHint +lasso_profile_get_signature_hint(LassoProfile *profile) +{ + if (! LASSO_IS_PROFILE(profile) && ! profile->private_data) + return LASSO_PROFILE_SIGNATURE_HINT_MAYBE; + return profile->private_data->signature_hint; +} /*****************************************************************************/ /* overridden parent class methods */ @@ -552,6 +583,7 @@ instance_init(LassoProfile *profile) profile->private_data->dispose_has_run = FALSE; profile->private_data->artifact = NULL; profile->private_data->artifact_message = NULL; + profile->private_data->signature_hint = LASSO_PROFILE_SIGNATURE_HINT_MAYBE; profile->server = NULL; profile->request = NULL; diff --git a/lasso/id-ff/profile.h b/lasso/id-ff/profile.h index 26f30dff..4dfbff80 100644 --- a/lasso/id-ff/profile.h +++ b/lasso/id-ff/profile.h @@ -87,6 +87,11 @@ typedef enum { LASSO_REQUEST_TYPE_IDWSF2_DISCO_QUERY = 15 } LassoRequestType; +typedef enum { + LASSO_PROFILE_SIGNATURE_HINT_MAYBE = 0, + LASSO_PROFILE_SIGNATURE_HINT_FORCE = 1, + LASSO_PROFILE_SIGNATURE_HINT_FORBID = 2 +} LassoProfileSignatureHint; struct _LassoProfile { LassoNode parent; @@ -142,6 +147,9 @@ LASSO_EXPORT char* lasso_profile_get_artifact(LassoProfile *profile); LASSO_EXPORT char* lasso_profile_get_artifact_message(LassoProfile *profile); LASSO_EXPORT void lasso_profile_set_artifact_message(LassoProfile *profile, char *message); LASSO_EXPORT LassoServer* lasso_profile_get_server(LassoProfile *profile); +LASSO_EXPORT void lasso_profile_set_signature_hint(LassoProfile *profile, + LassoProfileSignatureHint signature_hint); +LASSO_EXPORT LassoProfileSignatureHint lasso_profile_get_signature_hint(LassoProfile *profile); #ifdef __cplusplus } diff --git a/lasso/id-ff/profileprivate.h b/lasso/id-ff/profileprivate.h index e130225d..7103e2ca 100644 --- a/lasso/id-ff/profileprivate.h +++ b/lasso/id-ff/profileprivate.h @@ -37,6 +37,7 @@ struct _LassoProfilePrivate char *artifact; char *artifact_message; gboolean dispose_has_run; + LassoProfileSignatureHint signature_hint; }; void lasso_profile_set_response_status(LassoProfile *profile, const gchar *statusCodeValue); |
