diff options
| author | Frederic Peters <fpeters@entrouvert.com> | 2005-01-26 10:05:45 +0000 |
|---|---|---|
| committer | Frederic Peters <fpeters@entrouvert.com> | 2005-01-26 10:05:45 +0000 |
| commit | e537d4ecf80c41bad055d1f2d3b165482235f51c (patch) | |
| tree | c8e3a898fe48119086e925b47c4ce951d7f0b55c | |
| parent | 88bbd4c1d879cd45eb00748fe32415640b57e26f (diff) | |
| download | lasso-e537d4ecf80c41bad055d1f2d3b165482235f51c.tar.gz lasso-e537d4ecf80c41bad055d1f2d3b165482235f51c.tar.xz lasso-e537d4ecf80c41bad055d1f2d3b165482235f51c.zip | |
new lasso_session_get_assertions, returns GList* of (incref'd) assertions
| -rw-r--r-- | docs/reference/lasso-sections.txt | 1 | ||||
| -rw-r--r-- | lasso/id-ff/session.c | 23 | ||||
| -rw-r--r-- | lasso/id-ff/session.h | 4 |
3 files changed, 26 insertions, 2 deletions
diff --git a/docs/reference/lasso-sections.txt b/docs/reference/lasso-sections.txt index 8f0372ab..9a551181 100644 --- a/docs/reference/lasso-sections.txt +++ b/docs/reference/lasso-sections.txt @@ -75,6 +75,7 @@ lasso_session_new lasso_session_new_from_dump lasso_session_destroy lasso_session_dump +lasso_session_get_assertions lasso_session_get_provider_index lasso_session_is_empty <SUBSECTION Standard> diff --git a/lasso/id-ff/session.c b/lasso/id-ff/session.c index 6885b50a..73045d13 100644 --- a/lasso/id-ff/session.c +++ b/lasso/id-ff/session.c @@ -85,7 +85,6 @@ lasso_session_add_status(LassoSession *session, char *providerID, LassoSamlpStat } - /** * lasso_session_get_assertion * @session: a #LassoSession @@ -103,6 +102,28 @@ lasso_session_get_assertion(LassoSession *session, gchar *providerID) return g_hash_table_lookup(session->assertions, providerID); } + +/** + * lasso_session_get_assertions + * @session: a #LassoSession + * @provider_id: the provider ID + * + * Gets the assertions for the given @provider_id. + * + * Return value: a GList* of #LassoSamlAssertion. Caller must free the GList + * and the assertions it contains. + **/ +GList* +lasso_session_get_assertions(LassoSession *session, const char *provider_id) +{ + GList *r = NULL; + LassoSamlAssertion *assertion = g_hash_table_lookup(session->assertions, provider_id); + if (assertion) + r = g_list_append(r, g_object_ref(assertion)); + return r; +} + + /** * lasso_session_get_status * @session: a #LassoSession diff --git a/lasso/id-ff/session.h b/lasso/id-ff/session.h index 55f5ebed..469b6617 100644 --- a/lasso/id-ff/session.h +++ b/lasso/id-ff/session.h @@ -47,7 +47,8 @@ typedef struct _LassoSessionPrivate LassoSessionPrivate; struct _LassoSession { LassoNode parent; - GHashTable *assertions; /* hash for assertions with remote providerID as key */ + /*< public >*/ + GHashTable *assertions; gboolean is_dirty; /*< private >*/ @@ -65,6 +66,7 @@ LASSO_EXPORT LassoSession* lasso_session_new_from_dump(const gchar *dump); LASSO_EXPORT gchar* lasso_session_dump(LassoSession *session); LASSO_EXPORT void lasso_session_destroy(LassoSession *session); +LASSO_EXPORT GList* lasso_session_get_assertions(LassoSession *session, const char* provider_id); LASSO_EXPORT gchar* lasso_session_get_provider_index(LassoSession *session, gint index); LASSO_EXPORT gboolean lasso_session_is_empty(LassoSession *session); |
