summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorValery Febvre <vfebvre at easter-eggs.com>2004-07-13 03:37:35 +0000
committerValery Febvre <vfebvre at easter-eggs.com>2004-07-13 03:37:35 +0000
commit07cabd35b61615d1f2ac1b09e7a79988f8722bca (patch)
tree41e6639f222766f5969b2984f65ed9819a81e7dc
parent0d240f6c5c1a8cf8657400807bae545186a7efe0 (diff)
downloadlasso-07cabd35b61615d1f2ac1b09e7a79988f8722bca.tar.gz
lasso-07cabd35b61615d1f2ac1b09e7a79988f8722bca.tar.xz
lasso-07cabd35b61615d1f2ac1b09e7a79988f8722bca.zip
*** empty log message ***
-rw-r--r--lasso/id-ff/federation_termination.c4
-rw-r--r--lasso/id-ff/login.c8
-rw-r--r--lasso/id-ff/logout.c4
-rw-r--r--lasso/id-ff/profile_context.c34
-rw-r--r--lasso/id-ff/profile_context.h14
-rw-r--r--lasso/id-ff/register_name_identifier.c4
6 files changed, 30 insertions, 38 deletions
diff --git a/lasso/id-ff/federation_termination.c b/lasso/id-ff/federation_termination.c
index 312b301e..ad3e73e3 100644
--- a/lasso/id-ff/federation_termination.c
+++ b/lasso/id-ff/federation_termination.c
@@ -107,12 +107,12 @@ lasso_federation_termination_init_request(LassoFederationTermination *notificati
/* get the name identifier (!!! depend on the provider type : SP or IDP !!!)*/
switch(profileContext->provider_type){
- case lassoProfileContextServiceProviderType:
+ case lassoProviderTypeSp:
nameIdentifier = LASSO_NODE(lasso_identity_get_local_nameIdentifier(identity));
if(!nameIdentifier)
nameIdentifier = LASSO_NODE(lasso_identity_get_remote_nameIdentifier(identity));
break;
- case lassoProfileContextIdentityProviderType:
+ case lassoProviderTypeIdp:
/* get the next assertion ( next authenticated service provider ) */
nameIdentifier = LASSO_NODE(lasso_identity_get_remote_nameIdentifier(identity));
if(!nameIdentifier)
diff --git a/lasso/id-ff/login.c b/lasso/id-ff/login.c
index a41468c7..9faa0f4c 100644
--- a/lasso/id-ff/login.c
+++ b/lasso/id-ff/login.c
@@ -601,15 +601,15 @@ lasso_login_must_authenticate(LassoLogin *login)
static void
lasso_login_finalize(LassoLogin *login)
-{
- parent_class->finalize(LASSO_PROFILE_CONTEXT(login));
+{
+ debug(INFO, "Login object 0x%x finalized ...\n", login);
g_free(login->assertionArtifact);
g_free(login->nameIdentifier);
g_free(login->response_dump);
g_free(login->msg_relayState);
-
- debug(INFO, "Login object 0x%x finalized ...\n", login);
+
+ parent_class->finalize(LASSO_PROFILE_CONTEXT(login));
}
/*****************************************************************************/
diff --git a/lasso/id-ff/logout.c b/lasso/id-ff/logout.c
index 661fbf1f..417568ae 100644
--- a/lasso/id-ff/logout.c
+++ b/lasso/id-ff/logout.c
@@ -148,13 +148,13 @@ lasso_logout_init_request(LassoLogout *logout,
/* get the name identifier (!!! depend on the provider type : SP or IDP !!!)*/
switch(profileContext->provider_type){
- case lassoProfileContextServiceProviderType:
+ case lassoProviderTypeSp:
printf("service provider\n");
nameIdentifier = LASSO_NODE(lasso_identity_get_local_nameIdentifier(identity));
if(!nameIdentifier)
nameIdentifier = LASSO_NODE(lasso_identity_get_remote_nameIdentifier(identity));
break;
- case lassoProfileContextIdentityProviderType:
+ case lassoProviderTypeIdp:
printf("identity provider\n");
/* get the next assertion ( next authenticated service provider ) */
nameIdentifier = LASSO_NODE(lasso_identity_get_remote_nameIdentifier(identity));
diff --git a/lasso/id-ff/profile_context.c b/lasso/id-ff/profile_context.c
index 17ec968e..df14d58f 100644
--- a/lasso/id-ff/profile_context.c
+++ b/lasso/id-ff/profile_context.c
@@ -33,6 +33,8 @@ struct _LassoProfileContextPrivate
gboolean dispose_has_run;
};
+static GObjectClass *parent_class = NULL;
+
/*****************************************************************************/
/* functions */
/*****************************************************************************/
@@ -46,8 +48,6 @@ lasso_profile_context_dump(LassoProfileContext *ctx,
const gchar *name)
{
LassoNode *node;
-/* xmlDocPtr doc = NULL; */
-/* xmlNodePtr cdata, data; */
gchar *child_dump, *dump = NULL;
node = lasso_node_new();
@@ -57,13 +57,12 @@ lasso_profile_context_dump(LassoProfileContext *ctx,
else {
LASSO_NODE_GET_CLASS(node)->set_name(node, "LassoProfileContext");
}
- //LASSO_NODE_GET_CLASS(node)->set_ns(node, lassoLibHRef, lassoLibPrefix);
if (ctx->request != NULL) {
- LASSO_NODE_GET_CLASS(node)->add_child(node, ctx->request, FALSE);
+ LASSO_NODE_GET_CLASS(node)->add_child(node, lasso_node_copy(ctx->request), FALSE);
}
if (ctx->response != NULL) {
- LASSO_NODE_GET_CLASS(node)->add_child(node, ctx->response, FALSE);
+ LASSO_NODE_GET_CLASS(node)->add_child(node, lasso_node_copy(ctx->response), FALSE);
}
if (ctx->remote_providerID != NULL) {
@@ -72,12 +71,6 @@ lasso_profile_context_dump(LassoProfileContext *ctx,
}
if (ctx->msg_url != NULL) {
-/* doc = xmlNewDoc("1.0"); */
-/* data = xmlNewNode(NULL, "data"); */
-/* xmlNewNs(data, lassoLibHRef, NULL); */
-/* cdata = xmlNewCDataBlock(doc, ctx->msg_url, strlen(ctx->msg_url)); */
-/* xmlAddChild(data, cdata); */
-/* xmlAddChild(LASSO_NODE_GET_CLASS(node)->get_xmlNode(node), data); */
LASSO_NODE_GET_CLASS(node)->new_child(node, "MsgUrl", lasso_str_escape(ctx->msg_url), FALSE);
}
if (ctx->msg_body != NULL) {
@@ -136,30 +129,27 @@ lasso_profile_context_dispose(LassoProfileContext *ctx)
}
ctx->private->dispose_has_run = TRUE;
+ debug(INFO, "ProfileContext object 0x%x disposed ...\n", ctx);
/* unref reference counted objects */
/* we don't have any here */
- debug(INFO, "ProfileContext object 0x%x disposed ...\n", ctx);
+ lasso_node_destroy(ctx->request);
+ lasso_node_destroy(ctx->response);
+ /* BEWARE: server and user shouldn't be destroyed */
+ parent_class->dispose(G_OBJECT(ctx));
}
static void
lasso_profile_context_finalize(LassoProfileContext *ctx)
{
- if (ctx->private->dispose_has_run) {
- return;
- }
debug(INFO, "ProfileContext object 0x%x finalized ...\n", ctx);
- /* server and user shouldn't be destroyed */
- printf("toto\n");
- lasso_node_destroy(ctx->request);
- printf("toto2\n");
- lasso_node_destroy(ctx->response);
g_free(ctx->remote_providerID);
g_free(ctx->msg_url);
g_free(ctx->msg_body);
g_free (ctx->private);
+ parent_class->finalize(G_OBJECT(ctx));
}
/*****************************************************************************/
@@ -187,7 +177,7 @@ lasso_profile_context_instance_init(GTypeInstance *instance,
ctx->response = NULL;
ctx->request_type = lassoMessageTypeNone;
ctx->response_type = lassoMessageTypeNone;
- // TODO ctx->provider_type = lassoMachinTrucNone;
+ ctx->provider_type = lassoProviderTypeNone;
ctx->remote_providerID = NULL;
@@ -244,6 +234,8 @@ lasso_profile_context_class_init(gpointer g_class,
GObjectClass *gobject_class = G_OBJECT_CLASS (g_class);
GParamSpec *pspec;
+ parent_class = g_type_class_peek_parent(g_class);
+ /* override parent class methods */
gobject_class->set_property = lasso_profile_context_set_property;
gobject_class->get_property = lasso_profile_context_get_property;
diff --git a/lasso/id-ff/profile_context.h b/lasso/id-ff/profile_context.h
index ac13be43..c9ba4f9b 100644
--- a/lasso/id-ff/profile_context.h
+++ b/lasso/id-ff/profile_context.h
@@ -56,9 +56,10 @@ typedef enum {
} lassoHttpMethods;
typedef enum {
- lassoProfileContextServiceProviderType = 1,
- lassoProfileContextIdentityProviderType
-} lassoProfileContextProviderTypes;
+ lassoProviderTypeNone = 0,
+ lassoProviderTypeSp,
+ lassoProviderTypeIdp
+} lassoProviderTypes;
typedef enum {
lassoMessageTypeNone = 0,
@@ -84,12 +85,11 @@ struct _LassoProfileContext {
gchar *msg_url;
gchar *msg_body;
- int provider_type;
-
/*< private >*/
LassoProfileContextPrivate *private;
- lassoMessageTypes request_type;
- lassoMessageTypes response_type;
+ lassoMessageTypes request_type;
+ lassoMessageTypes response_type;
+ lassoProviderTypes provider_type;
};
struct _LassoProfileContextClass {
diff --git a/lasso/id-ff/register_name_identifier.c b/lasso/id-ff/register_name_identifier.c
index 2482349c..856e0e60 100644
--- a/lasso/id-ff/register_name_identifier.c
+++ b/lasso/id-ff/register_name_identifier.c
@@ -146,7 +146,7 @@ lasso_register_name_identifier_init_request(LassoRegisterNameIdentifier *registe
/* TODO : implement the setting of the request */
switch(profileContext->provider_type){
- case lassoProfileContextServiceProviderType:
+ case lassoProviderTypeSp:
/* generate a new local name identifier */
spNameIdentifier = lasso_build_unique_id(32);
spNameQualifier = providerID;
@@ -168,7 +168,7 @@ lasso_register_name_identifier_init_request(LassoRegisterNameIdentifier *registe
idpNameQualifier = lasso_node_get_attr_value(nameIdentifier_node, "NameQualifier");
idpFormat = lasso_node_get_attr_value(nameIdentifier_node, "Format");
break;
- case lassoProfileContextIdentityProviderType:
+ case lassoProviderTypeIdp:
/* generate a new local name identifier */
idpNameIdentifier = lasso_build_unique_id(32);
idpNameQualifier = providerID;