diff options
| -rw-r--r-- | bindings/overrides.xml | 1 | ||||
| -rw-r--r-- | lasso/id-ff/profile.c | 26 | ||||
| -rw-r--r-- | lasso/id-ff/profile.h | 1 |
3 files changed, 28 insertions, 0 deletions
diff --git a/bindings/overrides.xml b/bindings/overrides.xml index 4e5018ba..4f59be7b 100644 --- a/bindings/overrides.xml +++ b/bindings/overrides.xml @@ -24,6 +24,7 @@ <!-- LassoProvider --> <func name="lasso_provider_get_metadata_list" return_owner="false"/> <!-- LassoProfile --> + <func name="lasso_profile_get_server" skip="true"/> <func name="lasso_profile_get_nameIdentifier" rename="lasso_profile_get_federation_nameIdentifier" return_owner="false" /> diff --git a/lasso/id-ff/profile.c b/lasso/id-ff/profile.c index 650c29f7..b616228c 100644 --- a/lasso/id-ff/profile.c +++ b/lasso/id-ff/profile.c @@ -417,6 +417,32 @@ lasso_profile_set_artifact_message(LassoProfile *profile, char *message) profile->private_data->artifact_message = g_strdup(message); } +/** + * lasso_profile_get_server: + * @profile: a #LassoProfile object + * + * Return the #LassoServer linked to this profile object. A profile object should always contains + * one. It allows to find metadatas of other providers and to know our own metadatas. + * + * Return value: a #LassoServer or NULL if profile is not a #LassoProfile or no #LassoServer object + * was setup at the creation of this profile. + */ +LassoServer* +lasso_profile_get_server(LassoProfile *profile) +{ + g_return_val_if_fail(LASSO_IS_PROFILE(profile), NULL); + + if (profile->server) { + if (LASSO_IS_SERVER(profile->server)) { + return profile->server; + } else { + message(G_LOG_LEVEL_WARNING, "profile->server contains a non LassoServer object"); + } + } + + return NULL; +} + /*****************************************************************************/ /* private methods */ diff --git a/lasso/id-ff/profile.h b/lasso/id-ff/profile.h index 758af182..1a327cda 100644 --- a/lasso/id-ff/profile.h +++ b/lasso/id-ff/profile.h @@ -141,6 +141,7 @@ LASSO_EXPORT LassoNode* lasso_profile_get_nameIdentifier(LassoProfile *profile); 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); #ifdef __cplusplus } |
